Пример #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonECSConfig config = new AmazonECSConfig();

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

            ListServicesResponse resp = new ListServicesResponse();

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

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

                foreach (var obj in resp.ServiceArns)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Пример #2
0
        protected IAmazonECS CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonECSConfig {
                RegionEndpoint = region
            };

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

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }