コード例 #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonElasticLoadBalancingV2Config config = new AmazonElasticLoadBalancingV2Config();

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

            DescribeListenersResponse resp = new DescribeListenersResponse();

            do
            {
                DescribeListenersRequest req = new DescribeListenersRequest
                {
                    Marker = resp.NextMarker
                };

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

                foreach (var obj in resp.Listeners)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextMarker));
        }
        protected IAmazonElasticLoadBalancingV2 CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonElasticLoadBalancingV2Config {
                RegionEndpoint = region
            };

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

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