public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.CreateClusterSnapshotRequest(); if (cmdletContext.ClusterIdentifier != null) { request.ClusterIdentifier = cmdletContext.ClusterIdentifier; } if (cmdletContext.ManualSnapshotRetentionPeriod != null) { request.ManualSnapshotRetentionPeriod = cmdletContext.ManualSnapshotRetentionPeriod.Value; } if (cmdletContext.SnapshotIdentifier != null) { request.SnapshotIdentifier = cmdletContext.SnapshotIdentifier; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } 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 invokeCreateClusterSnapshot(CreateClusterSnapshotRequest createClusterSnapshotRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateClusterSnapshotRequestMarshaller().Marshall(createClusterSnapshotRequest); var unmarshaller = CreateClusterSnapshotResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the CreateClusterSnapshot operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.CreateClusterSnapshot"/> /// </summary> /// /// <param name="createClusterSnapshotRequest">Container for the necessary parameters to execute the CreateClusterSnapshot 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 /// EndCreateClusterSnapshot operation.</returns> public IAsyncResult BeginCreateClusterSnapshot(CreateClusterSnapshotRequest createClusterSnapshotRequest, AsyncCallback callback, object state) { return invokeCreateClusterSnapshot(createClusterSnapshotRequest, callback, state, false); }
/// <summary> /// <para> Creates a manual snapshot of the specified cluster. The cluster must be in the "available" state. </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="createClusterSnapshotRequest">Container for the necessary parameters to execute the CreateClusterSnapshot service method on /// AmazonRedshift.</param> /// /// <returns>The response from the CreateClusterSnapshot service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="ClusterSnapshotAlreadyExistsException"/> /// <exception cref="InvalidClusterStateException"/> /// <exception cref="ClusterNotFoundException"/> /// <exception cref="ClusterSnapshotQuotaExceededException"/> public CreateClusterSnapshotResponse CreateClusterSnapshot(CreateClusterSnapshotRequest createClusterSnapshotRequest) { IAsyncResult asyncResult = invokeCreateClusterSnapshot(createClusterSnapshotRequest, null, null, true); return EndCreateClusterSnapshot(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the CreateClusterSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateClusterSnapshot 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 EndCreateClusterSnapshot /// operation.</returns> public IAsyncResult BeginCreateClusterSnapshot(CreateClusterSnapshotRequest request, AsyncCallback callback, object state) { var marshaller = new CreateClusterSnapshotRequestMarshaller(); var unmarshaller = CreateClusterSnapshotResponseUnmarshaller.Instance; return BeginInvoke<CreateClusterSnapshotRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Creates a manual snapshot of the specified cluster. The cluster must be in the <code>available</code> /// state. /// /// /// <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 CreateClusterSnapshot service method.</param> /// /// <returns>The response from the CreateClusterSnapshot 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> /// <exception cref="Amazon.Redshift.Model.InvalidTagException"> /// The tag is invalid. /// </exception> /// <exception cref="Amazon.Redshift.Model.TagLimitExceededException"> /// The request exceeds the limit of 10 tags for the resource. /// </exception> public CreateClusterSnapshotResponse CreateClusterSnapshot(CreateClusterSnapshotRequest request) { var marshaller = new CreateClusterSnapshotRequestMarshaller(); var unmarshaller = CreateClusterSnapshotResponseUnmarshaller.Instance; return Invoke<CreateClusterSnapshotRequest,CreateClusterSnapshotResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Creates a manual snapshot of the specified cluster. The cluster must be in the "available" state. </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="createClusterSnapshotRequest">Container for the necessary parameters to execute the CreateClusterSnapshot service method on /// AmazonRedshift.</param> /// /// <returns>The response from the CreateClusterSnapshot 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<CreateClusterSnapshotResponse> CreateClusterSnapshotAsync(CreateClusterSnapshotRequest createClusterSnapshotRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateClusterSnapshotRequestMarshaller(); var unmarshaller = CreateClusterSnapshotResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateClusterSnapshotRequest, CreateClusterSnapshotResponse>(createClusterSnapshotRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal CreateClusterSnapshotResponse CreateClusterSnapshot(CreateClusterSnapshotRequest request) { var task = CreateClusterSnapshotAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Creates a manual snapshot of the specified cluster. The cluster must be in the "available" state. </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="createClusterSnapshotRequest">Container for the necessary parameters to execute the CreateClusterSnapshot service method on /// AmazonRedshift.</param> /// /// <returns>The response from the CreateClusterSnapshot 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<CreateClusterSnapshotResponse> CreateClusterSnapshotAsync(CreateClusterSnapshotRequest createClusterSnapshotRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateClusterSnapshotRequestMarshaller(); var unmarshaller = CreateClusterSnapshotResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateClusterSnapshotRequest, CreateClusterSnapshotResponse>(createClusterSnapshotRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal CreateClusterSnapshotResponse CreateClusterSnapshot(CreateClusterSnapshotRequest request) { var task = CreateClusterSnapshotAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the CreateClusterSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateClusterSnapshot 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<CreateClusterSnapshotResponse> CreateClusterSnapshotAsync(CreateClusterSnapshotRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateClusterSnapshotRequestMarshaller(); var unmarshaller = CreateClusterSnapshotResponseUnmarshaller.Instance; return InvokeAsync<CreateClusterSnapshotRequest,CreateClusterSnapshotResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeCreateClusterSnapshot(CreateClusterSnapshotRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new CreateClusterSnapshotRequestMarshaller(); var unmarshaller = CreateClusterSnapshotResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
private Amazon.Redshift.Model.CreateClusterSnapshotResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.CreateClusterSnapshotRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "CreateClusterSnapshot"); try { #if DESKTOP return(client.CreateClusterSnapshot(request)); #elif CORECLR return(client.CreateClusterSnapshotAsync(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; } }