Ejemplo n.º 1
0
 public DlgEditDnsRecord(ZAwsEc2Controller controller, ResourceRecordSet records)
 {
     InitializeComponent();
     MyController = controller;
     MyRecords = records;
     comboBoxRecordType.SelectedIndex = 0;
 }
Ejemplo n.º 2
0
        public ZAwsElasticIp(ZAwsEc2Controller controller, Amazon.EC2.Model.Address res)
            : base(controller)
        {
            Update(res);

            //myController.HandleNewElasticIp(this);
        }
Ejemplo n.º 3
0
 public DlgEditDnsRecord(ZAwsEc2Controller controller, ResourceRecordSet records)
 {
     InitializeComponent();
     MyController = controller;
     MyRecords    = records;
     comboBoxRecordType.SelectedIndex = 0;
 }
Ejemplo n.º 4
0
        public DlgViewDnsRecords(ZAwsEc2Controller Controller, ZAwsHostedZone Zone)
        {
            InitializeComponent();

            MyController = Controller;
            MyZone = Zone;

            this.Text = string.Format("Hosted zone {0} resource records", MyZone.Name);
        }
Ejemplo n.º 5
0
        public DlgViewDnsRecords(ZAwsEc2Controller Controller, ZAwsHostedZone Zone)
        {
            InitializeComponent();

            MyController = Controller;
            MyZone       = Zone;

            this.Text = string.Format("Hosted zone {0} resource records", MyZone.Name);
        }
Ejemplo n.º 6
0
        public DlgLaunchNewInstance(ZAwsEc2Controller controller, ZAwsAmi ami, ZAwsSecGroup secGroup, ZAwsKeyPair keyPair)
        {
            Ami = ami;
            SecGroup = secGroup;
            KeyPair = keyPair;
            Controller = controller;

            InitializeComponent();
        }
Ejemplo n.º 7
0
        public DlgLaunchNewInstance(ZAwsEc2Controller controller, ZAwsAmi ami, ZAwsSecGroup secGroup, ZAwsKeyPair keyPair)
        {
            Ami        = ami;
            SecGroup   = secGroup;
            KeyPair    = keyPair;
            Controller = controller;

            InitializeComponent();
        }
Ejemplo n.º 8
0
        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;
        }
Ejemplo n.º 9
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());
             * */
        }
Ejemplo n.º 10
0
 public ZAwsEbsVolume(ZAwsEc2Controller controller, Amazon.EC2.Model.Volume res)
     : base(controller)
 {
     Update(res);
 }
Ejemplo n.º 11
0
 public ZAwsSecGroup(ZAwsEc2Controller controller, Amazon.EC2.Model.SecurityGroup res)
     : base(controller)
 {
     Update(res);
 }
Ejemplo n.º 12
0
 public ZAwsHostedZone(ZAwsEc2Controller controller, HostedZone res)
     : base(controller)
 {
     Update(res);
     RecordsAvailable = false;
 }
Ejemplo n.º 13
0
 public ZAwsSnapshot(ZAwsEc2Controller controller, Amazon.EC2.Model.Snapshot res)
     : base(controller)
 {
     Update(res);
 }
Ejemplo n.º 14
0
        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;
        }
Ejemplo n.º 15
0
 protected ZAwsObject(ZAwsEc2Controller controller)
 {
     myController = controller;
 }
Ejemplo n.º 16
0
 public ZAwsKeyPair(ZAwsEc2Controller controller, Amazon.EC2.Model.KeyPair res)
     : base(controller)
 {
     Update(res);
 }
Ejemplo n.º 17
0
 public DlgNewHostedZone(ZAwsEc2Controller controller)
 {
     InitializeComponent();
     Controller = controller;
 }
Ejemplo n.º 18
0
 public ZAwsSpotRequest(ZAwsEc2Controller controller, Amazon.EC2.Model.SpotInstanceRequest res)
     : base(controller)
 {
     Update(res);
 }
Ejemplo n.º 19
0
 public DlgNewHostedZone(ZAwsEc2Controller controller)
 {
     InitializeComponent();
     Controller = controller;
 }
Ejemplo n.º 20
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;
        }
Ejemplo n.º 21
0
        void controller_NewObject(object sender, ZAwsEc2Controller.ZAwsNewObjectEventArgs e)
        {
            if (this.InvokeRequired)
            {
                Debug.Assert(e.NewObject != null);
                //Following Invoknig must be asynchronous, so not to cause deadlock with the Disconnect handler.
                this.BeginInvoke(new EventHandler<ZAwsEc2Controller.ZAwsNewObjectEventArgs>(controller_NewObject), sender, e);
                return;
            }
            if (awsListView.Items.Count == 1 && awsListView.Items[0].Tag == null)
            {
                awsListView.Items.Clear();
            }

            ListViewGroup g;
            if (e.NewObject.GetType() == typeof(ZAwsEc2))
            {
                g = awsListView.Groups["EC2"];
                awsListView.ShowGroups = true;
            }
            else if (e.NewObject.GetType() == typeof(ZAwsS3))
            {
                g = awsListView.Groups["S3"];
                awsListView.ShowGroups = true;
            }
            else if (e.NewObject.GetType() == typeof(ZAwsHostedZone))
            {
                g = awsListView.Groups["DNS"];
                awsListView.ShowGroups = true;
            }
            else
            {
                g = awsListView.Groups["EC2x"];
            }

            ListViewItem newItem = new ListViewItem(e.NewObject.Name);
            newItem.Tag = e.NewObject;
            awsListView.Items.Add(newItem);
            g.Items.Add(newItem);

            e.NewObject.StatusChanged += new EventHandler(ZAwsObject_StatusChanged);
            e.NewObject.ObjectDeleted += new EventHandler(ZAwsObject_ObjectDeleted);
            awsListView_SelectedIndexChanged(sender, e);
        }
Ejemplo n.º 22
0
 public ZAwsS3(ZAwsEc2Controller controller, Amazon.S3.Model.S3Bucket res)
     : base(controller)
 {
     Update(res);
 }
Ejemplo n.º 23
0
 public ZAwsAmi(ZAwsEc2Controller controller, Amazon.EC2.Model.Image res)
     : base(controller)
 {
     Update(res);
 }
Ejemplo n.º 24
0
        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();
        }