public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.RDS.Model.CopyDBClusterSnapshotRequest(); if (cmdletContext.SourceRegion != null) { request.SourceRegion = cmdletContext.SourceRegion; } if (cmdletContext.CopyTag != null) { request.CopyTags = cmdletContext.CopyTag.Value; } if (cmdletContext.KmsKeyId != null) { request.KmsKeyId = cmdletContext.KmsKeyId; } if (cmdletContext.PreSignedUrl != null) { request.PreSignedUrl = cmdletContext.PreSignedUrl; } if (cmdletContext.SourceDBClusterSnapshotIdentifier != null) { request.SourceDBClusterSnapshotIdentifier = cmdletContext.SourceDBClusterSnapshotIdentifier; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.TargetDBClusterSnapshotIdentifier != null) { request.TargetDBClusterSnapshotIdentifier = cmdletContext.TargetDBClusterSnapshotIdentifier; } 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 CopyDBClusterSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CopyDBClusterSnapshot 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<CopyDBClusterSnapshotResponse> CopyDBClusterSnapshotAsync(CopyDBClusterSnapshotRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CopyDBClusterSnapshotRequestMarshaller(); var unmarshaller = CopyDBClusterSnapshotResponseUnmarshaller.Instance; return InvokeAsync<CopyDBClusterSnapshotRequest,CopyDBClusterSnapshotResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Creates a snapshot of a DB cluster. For more information on Amazon Aurora, see <a /// href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html">Aurora /// on Amazon RDS</a> in the <i>Amazon RDS User Guide.</i> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CopyDBClusterSnapshot service method.</param> /// /// <returns>The response from the CopyDBClusterSnapshot service method, as returned by RDS.</returns> /// <exception cref="Amazon.RDS.Model.DBClusterSnapshotAlreadyExistsException"> /// User already has a DB cluster snapshot with the given identifier. /// </exception> /// <exception cref="Amazon.RDS.Model.DBClusterSnapshotNotFoundException"> /// <i>DBClusterSnapshotIdentifier</i> does not refer to an existing DB cluster snapshot. /// </exception> /// <exception cref="Amazon.RDS.Model.InvalidDBClusterStateException"> /// The supplied value is not a valid DB cluster state. /// </exception> public CopyDBClusterSnapshotResponse CopyDBClusterSnapshot(CopyDBClusterSnapshotRequest request) { var marshaller = new CopyDBClusterSnapshotRequestMarshaller(); var unmarshaller = CopyDBClusterSnapshotResponseUnmarshaller.Instance; return Invoke<CopyDBClusterSnapshotRequest,CopyDBClusterSnapshotResponse>(request, marshaller, unmarshaller); }
private Amazon.RDS.Model.CopyDBClusterSnapshotResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.CopyDBClusterSnapshotRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "CopyDBClusterSnapshot"); try { #if DESKTOP return(client.CopyDBClusterSnapshot(request)); #elif CORECLR return(client.CopyDBClusterSnapshotAsync(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> /// Initiates the asynchronous execution of the CopyDBClusterSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CopyDBClusterSnapshot operation on AmazonRDSClient.</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 EndCopyDBClusterSnapshot /// operation.</returns> public IAsyncResult BeginCopyDBClusterSnapshot(CopyDBClusterSnapshotRequest request, AsyncCallback callback, object state) { var marshaller = new CopyDBClusterSnapshotRequestMarshaller(); var unmarshaller = CopyDBClusterSnapshotResponseUnmarshaller.Instance; return BeginInvoke<CopyDBClusterSnapshotRequest>(request, marshaller, unmarshaller, callback, state); }