/// <summary>
        /// Lists job runs based on a set of parameters. A job run is a unit of work, such as
        /// a Spark jar, PySpark script, or SparkSQL query, that you submit to Amazon EMR on EKS.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListJobRuns 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 ListJobRuns service method, as returned by EMRContainers.</returns>
        /// <exception cref="Amazon.EMRContainers.Model.InternalServerException">
        /// This is an internal server exception.
        /// </exception>
        /// <exception cref="Amazon.EMRContainers.Model.ValidationException">
        /// There are invalid parameters in the client request.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/emr-containers-2020-10-01/ListJobRuns">REST API Reference for ListJobRuns Operation</seealso>
        public virtual Task <ListJobRunsResponse> ListJobRunsAsync(ListJobRunsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListJobRunsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListJobRunsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListJobRunsResponse>(request, options, cancellationToken));
        }
        internal virtual ListJobRunsResponse ListJobRuns(ListJobRunsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListJobRunsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListJobRunsResponseUnmarshaller.Instance;

            return(Invoke <ListJobRunsResponse>(request, options));
        }
Exemple #3
0
 /// <summary>
 /// Creates a new enumerable which will iterate over the responses received from the ListJobRuns operation. This enumerable
 /// will fetch more data from the server as needed.
 /// </summary>
 /// <param name="request">The request object containing the details to send</param>
 /// <param name="retryConfiguration">The configuration for retrying, may be null</param>
 /// <param name="cancellationToken">The cancellation token object</param>
 /// <returns>The enumerator, which supports a simple iteration over a collection of a specified type</returns>
 public IEnumerable <ListJobRunsResponse> ListJobRunsResponseEnumerator(ListJobRunsRequest request, Common.Retry.RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default)
 {
     return(new Common.Utils.ResponseEnumerable <ListJobRunsRequest, ListJobRunsResponse>(
                response => response.OpcNextPage,
                input =>
     {
         if (!string.IsNullOrEmpty(input))
         {
             request.Page = input;
         }
         return request;
     },
                request => client.ListJobRuns(request, retryConfiguration, cancellationToken)
                ));
 }
Exemple #4
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListJobRunsRequest request;

            try
            {
                request = new ListJobRunsRequest
                {
                    CompartmentId          = CompartmentId,
                    OpcRequestId           = OpcRequestId,
                    Id                     = Id,
                    JobId                  = JobId,
                    ManagedDatabaseId      = ManagedDatabaseId,
                    ManagedDatabaseGroupId = ManagedDatabaseGroupId,
                    RunStatus              = RunStatus,
                    Name                   = Name,
                    Limit                  = Limit,
                    Page                   = Page,
                    SortBy                 = SortBy,
                    SortOrder              = SortOrder
                };
                IEnumerable <ListJobRunsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.JobRunCollection, 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);
            }
        }