public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.StorageGateway.Model.DeleteVolumeRequest(); if (cmdletContext.VolumeARN != null) { request.VolumeARN = cmdletContext.VolumeARN; } 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 DeleteVolume operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVolume operation on AmazonStorageGatewayClient.</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 EndDeleteVolume /// operation.</returns> public IAsyncResult BeginDeleteVolume(DeleteVolumeRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteVolumeRequestMarshaller(); var unmarshaller = DeleteVolumeResponseUnmarshaller.Instance; return BeginInvoke<DeleteVolumeRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Deletes the specified gateway volume that you previously created using the <a>CreateCachediSCSIVolume</a> /// or <a>CreateStorediSCSIVolume</a> API. For gateway-stored volumes, the local disk /// that was configured as the storage volume is not deleted. You can reuse the local /// disk to create another storage volume. /// /// /// <para> /// Before you delete a gateway volume, make sure there are no iSCSI connections to the /// volume you are deleting. You should also make sure there is no snapshot in progress. /// You can use the Amazon Elastic Compute Cloud (Amazon EC2) API to query snapshots on /// the volume you are deleting and check the snapshot status. For more information, go /// to <a href="http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html">DescribeSnapshots</a> /// in the <i>Amazon Elastic Compute Cloud API Reference</i>. /// </para> /// /// <para> /// In the request, you must provide the Amazon Resource Name (ARN) of the storage volume /// you want to delete. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteVolume service method.</param> /// /// <returns>The response from the DeleteVolume service method, as returned by StorageGateway.</returns> /// <exception cref="Amazon.StorageGateway.Model.InternalServerErrorException"> /// An internal server error has occurred during the request. For more information, see /// the error and message fields. /// </exception> /// <exception cref="Amazon.StorageGateway.Model.InvalidGatewayRequestException"> /// An exception occurred because an invalid gateway request was issued to the service. /// For more information, see the error and message fields. /// </exception> public DeleteVolumeResponse DeleteVolume(DeleteVolumeRequest request) { var marshaller = new DeleteVolumeRequestMarshaller(); var unmarshaller = DeleteVolumeResponseUnmarshaller.Instance; return Invoke<DeleteVolumeRequest,DeleteVolumeResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeleteVolume operation. /// <seealso cref="Amazon.StorageGateway.IAmazonStorageGateway.DeleteVolume"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVolume 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<DeleteVolumeResponse> DeleteVolumeAsync(DeleteVolumeRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteVolumeRequestMarshaller(); var unmarshaller = DeleteVolumeResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteVolumeRequest, DeleteVolumeResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>This operation delete the specified gateway volume that you previously created using the CreateStorediSCSIVolume API. For /// gateway-stored volumes, the local disk that was configured as the storage volume is not deleted. You can reuse the local disk to create /// another storage volume. </para> <para>Before you delete a gateway volume, make sure there are no iSCSI connections to the volume you are /// deleting. You should also make sure there is no snapshot in progress. You can use the Amazon Elastic Compute Cloud (Amazon EC2) API to query /// snapshots on the volume you are deleting and check the snapshot status. For more information, go to <a href="http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html">DescribeSnapshots</a> in the /// <i>Amazon Elastic Compute Cloud API Reference</i> .</para> <para>In the request, you must provide the Amazon Resource Name (ARN) of the /// storage volume you want to delete.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVolume service method on /// AmazonStorageGateway.</param> /// /// <returns>The response from the DeleteVolume service method, as returned by AmazonStorageGateway.</returns> /// /// <exception cref="T:Amazon.StorageGateway.Model.InternalServerErrorException" /> /// <exception cref="T:Amazon.StorageGateway.Model.InvalidGatewayRequestException" /> public DeleteVolumeResponse DeleteVolume(DeleteVolumeRequest request) { var task = DeleteVolumeAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeDeleteVolume(DeleteVolumeRequest deleteVolumeRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteVolumeRequestMarshaller().Marshall(deleteVolumeRequest); var unmarshaller = DeleteVolumeResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteVolume operation. /// <seealso cref="Amazon.StorageGateway.IAmazonStorageGateway.DeleteVolume"/> /// </summary> /// /// <param name="deleteVolumeRequest">Container for the necessary parameters to execute the DeleteVolume operation on /// AmazonStorageGateway.</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 EndDeleteVolume /// operation.</returns> public IAsyncResult BeginDeleteVolume(DeleteVolumeRequest deleteVolumeRequest, AsyncCallback callback, object state) { return invokeDeleteVolume(deleteVolumeRequest, callback, state, false); }
/// <summary> /// <para>This operation delete the specified gateway volume that you previously created using the CreateStorediSCSIVolume API. For /// gateway-stored volumes, the local disk that was configured as the storage volume is not deleted. You can reuse the local disk to create /// another storage volume. </para> <para>Before you delete a gateway volume, make sure there are no iSCSI connections to the volume you are /// deleting. You should also make sure there is no snapshot in progress. You can use the Amazon Elastic Compute Cloud (Amazon EC2) API to query /// snapshots on the volume you are deleting and check the snapshot status. For more information, go to <a /// href="http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html" >DescribeSnapshots</a> in the /// <i>Amazon Elastic Compute Cloud API Reference</i> .</para> <para>In the request, you must provide the Amazon Resource Name (ARN) of the /// storage volume you want to delete.</para> /// </summary> /// /// <param name="deleteVolumeRequest">Container for the necessary parameters to execute the DeleteVolume service method on /// AmazonStorageGateway.</param> /// /// <returns>The response from the DeleteVolume service method, as returned by AmazonStorageGateway.</returns> /// /// <exception cref="InternalServerErrorException"/> /// <exception cref="InvalidGatewayRequestException"/> public DeleteVolumeResponse DeleteVolume(DeleteVolumeRequest deleteVolumeRequest) { IAsyncResult asyncResult = invokeDeleteVolume(deleteVolumeRequest, null, null, true); return EndDeleteVolume(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DeleteVolume operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteVolume 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<DeleteVolumeResponse> DeleteVolumeAsync(DeleteVolumeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteVolumeRequestMarshaller(); var unmarshaller = DeleteVolumeResponseUnmarshaller.Instance; return InvokeAsync<DeleteVolumeRequest,DeleteVolumeResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// <para>This operation delete the specified gateway volume that you previously created using the CreateStorediSCSIVolume API. For /// gateway-stored volumes, the local disk that was configured as the storage volume is not deleted. You can reuse the local disk to create /// another storage volume. </para> <para>Before you delete a gateway volume, make sure there are no iSCSI connections to the volume you are /// deleting. You should also make sure there is no snapshot in progress. You can use the Amazon Elastic Compute Cloud (Amazon EC2) API to query /// snapshots on the volume you are deleting and check the snapshot status. For more information, go to <a href="http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html">DescribeSnapshots</a> in the /// <i>Amazon Elastic Compute Cloud API Reference</i> .</para> <para>In the request, you must provide the Amazon Resource Name (ARN) of the /// storage volume you want to delete.</para> /// </summary> /// /// <param name="deleteVolumeRequest">Container for the necessary parameters to execute the DeleteVolume service method on /// AmazonStorageGateway.</param> /// /// <returns>The response from the DeleteVolume service method, as returned by AmazonStorageGateway.</returns> /// /// <exception cref="T:Amazon.StorageGateway.Model.InternalServerErrorException" /> /// <exception cref="T:Amazon.StorageGateway.Model.InvalidGatewayRequestException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<DeleteVolumeResponse> DeleteVolumeAsync(DeleteVolumeRequest deleteVolumeRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteVolumeRequestMarshaller(); var unmarshaller = DeleteVolumeResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteVolumeRequest, DeleteVolumeResponse>(deleteVolumeRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal DeleteVolumeResponse DeleteVolume(DeleteVolumeRequest request) { var task = DeleteVolumeAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.StorageGateway.Model.DeleteVolumeResponse CallAWSServiceOperation(IAmazonStorageGateway client, Amazon.StorageGateway.Model.DeleteVolumeRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Storage Gateway", "DeleteVolume"); try { #if DESKTOP return(client.DeleteVolume(request)); #elif CORECLR return(client.DeleteVolumeAsync(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; } }