示例#1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonGroundStationConfig config = new AmazonGroundStationConfig();

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

            ListConfigsResponse resp = new ListConfigsResponse();

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

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

                foreach (var obj in resp.ConfigList)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
示例#2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListConfigsRequest request;

            try
            {
                request = new ListConfigsRequest
                {
                    ApmDomainId  = ApmDomainId,
                    OpcRequestId = OpcRequestId,
                    ConfigType   = ConfigType,
                    DisplayName  = DisplayName,
                    Limit        = Limit,
                    Page         = Page,
                    SortOrder    = SortOrder,
                    SortBy       = SortBy
                };
                IEnumerable <ListConfigsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.ConfigCollection, true);
                }
                if (!ParameterSetName.Equals(AllPageSet) && !ParameterSetName.Equals(LimitSet) && response.OpcNextPage != null)
                {
                    WriteWarning("This operation supports pagination and not all resources were returned. Re-run using the -All option to auto paginate and list all resources.");
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }