public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonStorageGatewayConfig config = new AmazonStorageGatewayConfig();

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

            ListTagsForResourceResponse resp = new ListTagsForResourceResponse();

            do
            {
                ListTagsForResourceRequest req = new ListTagsForResourceRequest
                {
                    Marker = resp.Marker
                    ,
                    Limit = maxItems
                };

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

                foreach (var obj in resp.Tags)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.Marker));
        }
Пример #2
0
        public void StorageGatewayListTagsForResource()
        {
            #region to-list-tags-that-have-been-added-to-a-resource-1472080268972

            var client   = new AmazonStorageGatewayClient();
            var response = client.ListTagsForResource(new ListTagsForResourceRequest
            {
                Limit       = 1,
                Marker      = "1",
                ResourceARN = "arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-11A2222B"
            });

            string     marker      = response.Marker;
            string     resourceARN = response.ResourceARN;
            List <Tag> tags        = response.Tags;

            #endregion
        }