Esempio n. 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonOpsWorksConfig config = new AmazonOpsWorksConfig();

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

            DescribeEcsClustersResponse resp = new DescribeEcsClustersResponse();

            do
            {
                DescribeEcsClustersRequest req = new DescribeEcsClustersRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

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

                foreach (var obj in resp.EcsClusters)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        protected IAmazonOpsWorks CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonOpsWorksConfig {
                RegionEndpoint = region
            };

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

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }
Esempio n. 3
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonOpsWorksConfig config = new AmazonOpsWorksConfig();

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

            DescribeVolumesResponse resp = new DescribeVolumesResponse();
            DescribeVolumesRequest  req  = new DescribeVolumesRequest
            {
            };

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

            foreach (var obj in resp.Volumes)
            {
                AddObject(obj);
            }
        }