protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListTasksRequest request;

            try
            {
                request = new ListTasksRequest
                {
                    WorkspaceId  = WorkspaceId,
                    OpcRequestId = OpcRequestId,
                    FolderId     = FolderId,
                    Fields       = Fields,
                    Name         = Name,
                    Key          = Key,
                    Identifier   = Identifier,
                    Type         = Type,
                    Limit        = Limit,
                    Page         = Page,
                    SortOrder    = SortOrder,
                    SortBy       = SortBy
                };
                IEnumerable <ListTasksResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.TaskSummaryCollection, true);
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Esempio n. 2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonDataSyncConfig config = new AmazonDataSyncConfig();

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

            ListTasksResponse resp = new ListTasksResponse();

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

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

                foreach (var obj in resp.Tasks)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Esempio n. 3
0
        internal ListTasksResponse ListTasks(ListTasksRequest request)
        {
            var marshaller   = new ListTasksRequestMarshaller();
            var unmarshaller = ListTasksResponseUnmarshaller.Instance;

            return(Invoke <ListTasksRequest, ListTasksResponse>(request, marshaller, unmarshaller));
        }
        private static async Task <List <string> > ListTaskArns(
            AmazonECSClient ecsClient,
            string cluster,
            string serviceName,
            CancellationToken token)
        {
            var listTaskRequest = new ListTasksRequest
            {
                Cluster       = cluster,
                ServiceName   = serviceName,
                DesiredStatus = DesiredStatus.RUNNING
            };

            var accumulator = new List <string>();

            do
            {
                var listTaskResult = await ecsClient.ListTasksAsync(listTaskRequest, token);

                accumulator.AddRange(listTaskResult.TaskArns);
                listTaskRequest.NextToken = listTaskResult.NextToken;
            } while (listTaskRequest.NextToken != null);

            return(accumulator);
        }
        public IListTasksResponse TaskList()
        {
            var request  = new ListTasksRequest();
            var response = client.ListTasks(request);

            return(response);
        }
Esempio n. 6
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListTasks operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListTasks operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <ListTasksResponse> ListTasksAsync(ListTasksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListTasksRequestMarshaller();
            var unmarshaller = ListTasksResponseUnmarshaller.Instance;

            return(InvokeAsync <ListTasksRequest, ListTasksResponse>(request, marshaller,
                                                                     unmarshaller, cancellationToken));
        }
Esempio n. 7
0
        /// <summary>
        /// Returns a list of tasks that can be filtered by state.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListTasks service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the ListTasks service method, as returned by SnowDeviceManagement.</returns>
        /// <exception cref="Amazon.SnowDeviceManagement.Model.AccessDeniedException">
        /// You don't have sufficient access to perform this action.
        /// </exception>
        /// <exception cref="Amazon.SnowDeviceManagement.Model.InternalServerException">
        /// An unexpected error occurred while processing the request.
        /// </exception>
        /// <exception cref="Amazon.SnowDeviceManagement.Model.ThrottlingException">
        /// The request was denied due to request throttling.
        /// </exception>
        /// <exception cref="Amazon.SnowDeviceManagement.Model.ValidationException">
        /// The input fails to satisfy the constraints specified by an Amazon Web Services service.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/snow-device-management-2021-08-04/ListTasks">REST API Reference for ListTasks Operation</seealso>
        public virtual Task <ListTasksResponse> ListTasksAsync(ListTasksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListTasksRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListTasksResponseUnmarshaller.Instance;

            return(InvokeAsync <ListTasksResponse>(request, options, cancellationToken));
        }
Esempio n. 8
0
        internal virtual ListTasksResponse ListTasks(ListTasksRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListTasksRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListTasksResponseUnmarshaller.Instance;

            return(Invoke <ListTasksResponse>(request, options));
        }
Esempio n. 9
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListTasksRequest request;

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