public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.DeleteClusterRequest(); if (cmdletContext.ClusterIdentifier != null) { request.ClusterIdentifier = cmdletContext.ClusterIdentifier; } if (cmdletContext.FinalClusterSnapshotIdentifier != null) { request.FinalClusterSnapshotIdentifier = cmdletContext.FinalClusterSnapshotIdentifier; } if (cmdletContext.FinalClusterSnapshotRetentionPeriod != null) { request.FinalClusterSnapshotRetentionPeriod = cmdletContext.FinalClusterSnapshotRetentionPeriod.Value; } if (cmdletContext.SkipFinalClusterSnapshot != null) { request.SkipFinalClusterSnapshot = cmdletContext.SkipFinalClusterSnapshot.Value; } 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); }
IAsyncResult invokeDeleteCluster(DeleteClusterRequest deleteClusterRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteClusterRequestMarshaller().Marshall(deleteClusterRequest); var unmarshaller = DeleteClusterResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteCluster operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.DeleteCluster"/> /// </summary> /// /// <param name="deleteClusterRequest">Container for the necessary parameters to execute the DeleteCluster operation on AmazonRedshift.</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 EndDeleteCluster /// operation.</returns> public IAsyncResult BeginDeleteCluster(DeleteClusterRequest deleteClusterRequest, AsyncCallback callback, object state) { return invokeDeleteCluster(deleteClusterRequest, callback, state, false); }
/// <summary> /// <para> Deletes a previously provisioned cluster. A successful response from the web service indicates that the request was received /// correctly. If a final cluster snapshot is requested the status of the cluster will be "final-snapshot" while the snapshot is being taken, /// then it's "deleting" once Amazon Redshift begins deleting the cluster. Use DescribeClusters to monitor the status of the deletion. The /// delete operation cannot be canceled or reverted once submitted. For more information about managing clusters, go to <a /// href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html" >Amazon Redshift Clusters</a> in the <i>Amazon Redshift /// Management Guide</i> . /// </para> /// </summary> /// /// <param name="deleteClusterRequest">Container for the necessary parameters to execute the DeleteCluster service method on /// AmazonRedshift.</param> /// /// <returns>The response from the DeleteCluster service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="ClusterSnapshotAlreadyExistsException"/> /// <exception cref="InvalidClusterStateException"/> /// <exception cref="ClusterNotFoundException"/> /// <exception cref="ClusterSnapshotQuotaExceededException"/> public DeleteClusterResponse DeleteCluster(DeleteClusterRequest deleteClusterRequest) { IAsyncResult asyncResult = invokeDeleteCluster(deleteClusterRequest, null, null, true); return EndDeleteCluster(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DeleteCluster operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCluster operation on AmazonRedshiftClient.</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 EndDeleteCluster /// operation.</returns> public IAsyncResult BeginDeleteCluster(DeleteClusterRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteClusterRequestMarshaller(); var unmarshaller = DeleteClusterResponseUnmarshaller.Instance; return BeginInvoke<DeleteClusterRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Deletes a previously provisioned cluster. A successful response from the web service /// indicates that the request was received correctly. Use <a>DescribeClusters</a> to /// monitor the status of the deletion. The delete operation cannot be canceled or reverted /// once submitted. For more information about managing clusters, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">Amazon /// Redshift Clusters</a> in the <i>Amazon Redshift Cluster Management Guide</i> . /// /// /// <para> /// If you want to shut down the cluster and retain it for future use, set <i>SkipFinalClusterSnapshot</i> /// to <code>false</code> and specify a name for <i>FinalClusterSnapshotIdentifier</i>. /// You can later restore this snapshot to resume using the cluster. If a final cluster /// snapshot is requested, the status of the cluster will be "final-snapshot" while the /// snapshot is being taken, then it's "deleting" once Amazon Redshift begins deleting /// the cluster. /// </para> /// /// <para> /// For more information about managing clusters, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">Amazon /// Redshift Clusters</a> in the <i>Amazon Redshift Cluster Management Guide</i> . /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCluster service method.</param> /// /// <returns>The response from the DeleteCluster service method, as returned by Redshift.</returns> /// <exception cref="Amazon.Redshift.Model.ClusterNotFoundException"> /// The <i>ClusterIdentifier</i> parameter does not refer to an existing cluster. /// </exception> /// <exception cref="Amazon.Redshift.Model.ClusterSnapshotAlreadyExistsException"> /// The value specified as a snapshot identifier is already used by an existing snapshot. /// </exception> /// <exception cref="Amazon.Redshift.Model.ClusterSnapshotQuotaExceededException"> /// The request would result in the user exceeding the allowed number of cluster snapshots. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidClusterStateException"> /// The specified cluster is not in the <code>available</code> state. /// </exception> public DeleteClusterResponse DeleteCluster(DeleteClusterRequest request) { var marshaller = new DeleteClusterRequestMarshaller(); var unmarshaller = DeleteClusterResponseUnmarshaller.Instance; return Invoke<DeleteClusterRequest,DeleteClusterResponse>(request, marshaller, unmarshaller); }
private Amazon.Redshift.Model.DeleteClusterResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.DeleteClusterRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "DeleteCluster"); try { #if DESKTOP return(client.DeleteCluster(request)); #elif CORECLR return(client.DeleteClusterAsync(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> Deletes a previously provisioned cluster. A successful response from the web service indicates that the request was received /// correctly. If a final cluster snapshot is requested the status of the cluster will be "final-snapshot" while the snapshot is being taken, /// then it's "deleting" once Amazon Redshift begins deleting the cluster. Use DescribeClusters to monitor the status of the deletion. The /// delete operation cannot be canceled or reverted once submitted. For more information about managing clusters, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">Amazon Redshift Clusters</a> in the <i>Amazon Redshift /// Management Guide</i> . /// </para> /// </summary> /// /// <param name="deleteClusterRequest">Container for the necessary parameters to execute the DeleteCluster service method on /// AmazonRedshift.</param> /// /// <returns>The response from the DeleteCluster service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotAlreadyExistsException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterStateException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotQuotaExceededException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DeleteClusterResponse> DeleteClusterAsync(DeleteClusterRequest deleteClusterRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteClusterRequestMarshaller(); var unmarshaller = DeleteClusterResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteClusterRequest, DeleteClusterResponse>(deleteClusterRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DeleteClusterResponse DeleteCluster(DeleteClusterRequest request) { var task = DeleteClusterAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Deletes a previously provisioned cluster. A successful response from the web service indicates that the request was received /// correctly. If a final cluster snapshot is requested the status of the cluster will be "final-snapshot" while the snapshot is being taken, /// then it's "deleting" once Amazon Redshift begins deleting the cluster. Use DescribeClusters to monitor the status of the deletion. The /// delete operation cannot be canceled or reverted once submitted. For more information about managing clusters, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">Amazon Redshift Clusters</a> in the <i>Amazon Redshift /// Management Guide</i> . /// </para> /// </summary> /// /// <param name="deleteClusterRequest">Container for the necessary parameters to execute the DeleteCluster service method on /// AmazonRedshift.</param> /// /// <returns>The response from the DeleteCluster service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotAlreadyExistsException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterStateException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotQuotaExceededException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<DeleteClusterResponse> DeleteClusterAsync(DeleteClusterRequest deleteClusterRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteClusterRequestMarshaller(); var unmarshaller = DeleteClusterResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteClusterRequest, DeleteClusterResponse>(deleteClusterRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal DeleteClusterResponse DeleteCluster(DeleteClusterRequest request) { var task = DeleteClusterAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the DeleteCluster operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCluster 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<DeleteClusterResponse> DeleteClusterAsync(DeleteClusterRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteClusterRequestMarshaller(); var unmarshaller = DeleteClusterResponseUnmarshaller.Instance; return InvokeAsync<DeleteClusterRequest,DeleteClusterResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeDeleteCluster(DeleteClusterRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DeleteClusterRequestMarshaller(); var unmarshaller = DeleteClusterResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }