/// <summary> /// Initiates the asynchronous execution of the CancelConversionTask operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CancelConversionTask 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<CancelConversionTaskResponse> CancelConversionTaskAsync(CancelConversionTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CancelConversionTaskRequestMarshaller(); var unmarshaller = CancelConversionTaskResponseUnmarshaller.Instance; return InvokeAsync<CancelConversionTaskRequest,CancelConversionTaskResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the CancelConversionTask operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CancelConversionTask operation on AmazonEC2Client.</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 EndCancelConversionTask /// operation.</returns> public IAsyncResult BeginCancelConversionTask(CancelConversionTaskRequest request, AsyncCallback callback, object state) { var marshaller = new CancelConversionTaskRequestMarshaller(); var unmarshaller = CancelConversionTaskResponseUnmarshaller.Instance; return BeginInvoke<CancelConversionTaskRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Cancels an active conversion task. The task can be the import of an instance or volume. /// The action removes all artifacts of the conversion, including a partially uploaded /// volume or instance. If the conversion is complete or is in the process of transferring /// the final disk image, the command fails and returns an exception. /// /// /// <para> /// For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.html">Using /// the Command Line Tools to Import Your Virtual Machine to Amazon EC2</a> in the <i>Amazon /// Elastic Compute Cloud User Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelConversionTask service method.</param> /// /// <returns>The response from the CancelConversionTask service method, as returned by EC2.</returns> public CancelConversionTaskResponse CancelConversionTask(CancelConversionTaskRequest request) { var marshaller = new CancelConversionTaskRequestMarshaller(); var unmarshaller = CancelConversionTaskResponseUnmarshaller.Instance; return Invoke<CancelConversionTaskRequest,CancelConversionTaskResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CancelConversionTask operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.CancelConversionTask"/> /// </summary> /// /// <param name="cancelConversionTaskRequest">Container for the necessary parameters to execute the CancelConversionTask operation on /// AmazonEC2.</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 BeginCancelConversionTask(CancelConversionTaskRequest cancelConversionTaskRequest, AsyncCallback callback, object state) { return invokeCancelConversionTask(cancelConversionTaskRequest, callback, state, false); }
IAsyncResult invokeCancelConversionTask(CancelConversionTaskRequest cancelConversionTaskRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CancelConversionTaskRequestMarshaller().Marshall(cancelConversionTaskRequest); var unmarshaller = CancelConversionTaskResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Cancels an active conversion task. The task can be the import of an instance or volume. The action removes all artifacts of the /// conversion, including a partially uploaded volume or instance. If the conversion is complete or is in the process of transferring the final /// disk image, the command fails and returns an exception.</para> <para>For more information, see <a /// href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.html" >Using the Command Line Tools to Import Your /// Virtual Machine to Amazon EC2</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> .</para> /// </summary> /// /// <param name="cancelConversionTaskRequest">Container for the necessary parameters to execute the CancelConversionTask service method on /// AmazonEC2.</param> /// public CancelConversionTaskResponse CancelConversionTask(CancelConversionTaskRequest cancelConversionTaskRequest) { IAsyncResult asyncResult = invokeCancelConversionTask(cancelConversionTaskRequest, null, null, true); return EndCancelConversionTask(asyncResult); }
/// <summary> /// <para>Cancels an active conversion task. The task can be the import of an instance or volume. The action removes all artifacts of the /// conversion, including a partially uploaded volume or instance. If the conversion is complete or is in the process of transferring the final /// disk image, the command fails and returns an exception.</para> <para>For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.html">Using the Command Line Tools to Import Your /// Virtual Machine to Amazon EC2</a> in the <i>Amazon Elastic Compute Cloud User Guide</i> .</para> /// </summary> /// /// <param name="cancelConversionTaskRequest">Container for the necessary parameters to execute the CancelConversionTask service method on /// AmazonEC2.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<CancelConversionTaskResponse> CancelConversionTaskAsync(CancelConversionTaskRequest cancelConversionTaskRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CancelConversionTaskRequestMarshaller(); var unmarshaller = CancelConversionTaskResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CancelConversionTaskRequest, CancelConversionTaskResponse>(cancelConversionTaskRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal CancelConversionTaskResponse CancelConversionTask(CancelConversionTaskRequest request) { var task = CancelConversionTaskAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the CancelConversionTask operation. /// <seealso cref="Amazon.EC2.IAmazonEC2.CancelConversionTask"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CancelConversionTask 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<CancelConversionTaskResponse> CancelConversionTaskAsync(CancelConversionTaskRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CancelConversionTaskRequestMarshaller(); var unmarshaller = CancelConversionTaskResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CancelConversionTaskRequest, CancelConversionTaskResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CancelConversionTask service method on /// AmazonEC2.</param> public CancelConversionTaskResponse CancelConversionTask(CancelConversionTaskRequest request) { var task = CancelConversionTaskAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }