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

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

            ListAliasesResponse resp = new ListAliasesResponse();

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

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

                foreach (var obj in resp.Aliases)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextMarker));
        }
Exemplo n.º 2
0
        protected IAmazonKeyManagementService CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonKeyManagementServiceConfig {
                RegionEndpoint = region
            };

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

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