public ZAwsElasticIp(ZAwsEc2Controller controller, Amazon.EC2.Model.Address res) : base(controller) { Update(res); //myController.HandleNewElasticIp(this); }
} ///Seconds! protected ZAwsTask(ZAwsEc2Controller controller, string taskname) { Taskname = taskname; myController = controller; StartMessage = string.Format("Starting task {0}", taskname); SuccessMessage = string.Format("Task executed succesfully."); ExceptionMessage = "Error executing task " + taskname + ", reason: {1}"; DelayBeforeTaskStart = 0; }
public ZAwsTaskInstallApps(ZAwsEc2Controller controller, string eC2Name, ZAws.ZAwsAmi.NewApp[] appsToInstall) : base(controller, "Application will be installed.") { Ec2Name = eC2Name; AppsToInstall = appsToInstall; StartMessage = ""; SuccessMessage = ""; ExceptionMessage = "Error installing applications, reason: {0}"; DelayBeforeTaskStart = 10; }
public ZAwsTaskNewSpotRequestHandling(ZAwsEc2Controller controller, string spotRequestId, string Name) : base(controller, "New Spot Request handling.") { SpotRequestId = spotRequestId; Ec2NewName = Name; StartMessage = ""; SuccessMessage = "Succesfully handled new Spot Request."; ExceptionMessage = "Error handling Spot Request, reason: {0}"; DelayBeforeTaskStart = 0; }
public ZAwsEc2(ZAwsEc2Controller controller, Amazon.EC2.Model.Reservation res) : base(controller) { StatisticsValid = false; LatestBootConsoleTimestamp = ""; ConsoleOutput = ""; Update(res); /* * Trace.WriteLine("Now will see to configure new applications."); * ConfigureAppsWhenBootingComplete = myController.HandleNewEc2Instance(this) ? 3 : 0; * Trace.WriteLine("ConfigureAppsWhenBootingComplete = " + ConfigureAppsWhenBootingComplete.ToString()); * */ }
public ZAwsS3(ZAwsEc2Controller controller, Amazon.S3.Model.S3Bucket res) : base(controller) { Update(res); }
public ZAwsSecGroup(ZAwsEc2Controller controller, Amazon.EC2.Model.SecurityGroup res) : base(controller) { Update(res); }
public ZAwsKeyPair(ZAwsEc2Controller controller, Amazon.EC2.Model.KeyPair res) : base(controller) { Update(res); }
public ZAwsSnapshot(ZAwsEc2Controller controller, Amazon.EC2.Model.Snapshot res) : base(controller) { Update(res); }
public ZAwsEbsVolume(ZAwsEc2Controller controller, Amazon.EC2.Model.Volume res) : base(controller) { Update(res); }
public ZAwsSpotRequest(ZAwsEc2Controller controller, Amazon.EC2.Model.SpotInstanceRequest res) : base(controller) { Update(res); }
public ZAwsAmi(ZAwsEc2Controller controller, Amazon.EC2.Model.Image res) : base(controller) { Update(res); }
public ZAwsHostedZone(ZAwsEc2Controller controller, HostedZone res) : base(controller) { Update(res); RecordsAvailable = false; }
protected ZAwsObject(ZAwsEc2Controller controller) { myController = controller; }
internal ZAwsTaskHandler(ZAwsEc2Controller controller) { myController = controller; handlerThread = new Thread(new ThreadStart(delegate { Thread.CurrentThread.Name = "TaskHandler"; while (runner) { ZAwsObject currentObject = null; lock (myLock) { try { currentObject = myTagetObjects.Dequeue(); } catch (System.InvalidOperationException) { if (!runner) { return; } runnerEver.Reset(); } } if (currentObject == null) { //Now wait for the next object to be added runnerEver.WaitOne(3000); continue; } while (true) { ZAwsTask currentTask = null; lock (myLock) { for (int i = 0; i < myTaskList.Count; i++) { if (myTaskList[i].WillHandle(currentObject)) { //remove this task from list currentTask = myTaskList[i]; myTaskList.RemoveAt(i); break; } } } if (currentTask == null) { break; } if (sleepEvent.WaitOne(currentTask.DelayBeforeTaskStart * 1000)) { //This event is only set by the Close function, so if this returns true, you should close right away return; } Program.TraceLine(currentTask.StartMessage); try { currentTask.DoExecute(currentObject); Program.TraceLine(currentTask.SuccessMessage); } catch (Exception ex) { Program.TraceLine(currentTask.ExceptionMessage, ex); } } } })); handlerThread.Start(); }