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

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

            DescribeContinuousExportsResponse resp = new DescribeContinuousExportsResponse();

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

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

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

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

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