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

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

            GetTagKeysResponse resp = new GetTagKeysResponse();

            do
            {
                GetTagKeysRequest req = new GetTagKeysRequest
                {
                    PaginationToken = resp.PaginationToken
                };

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

                foreach (var obj in resp.TagKeys)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.PaginationToken));
        }
コード例 #2
0
        protected IAmazonResourceGroupsTaggingAPI CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonResourceGroupsTaggingAPIConfig {
                RegionEndpoint = region
            };

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

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