public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.CopyClusterSnapshotRequest(); if (cmdletContext.ManualSnapshotRetentionPeriod != null) { request.ManualSnapshotRetentionPeriod = cmdletContext.ManualSnapshotRetentionPeriod.Value; } if (cmdletContext.SourceSnapshotClusterIdentifier != null) { request.SourceSnapshotClusterIdentifier = cmdletContext.SourceSnapshotClusterIdentifier; } if (cmdletContext.SourceSnapshotIdentifier != null) { request.SourceSnapshotIdentifier = cmdletContext.SourceSnapshotIdentifier; } if (cmdletContext.TargetSnapshotIdentifier != null) { request.TargetSnapshotIdentifier = cmdletContext.TargetSnapshotIdentifier; } 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 invokeCopyClusterSnapshot(CopyClusterSnapshotRequest copyClusterSnapshotRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CopyClusterSnapshotRequestMarshaller().Marshall(copyClusterSnapshotRequest); var unmarshaller = CopyClusterSnapshotResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the CopyClusterSnapshot operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.CopyClusterSnapshot"/> /// </summary> /// /// <param name="copyClusterSnapshotRequest">Container for the necessary parameters to execute the CopyClusterSnapshot 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 /// EndCopyClusterSnapshot operation.</returns> public IAsyncResult BeginCopyClusterSnapshot(CopyClusterSnapshotRequest copyClusterSnapshotRequest, AsyncCallback callback, object state) { return invokeCopyClusterSnapshot(copyClusterSnapshotRequest, callback, state, false); }
/// <summary> /// <para> Copies the specified automated cluster snapshot to a new manual cluster snapshot. The source must be an automated snapshot and it /// must be in the available state. </para> <para> When you delete a cluster, Amazon Redshift deletes any automated snapshots of the cluster. /// Also, when the retention period of the snapshot expires, Amazon Redshift automatically deletes it. If you want to keep an automated snapshot /// for a longer period, you can make a manual copy of the snapshot. Manual snapshots are retained until you delete them. </para> <para> For /// more information about working with snapshots, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html" /// >Amazon Redshift Snapshots</a> in the <i>Amazon Redshift Management Guide</i> . /// </para> /// </summary> /// /// <param name="copyClusterSnapshotRequest">Container for the necessary parameters to execute the CopyClusterSnapshot service method on /// AmazonRedshift.</param> /// /// <returns>The response from the CopyClusterSnapshot service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="ClusterSnapshotAlreadyExistsException"/> /// <exception cref="ClusterSnapshotNotFoundException"/> /// <exception cref="ClusterSnapshotQuotaExceededException"/> /// <exception cref="InvalidClusterSnapshotStateException"/> public CopyClusterSnapshotResponse CopyClusterSnapshot(CopyClusterSnapshotRequest copyClusterSnapshotRequest) { IAsyncResult asyncResult = invokeCopyClusterSnapshot(copyClusterSnapshotRequest, null, null, true); return EndCopyClusterSnapshot(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the CopyClusterSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CopyClusterSnapshot 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 EndCopyClusterSnapshot /// operation.</returns> public IAsyncResult BeginCopyClusterSnapshot(CopyClusterSnapshotRequest request, AsyncCallback callback, object state) { var marshaller = new CopyClusterSnapshotRequestMarshaller(); var unmarshaller = CopyClusterSnapshotResponseUnmarshaller.Instance; return BeginInvoke<CopyClusterSnapshotRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Copies the specified automated cluster snapshot to a new manual cluster snapshot. /// The source must be an automated snapshot and it must be in the available state. /// /// /// <para> /// When you delete a cluster, Amazon Redshift deletes any automated snapshots of the /// cluster. Also, when the retention period of the snapshot expires, Amazon Redshift /// automatically deletes it. If you want to keep an automated snapshot for a longer period, /// you can make a manual copy of the snapshot. Manual snapshots are retained until you /// delete them. /// </para> /// /// <para> /// For more information about working with snapshots, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html">Amazon /// Redshift Snapshots</a> in the <i>Amazon Redshift Cluster Management Guide</i>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CopyClusterSnapshot service method.</param> /// /// <returns>The response from the CopyClusterSnapshot service method, as returned by Redshift.</returns> /// <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.ClusterSnapshotNotFoundException"> /// The snapshot identifier does not refer to an existing cluster 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.InvalidClusterSnapshotStateException"> /// The state of the cluster snapshot is not <code>available</code>, or other accounts /// are authorized to access the snapshot. /// </exception> public CopyClusterSnapshotResponse CopyClusterSnapshot(CopyClusterSnapshotRequest request) { var marshaller = new CopyClusterSnapshotRequestMarshaller(); var unmarshaller = CopyClusterSnapshotResponseUnmarshaller.Instance; return Invoke<CopyClusterSnapshotRequest,CopyClusterSnapshotResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Copies the specified automated cluster snapshot to a new manual cluster snapshot. The source must be an automated snapshot and it /// must be in the available state. </para> <para> When you delete a cluster, Amazon Redshift deletes any automated snapshots of the cluster. /// Also, when the retention period of the snapshot expires, Amazon Redshift automatically deletes it. If you want to keep an automated snapshot /// for a longer period, you can make a manual copy of the snapshot. Manual snapshots are retained until you delete them. </para> <para> For /// more information about working with snapshots, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html">Amazon Redshift Snapshots</a> in the <i>Amazon Redshift Management Guide</i> . /// </para> /// </summary> /// /// <param name="copyClusterSnapshotRequest">Container for the necessary parameters to execute the CopyClusterSnapshot service method on /// AmazonRedshift.</param> /// /// <returns>The response from the CopyClusterSnapshot service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotAlreadyExistsException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSnapshotStateException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<CopyClusterSnapshotResponse> CopyClusterSnapshotAsync(CopyClusterSnapshotRequest copyClusterSnapshotRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CopyClusterSnapshotRequestMarshaller(); var unmarshaller = CopyClusterSnapshotResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CopyClusterSnapshotRequest, CopyClusterSnapshotResponse>(copyClusterSnapshotRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal CopyClusterSnapshotResponse CopyClusterSnapshot(CopyClusterSnapshotRequest request) { var task = CopyClusterSnapshotAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
private Amazon.Redshift.Model.CopyClusterSnapshotResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.CopyClusterSnapshotRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "CopyClusterSnapshot"); try { #if DESKTOP return(client.CopyClusterSnapshot(request)); #elif CORECLR return(client.CopyClusterSnapshotAsync(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> Copies the specified automated cluster snapshot to a new manual cluster snapshot. The source must be an automated snapshot and it /// must be in the available state. </para> <para> When you delete a cluster, Amazon Redshift deletes any automated snapshots of the cluster. /// Also, when the retention period of the snapshot expires, Amazon Redshift automatically deletes it. If you want to keep an automated snapshot /// for a longer period, you can make a manual copy of the snapshot. Manual snapshots are retained until you delete them. </para> <para> For /// more information about working with snapshots, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html">Amazon Redshift Snapshots</a> in the <i>Amazon Redshift Management Guide</i> . /// </para> /// </summary> /// /// <param name="copyClusterSnapshotRequest">Container for the necessary parameters to execute the CopyClusterSnapshot service method on /// AmazonRedshift.</param> /// /// <returns>The response from the CopyClusterSnapshot service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotAlreadyExistsException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSnapshotStateException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<CopyClusterSnapshotResponse> CopyClusterSnapshotAsync(CopyClusterSnapshotRequest copyClusterSnapshotRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CopyClusterSnapshotRequestMarshaller(); var unmarshaller = CopyClusterSnapshotResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CopyClusterSnapshotRequest, CopyClusterSnapshotResponse>(copyClusterSnapshotRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal CopyClusterSnapshotResponse CopyClusterSnapshot(CopyClusterSnapshotRequest request) { var task = CopyClusterSnapshotAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the CopyClusterSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CopyClusterSnapshot 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<CopyClusterSnapshotResponse> CopyClusterSnapshotAsync(CopyClusterSnapshotRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CopyClusterSnapshotRequestMarshaller(); var unmarshaller = CopyClusterSnapshotResponseUnmarshaller.Instance; return InvokeAsync<CopyClusterSnapshotRequest,CopyClusterSnapshotResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeCopyClusterSnapshot(CopyClusterSnapshotRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new CopyClusterSnapshotRequestMarshaller(); var unmarshaller = CopyClusterSnapshotResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }