public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonAutoScalingConfig config = new AmazonAutoScalingConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonAutoScalingClient client = new AmazonAutoScalingClient(creds, config);

            DescribeAutoScalingInstancesResponse resp = new DescribeAutoScalingInstancesResponse();

            do
            {
                DescribeAutoScalingInstancesRequest req = new DescribeAutoScalingInstancesRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxRecords = maxItems
                };

                resp = client.DescribeAutoScalingInstances(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.AutoScalingInstances)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Пример #2
0
        /// <summary>
        /// Notification configuration window load event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NcWindow_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                AmazonAutoScalingConfig config = new AmazonAutoScalingConfig();
                config.ServiceURL = ((ViewModel)this.DataContext).Region.Url;
                AmazonAutoScalingClient client = new AmazonAutoScalingClient(config);
                DescribeAutoScalingNotificationTypesRequest  dasntreq  = new DescribeAutoScalingNotificationTypesRequest();
                DescribeAutoScalingNotificationTypesResponse dasntresp = client.DescribeAutoScalingNotificationTypes(dasntreq);
                foreach (string asnt in dasntresp.DescribeAutoScalingNotificationTypesResult.AutoScalingNotificationTypes)
                {
                    this.notificationTypes.Add(asnt);
                }

                AmazonSimpleNotificationServiceConfig snsconfig = new AmazonSimpleNotificationServiceConfig();
                config.ServiceURL = ((ViewModel)this.DataContext).Region.Url;
                AmazonSimpleNotificationServiceClient snsclient = new AmazonSimpleNotificationServiceClient(snsconfig);
                ListTopicsRequest  ltrequest = new ListTopicsRequest();
                ListTopicsResponse ltresp    = snsclient.ListTopics(ltrequest);
                foreach (Topic topic in ltresp.ListTopicsResult.Topics)
                {
                    this.snstopics.Add(topic.TopicArn);
                }

                rlbNcTypes.ItemsSource = this.notificationTypes;
                cboTopics.ItemsSource  = this.snstopics;
            }
            catch
            {
                MessageBox.Show(Window.GetWindow(this), "Error occured while loading the notification configuration options.", "Error", MessageBoxButton.OK);
                this.Close();
            }
        }
Пример #3
0
 /// <summary>
 /// Create a client for the Amazon AutoScaling Service with the specified configuration
 /// </summary>
 /// <param name="awsAccessKey">The AWS Access Key associated with the account</param>
 /// <param name="awsSecretAccessKey">The AWS Secret Access Key associated with the account</param>
 /// <param name="config">Configuration options for the service like HTTP Proxy, # of connections, etc
 /// </param>
 /// <returns>An Amazon AutoScaling client</returns>
 /// <remarks>
 /// </remarks>
 public static IAmazonAutoScaling CreateAmazonAutoScalingClient(
     string awsAccessKey,
     string awsSecretAccessKey, AmazonAutoScalingConfig config
     )
 {
     return(new AmazonAutoScalingClient(awsAccessKey, awsSecretAccessKey, config));
 }
Пример #4
0
        public override IAmazonAutoScaling CreateAutoScalingClient()
        {
            var config = new AmazonAutoScalingConfig()
            {
                RegionEndpoint = AWSRegion
            };

            return(new AmazonAutoScalingClient(Credentials, config));
        }
Пример #5
0
        protected IAmazonAutoScaling CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonAutoScalingConfig {
                RegionEndpoint = region
            };

            Amazon.PowerShell.Utils.Common.PopulateConfig(this, config);
            this.CustomizeClientConfig(config);
            var client = new AmazonAutoScalingClient(credentials, config);

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }
Пример #6
0
 /// <summary>
 /// Create a client for the Amazon AutoScaling Service with AWSCredentials and an AmazonAutoScaling Configuration object.
 /// </summary>
 /// <param name="credentials">AWS Credentials</param>
 /// <param name="config">Configuration options for the service like HTTP Proxy, # of connections, etc</param>
 /// <returns>An Amazon AutoScaling client</returns>
 /// <remarks>
 /// </remarks>
 public static IAmazonAutoScaling CreateAmazonAutoScalingClient(AWSCredentials credentials, AmazonAutoScalingConfig config)
 {
     return(new AmazonAutoScalingClient(credentials, config));
 }