public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.DataPipeline.Model.ReportTaskRunnerHeartbeatRequest(); if (cmdletContext.Hostname != null) { request.Hostname = cmdletContext.Hostname; } if (cmdletContext.TaskrunnerId != null) { request.TaskrunnerId = cmdletContext.TaskrunnerId; } if (cmdletContext.WorkerGroup != null) { request.WorkerGroup = cmdletContext.WorkerGroup; } 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 ReportTaskRunnerHeartbeat operation. /// <seealso cref="Amazon.DataPipeline.IAmazonDataPipeline.ReportTaskRunnerHeartbeat"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReportTaskRunnerHeartbeat 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<ReportTaskRunnerHeartbeatResponse> ReportTaskRunnerHeartbeatAsync(ReportTaskRunnerHeartbeatRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ReportTaskRunnerHeartbeatRequestMarshaller(); var unmarshaller = ReportTaskRunnerHeartbeatResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ReportTaskRunnerHeartbeatRequest, ReportTaskRunnerHeartbeatResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>Task runners call ReportTaskRunnerHeartbeat every 15 minutes to indicate that they are operational. In the case of AWS Data Pipeline /// Task Runner launched on a resource managed by AWS Data Pipeline, the web service can use this call to detect when the task runner /// application has failed and restart a new instance.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReportTaskRunnerHeartbeat service /// method on AmazonDataPipeline.</param> /// /// <returns>The response from the ReportTaskRunnerHeartbeat service method, as returned by AmazonDataPipeline.</returns> /// /// <exception cref="T:Amazon.DataPipeline.Model.InternalServiceErrorException" /> /// <exception cref="T:Amazon.DataPipeline.Model.InvalidRequestException" /> public ReportTaskRunnerHeartbeatResponse ReportTaskRunnerHeartbeat(ReportTaskRunnerHeartbeatRequest request) { var task = ReportTaskRunnerHeartbeatAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the ReportTaskRunnerHeartbeat operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReportTaskRunnerHeartbeat operation on AmazonDataPipelineClient.</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 EndReportTaskRunnerHeartbeat /// operation.</returns> public IAsyncResult BeginReportTaskRunnerHeartbeat(ReportTaskRunnerHeartbeatRequest request, AsyncCallback callback, object state) { var marshaller = new ReportTaskRunnerHeartbeatRequestMarshaller(); var unmarshaller = ReportTaskRunnerHeartbeatResponseUnmarshaller.Instance; return BeginInvoke<ReportTaskRunnerHeartbeatRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Task runners call <code>ReportTaskRunnerHeartbeat</code> every 15 minutes to indicate /// that they are operational. If the AWS Data Pipeline Task Runner is launched on a resource /// managed by AWS Data Pipeline, the web service can use this call to detect when the /// task runner application has failed and restart a new instance. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ReportTaskRunnerHeartbeat service method.</param> /// /// <returns>The response from the ReportTaskRunnerHeartbeat service method, as returned by DataPipeline.</returns> /// <exception cref="Amazon.DataPipeline.Model.InternalServiceErrorException"> /// An internal service error occurred. /// </exception> /// <exception cref="Amazon.DataPipeline.Model.InvalidRequestException"> /// The request was not valid. Verify that your request was properly formatted, that the /// signature was generated with the correct credentials, and that you haven't exceeded /// any of the service limits for your account. /// </exception> public ReportTaskRunnerHeartbeatResponse ReportTaskRunnerHeartbeat(ReportTaskRunnerHeartbeatRequest request) { var marshaller = new ReportTaskRunnerHeartbeatRequestMarshaller(); var unmarshaller = ReportTaskRunnerHeartbeatResponseUnmarshaller.Instance; return Invoke<ReportTaskRunnerHeartbeatRequest,ReportTaskRunnerHeartbeatResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ReportTaskRunnerHeartbeat operation. /// <seealso cref="Amazon.DataPipeline.IAmazonDataPipeline.ReportTaskRunnerHeartbeat"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReportTaskRunnerHeartbeat 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 async Task<ReportTaskRunnerHeartbeatResponse> ReportTaskRunnerHeartbeatAsync(ReportTaskRunnerHeartbeatRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ReportTaskRunnerHeartbeatRequestMarshaller(); var unmarshaller = ReportTaskRunnerHeartbeatResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ReportTaskRunnerHeartbeatRequest, ReportTaskRunnerHeartbeatResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Task runners call ReportTaskRunnerHeartbeat every 15 minutes to indicate that they are operational. In the case of AWS Data Pipeline /// Task Runner launched on a resource managed by AWS Data Pipeline, the web service can use this call to detect when the task runner /// application has failed and restart a new instance.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReportTaskRunnerHeartbeat service /// method on AmazonDataPipeline.</param> /// /// <returns>The response from the ReportTaskRunnerHeartbeat service method, as returned by AmazonDataPipeline.</returns> /// /// <exception cref="T:Amazon.DataPipeline.Model.InternalServiceErrorException" /> /// <exception cref="T:Amazon.DataPipeline.Model.InvalidRequestException" /> public ReportTaskRunnerHeartbeatResponse ReportTaskRunnerHeartbeat(ReportTaskRunnerHeartbeatRequest request) { var task = ReportTaskRunnerHeartbeatAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
IAsyncResult invokeReportTaskRunnerHeartbeat(ReportTaskRunnerHeartbeatRequest reportTaskRunnerHeartbeatRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ReportTaskRunnerHeartbeatRequestMarshaller().Marshall(reportTaskRunnerHeartbeatRequest); var unmarshaller = ReportTaskRunnerHeartbeatResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the ReportTaskRunnerHeartbeat operation. /// <seealso cref="Amazon.DataPipeline.IAmazonDataPipeline.ReportTaskRunnerHeartbeat"/> /// </summary> /// /// <param name="reportTaskRunnerHeartbeatRequest">Container for the necessary parameters to execute the ReportTaskRunnerHeartbeat operation on /// AmazonDataPipeline.</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 /// EndReportTaskRunnerHeartbeat operation.</returns> public IAsyncResult BeginReportTaskRunnerHeartbeat(ReportTaskRunnerHeartbeatRequest reportTaskRunnerHeartbeatRequest, AsyncCallback callback, object state) { return invokeReportTaskRunnerHeartbeat(reportTaskRunnerHeartbeatRequest, callback, state, false); }
/// <summary> /// <para>Task runners call ReportTaskRunnerHeartbeat every 15 minutes to indicate that they are operational. In the case of AWS Data Pipeline /// Task Runner launched on a resource managed by AWS Data Pipeline, the web service can use this call to detect when the task runner /// application has failed and restart a new instance.</para> /// </summary> /// /// <param name="reportTaskRunnerHeartbeatRequest">Container for the necessary parameters to execute the ReportTaskRunnerHeartbeat service /// method on AmazonDataPipeline.</param> /// /// <returns>The response from the ReportTaskRunnerHeartbeat service method, as returned by AmazonDataPipeline.</returns> /// /// <exception cref="InternalServiceErrorException"/> /// <exception cref="InvalidRequestException"/> public ReportTaskRunnerHeartbeatResponse ReportTaskRunnerHeartbeat(ReportTaskRunnerHeartbeatRequest reportTaskRunnerHeartbeatRequest) { IAsyncResult asyncResult = invokeReportTaskRunnerHeartbeat(reportTaskRunnerHeartbeatRequest, null, null, true); return EndReportTaskRunnerHeartbeat(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the ReportTaskRunnerHeartbeat operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReportTaskRunnerHeartbeat 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<ReportTaskRunnerHeartbeatResponse> ReportTaskRunnerHeartbeatAsync(ReportTaskRunnerHeartbeatRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ReportTaskRunnerHeartbeatRequestMarshaller(); var unmarshaller = ReportTaskRunnerHeartbeatResponseUnmarshaller.Instance; return InvokeAsync<ReportTaskRunnerHeartbeatRequest,ReportTaskRunnerHeartbeatResponse>(request, marshaller, unmarshaller, cancellationToken); }
private Amazon.DataPipeline.Model.ReportTaskRunnerHeartbeatResponse CallAWSServiceOperation(IAmazonDataPipeline client, Amazon.DataPipeline.Model.ReportTaskRunnerHeartbeatRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Data Pipeline", "ReportTaskRunnerHeartbeat"); try { #if DESKTOP return(client.ReportTaskRunnerHeartbeat(request)); #elif CORECLR return(client.ReportTaskRunnerHeartbeatAsync(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; } }