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

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

            ListSchedulesResponse resp = new ListSchedulesResponse();

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

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

                foreach (var obj in resp.Schedules)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Exemplo n.º 2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListSchedulesRequest request;

            try
            {
                request = new ListSchedulesRequest
                {
                    WorkspaceId    = WorkspaceId,
                    ApplicationKey = ApplicationKey,
                    Key            = Key,
                    Name           = Name,
                    Identifier     = Identifier,
                    Type           = Type,
                    Page           = Page,
                    Limit          = Limit,
                    SortBy         = SortBy,
                    SortOrder      = SortOrder,
                    OpcRequestId   = OpcRequestId
                };
                IEnumerable <ListSchedulesResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.ScheduleSummaryCollection, 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);
            }
        }