protected override void ProcessRecord() { AmazonElasticMapReduce client = base.GetClient(); Amazon.ElasticMapReduce.Model.TerminateJobFlowsRequest request = new Amazon.ElasticMapReduce.Model.TerminateJobFlowsRequest(); if (string.IsNullOrEmpty(this._JobFlowIds)) { request.JobFlowIds.Add(this._JobFlowIds); } Amazon.ElasticMapReduce.Model.TerminateJobFlowsResponse response = client.TerminateJobFlows(request); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElasticMapReduce.Model.TerminateJobFlowsRequest(); if (cmdletContext.JobFlowId != null) { request.JobFlowIds = cmdletContext.JobFlowId; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Initiates the asynchronous execution of the TerminateJobFlows operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateJobFlows 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<TerminateJobFlowsResponse> TerminateJobFlowsAsync(TerminateJobFlowsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TerminateJobFlowsRequestMarshaller(); var unmarshaller = TerminateJobFlowsResponseUnmarshaller.Instance; return InvokeAsync<TerminateJobFlowsRequest,TerminateJobFlowsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// TerminateJobFlows shuts a list of job flows down. When a job flow is shut down, any /// step not yet completed is canceled and the EC2 instances on which the job flow is /// running are stopped. Any log files not already saved are uploaded to Amazon S3 if /// a LogUri was specified when the job flow was created. /// /// /// <para> /// The maximum number of JobFlows allowed is 10. The call to TerminateJobFlows is asynchronous. /// Depending on the configuration of the job flow, it may take up to 5-20 minutes for /// the job flow to completely terminate and release allocated resources, such as Amazon /// EC2 instances. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the TerminateJobFlows service method.</param> /// /// <returns>The response from the TerminateJobFlows service method, as returned by ElasticMapReduce.</returns> /// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerErrorException"> /// Indicates that an error occurred while processing the request and that the request /// was not completed. /// </exception> public TerminateJobFlowsResponse TerminateJobFlows(TerminateJobFlowsRequest request) { var marshaller = new TerminateJobFlowsRequestMarshaller(); var unmarshaller = TerminateJobFlowsResponseUnmarshaller.Instance; return Invoke<TerminateJobFlowsRequest,TerminateJobFlowsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// TerminateJobFlows shuts a list of job flows down. When a job flow is shut /// down, any step not yet completed is canceled and the EC2 instances on which /// the job flow is running are stopped. Any log files not already saved are uploaded /// to Amazon S3 if a LogUri was specified when the job flow was created. /// /// /// /// <para> /// The call to TerminateJobFlows is asynchronous. Depending on the configuration /// of the job flow, it may take up to 5-20 minutes for the job flow to /// completely terminate and release allocated resources, such as Amazon EC2 instances. /// /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the TerminateJobFlows service method.</param> /// /// <returns>The response from the TerminateJobFlows service method, as returned by ElasticMapReduce.</returns> /// <exception cref="InternalServerErrorException"> /// Indicates that an error occurred while processing the request and that the request /// was not completed. /// </exception> public TerminateJobFlowsResponse TerminateJobFlows(TerminateJobFlowsRequest request) { var task = TerminateJobFlowsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the TerminateJobFlows operation. /// <seealso cref="Amazon.ElasticMapReduce.IAmazonElasticMapReduce.TerminateJobFlows"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateJobFlows 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<TerminateJobFlowsResponse> TerminateJobFlowsAsync(TerminateJobFlowsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TerminateJobFlowsRequestMarshaller(); var unmarshaller = TerminateJobFlowsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, TerminateJobFlowsRequest, TerminateJobFlowsResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> TerminateJobFlows shuts a list of job flows down. When a job flow is shut down, any step not yet completed is canceled and the EC2 /// instances on which the job flow is running are stopped. Any log files not already saved are uploaded to Amazon S3 if a LogUri was specified /// when the job flow was created. </para> <para> The call to TerminateJobFlows is asynchronous. Depending on the configuration of the job flow, /// it may take up to 5-20 minutes for the job flow to completely terminate and release allocated resources, such as Amazon EC2 instances. /// </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateJobFlows service method on /// AmazonElasticMapReduce.</param> /// /// <exception cref="T:Amazon.ElasticMapReduce.Model.InternalServerErrorException" /> public TerminateJobFlowsResponse TerminateJobFlows(TerminateJobFlowsRequest request) { var task = TerminateJobFlowsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the TerminateJobFlows operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateJobFlows operation on AmazonElasticMapReduceClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndTerminateJobFlows /// operation.</returns> public IAsyncResult BeginTerminateJobFlows(TerminateJobFlowsRequest request, AsyncCallback callback, object state) { var marshaller = new TerminateJobFlowsRequestMarshaller(); var unmarshaller = TerminateJobFlowsResponseUnmarshaller.Instance; return BeginInvoke<TerminateJobFlowsRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeTerminateJobFlows(TerminateJobFlowsRequest terminateJobFlowsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new TerminateJobFlowsRequestMarshaller().Marshall(terminateJobFlowsRequest); var unmarshaller = TerminateJobFlowsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the TerminateJobFlows operation. /// <seealso cref="Amazon.ElasticMapReduce.IAmazonElasticMapReduce.TerminateJobFlows"/> /// </summary> /// /// <param name="terminateJobFlowsRequest">Container for the necessary parameters to execute the TerminateJobFlows operation on /// AmazonElasticMapReduce.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public IAsyncResult BeginTerminateJobFlows(TerminateJobFlowsRequest terminateJobFlowsRequest, AsyncCallback callback, object state) { return invokeTerminateJobFlows(terminateJobFlowsRequest, callback, state, false); }
/// <summary> /// <para> TerminateJobFlows shuts a list of job flows down. When a job flow is shut down, any step not yet completed is canceled and the EC2 /// instances on which the job flow is running are stopped. Any log files not already saved are uploaded to Amazon S3 if a LogUri was specified /// when the job flow was created. </para> <para> The call to TerminateJobFlows is asynchronous. Depending on the configuration of the job flow, /// it may take up to 5-20 minutes for the job flow to completely terminate and release allocated resources, such as Amazon EC2 instances. /// </para> /// </summary> /// /// <param name="terminateJobFlowsRequest">Container for the necessary parameters to execute the TerminateJobFlows service method on /// AmazonElasticMapReduce.</param> /// /// <exception cref="InternalServerErrorException"/> public TerminateJobFlowsResponse TerminateJobFlows(TerminateJobFlowsRequest terminateJobFlowsRequest) { IAsyncResult asyncResult = invokeTerminateJobFlows(terminateJobFlowsRequest, null, null, true); return EndTerminateJobFlows(asyncResult); }
/// <summary> /// <para> TerminateJobFlows shuts a list of job flows down. When a job /// flow is shut down, any step not yet completed is canceled and the EC2 /// instances on which the job flow is running are stopped. Any log files /// not already saved are uploaded to Amazon S3 if a LogUri was specified /// when the job flow was created. </para> /// </summary> /// /// <param name="terminateJobFlowsRequest">Container for the necessary /// parameters to execute the TerminateJobFlows service method on /// AmazonElasticMapReduce.</param> /// /// <exception cref="InternalServerErrorException"/> public TerminateJobFlowsResponse TerminateJobFlows(TerminateJobFlowsRequest terminateJobFlowsRequest) { IRequest<TerminateJobFlowsRequest> request = new TerminateJobFlowsRequestMarshaller().Marshall(terminateJobFlowsRequest); TerminateJobFlowsResponse response = Invoke<TerminateJobFlowsRequest, TerminateJobFlowsResponse> (request, this.signer, TerminateJobFlowsResponseUnmarshaller.GetInstance()); return response; }
private Amazon.ElasticMapReduce.Model.TerminateJobFlowsResponse CallAWSServiceOperation(IAmazonElasticMapReduce client, Amazon.ElasticMapReduce.Model.TerminateJobFlowsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic MapReduce", "TerminateJobFlows"); try { #if DESKTOP return(client.TerminateJobFlows(request)); #elif CORECLR return(client.TerminateJobFlowsAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// <para> TerminateJobFlows shuts a list of job flows down. When a job flow is shut down, any step not yet completed is canceled and the EC2 /// instances on which the job flow is running are stopped. Any log files not already saved are uploaded to Amazon S3 if a LogUri was specified /// when the job flow was created. </para> <para> The call to TerminateJobFlows is asynchronous. Depending on the configuration of the job flow, /// it may take up to 5-20 minutes for the job flow to completely terminate and release allocated resources, such as Amazon EC2 instances. /// </para> /// </summary> /// /// <param name="terminateJobFlowsRequest">Container for the necessary parameters to execute the TerminateJobFlows service method on /// AmazonElasticMapReduce.</param> /// /// <exception cref="T:Amazon.ElasticMapReduce.Model.InternalServerErrorException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<TerminateJobFlowsResponse> TerminateJobFlowsAsync(TerminateJobFlowsRequest terminateJobFlowsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TerminateJobFlowsRequestMarshaller(); var unmarshaller = TerminateJobFlowsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, TerminateJobFlowsRequest, TerminateJobFlowsResponse>(terminateJobFlowsRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
IAsyncResult invokeTerminateJobFlows(TerminateJobFlowsRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new TerminateJobFlowsRequestMarshaller(); var unmarshaller = TerminateJobFlowsResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }