/// <summary> /// Initiates the asynchronous execution of the RestoreFromClusterSnapshot operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.RestoreFromClusterSnapshot"/> /// </summary> /// /// <param name="restoreFromClusterSnapshotRequest">Container for the necessary parameters to execute the RestoreFromClusterSnapshot 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 /// EndRestoreFromClusterSnapshot operation.</returns> public IAsyncResult BeginRestoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest restoreFromClusterSnapshotRequest, AsyncCallback callback, object state) { return invokeRestoreFromClusterSnapshot(restoreFromClusterSnapshotRequest, callback, state, false); }
IAsyncResult invokeRestoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest restoreFromClusterSnapshotRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new RestoreFromClusterSnapshotRequestMarshaller().Marshall(restoreFromClusterSnapshotRequest); var unmarshaller = RestoreFromClusterSnapshotResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the RestoreFromClusterSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RestoreFromClusterSnapshot 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 EndRestoreFromClusterSnapshot /// operation.</returns> public IAsyncResult BeginRestoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest request, AsyncCallback callback, object state) { var marshaller = new RestoreFromClusterSnapshotRequestMarshaller(); var unmarshaller = RestoreFromClusterSnapshotResponseUnmarshaller.Instance; return BeginInvoke<RestoreFromClusterSnapshotRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Creates a new cluster from a snapshot. Amazon Redshift creates the resulting cluster with the same configuration as the original /// cluster from which the snapshot was created, except that the new cluster is created with the default cluster security and parameter group. /// After Amazon Redshift creates the cluster you can use the ModifyCluster API to associate a different security group and different parameter /// group with the restored cluster. </para> <para> If a snapshot is taken of a cluster in VPC, you can restore it only in VPC. In this case, /// you must provide a cluster subnet group where you want the cluster restored. If snapshot is taken of a cluster outside VPC, then you can /// restore it only outside VPC.</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="restoreFromClusterSnapshotRequest">Container for the necessary parameters to execute the RestoreFromClusterSnapshot service /// method on AmazonRedshift.</param> /// /// <returns>The response from the RestoreFromClusterSnapshot service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="InvalidElasticIpException"/> /// <exception cref="InvalidSubnetException"/> /// <exception cref="HsmConfigurationNotFoundException"/> /// <exception cref="ClusterSubnetGroupNotFoundException"/> /// <exception cref="InvalidClusterSubnetGroupStateException"/> /// <exception cref="ClusterAlreadyExistsException"/> /// <exception cref="InvalidVPCNetworkStateException"/> /// <exception cref="InvalidClusterSnapshotStateException"/> /// <exception cref="AccessToSnapshotDeniedException"/> /// <exception cref="InvalidRestoreException"/> /// <exception cref="UnauthorizedOperationException"/> /// <exception cref="InsufficientClusterCapacityException"/> /// <exception cref="NumberOfNodesQuotaExceededException"/> /// <exception cref="NumberOfNodesPerClusterLimitExceededException"/> /// <exception cref="ClusterSnapshotNotFoundException"/> /// <exception cref="ClusterQuotaExceededException"/> /// <exception cref="HsmClientCertificateNotFoundException"/> public RestoreFromClusterSnapshotResponse RestoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest restoreFromClusterSnapshotRequest) { IAsyncResult asyncResult = invokeRestoreFromClusterSnapshot(restoreFromClusterSnapshotRequest, null, null, true); return EndRestoreFromClusterSnapshot(asyncResult); }
/// <summary> /// <para> Creates a new cluster from a snapshot. Amazon Redshift creates the resulting cluster with the same configuration as the original /// cluster from which the snapshot was created, except that the new cluster is created with the default cluster security and parameter group. /// After Amazon Redshift creates the cluster you can use the ModifyCluster API to associate a different security group and different parameter /// group with the restored cluster. </para> <para> If a snapshot is taken of a cluster in VPC, you can restore it only in VPC. In this case, /// you must provide a cluster subnet group where you want the cluster restored. If snapshot is taken of a cluster outside VPC, then you can /// restore it only outside VPC.</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="restoreFromClusterSnapshotRequest">Container for the necessary parameters to execute the RestoreFromClusterSnapshot service /// method on AmazonRedshift.</param> /// /// <returns>The response from the RestoreFromClusterSnapshot service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidElasticIpException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidSubnetException" /> /// <exception cref="T:Amazon.Redshift.Model.HsmConfigurationNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetGroupNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSubnetGroupStateException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterAlreadyExistsException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidVPCNetworkStateException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSnapshotStateException" /> /// <exception cref="T:Amazon.Redshift.Model.AccessToSnapshotDeniedException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidRestoreException" /> /// <exception cref="T:Amazon.Redshift.Model.UnauthorizedOperationException" /> /// <exception cref="T:Amazon.Redshift.Model.InsufficientClusterCapacityException" /> /// <exception cref="T:Amazon.Redshift.Model.NumberOfNodesQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.NumberOfNodesPerClusterLimitExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.HsmClientCertificateNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<RestoreFromClusterSnapshotResponse> RestoreFromClusterSnapshotAsync(RestoreFromClusterSnapshotRequest restoreFromClusterSnapshotRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RestoreFromClusterSnapshotRequestMarshaller(); var unmarshaller = RestoreFromClusterSnapshotResponseUnmarshaller.GetInstance(); return Invoke<IRequest, RestoreFromClusterSnapshotRequest, RestoreFromClusterSnapshotResponse>(restoreFromClusterSnapshotRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Creates a new cluster from a snapshot. By default, Amazon Redshift creates the resulting /// cluster with the same configuration as the original cluster from which the snapshot /// was created, except that the new cluster is created with the default cluster security /// and parameter groups. After Amazon Redshift creates the cluster, you can use the <a>ModifyCluster</a> /// API to associate a different security group and different parameter group with the /// restored cluster. If you are using a DS node type, you can also choose to change to /// another DS node type of the same size during restore. /// /// /// <para> /// If you restore a cluster into a VPC, you must provide a cluster subnet group where /// you want the cluster restored. /// </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 RestoreFromClusterSnapshot service method.</param> /// /// <returns>The response from the RestoreFromClusterSnapshot service method, as returned by Redshift.</returns> /// <exception cref="Amazon.Redshift.Model.AccessToSnapshotDeniedException"> /// The owner of the specified snapshot has not authorized your account to access the /// snapshot. /// </exception> /// <exception cref="Amazon.Redshift.Model.ClusterAlreadyExistsException"> /// The account already has a cluster with the given identifier. /// </exception> /// <exception cref="Amazon.Redshift.Model.ClusterParameterGroupNotFoundException"> /// The parameter group name does not refer to an existing parameter group. /// </exception> /// <exception cref="Amazon.Redshift.Model.ClusterQuotaExceededException"> /// The request would exceed the allowed number of cluster instances for this account. /// For information about increasing your quota, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html">Limits /// in Amazon Redshift</a> in the <i>Amazon Redshift Cluster Management Guide</i>. /// </exception> /// <exception cref="Amazon.Redshift.Model.ClusterSecurityGroupNotFoundException"> /// The cluster security group name does not refer to an existing cluster security group. /// </exception> /// <exception cref="Amazon.Redshift.Model.ClusterSnapshotNotFoundException"> /// The snapshot identifier does not refer to an existing cluster snapshot. /// </exception> /// <exception cref="Amazon.Redshift.Model.ClusterSubnetGroupNotFoundException"> /// The cluster subnet group name does not refer to an existing cluster subnet group. /// </exception> /// <exception cref="Amazon.Redshift.Model.HsmClientCertificateNotFoundException"> /// There is no Amazon Redshift HSM client certificate with the specified identifier. /// </exception> /// <exception cref="Amazon.Redshift.Model.HsmConfigurationNotFoundException"> /// There is no Amazon Redshift HSM configuration with the specified identifier. /// </exception> /// <exception cref="Amazon.Redshift.Model.InsufficientClusterCapacityException"> /// The number of nodes specified exceeds the allotted capacity of the cluster. /// </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> /// <exception cref="Amazon.Redshift.Model.InvalidClusterSubnetGroupStateException"> /// The cluster subnet group cannot be deleted because it is in use. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidElasticIpException"> /// The Elastic IP (EIP) is invalid or cannot be found. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidRestoreException"> /// The restore is invalid. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidSubnetException"> /// The requested subnet is not valid, or not all of the subnets are in the same VPC. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidVPCNetworkStateException"> /// The cluster subnet group does not cover all Availability Zones. /// </exception> /// <exception cref="Amazon.Redshift.Model.LimitExceededException"> /// The encryption key has exceeded its grant limit in AWS KMS. /// </exception> /// <exception cref="Amazon.Redshift.Model.NumberOfNodesPerClusterLimitExceededException"> /// The operation would exceed the number of nodes allowed for a cluster. /// </exception> /// <exception cref="Amazon.Redshift.Model.NumberOfNodesQuotaExceededException"> /// The operation would exceed the number of nodes allotted to the account. For information /// about increasing your quota, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html">Limits /// in Amazon Redshift</a> in the <i>Amazon Redshift Cluster Management Guide</i>. /// </exception> /// <exception cref="Amazon.Redshift.Model.UnauthorizedOperationException"> /// Your account is not authorized to perform the requested operation. /// </exception> public RestoreFromClusterSnapshotResponse RestoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest request) { var marshaller = new RestoreFromClusterSnapshotRequestMarshaller(); var unmarshaller = RestoreFromClusterSnapshotResponseUnmarshaller.Instance; return Invoke<RestoreFromClusterSnapshotRequest,RestoreFromClusterSnapshotResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Creates a new cluster from a snapshot. Amazon Redshift creates the resulting cluster with the same configuration as the original /// cluster from which the snapshot was created, except that the new cluster is created with the default cluster security and parameter group. /// After Amazon Redshift creates the cluster you can use the ModifyCluster API to associate a different security group and different parameter /// group with the restored cluster. </para> <para> If a snapshot is taken of a cluster in VPC, you can restore it only in VPC. In this case, /// you must provide a cluster subnet group where you want the cluster restored. If snapshot is taken of a cluster outside VPC, then you can /// restore it only outside VPC.</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="restoreFromClusterSnapshotRequest">Container for the necessary parameters to execute the RestoreFromClusterSnapshot service /// method on AmazonRedshift.</param> /// /// <returns>The response from the RestoreFromClusterSnapshot service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidElasticIpException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidSubnetException" /> /// <exception cref="T:Amazon.Redshift.Model.HsmConfigurationNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetGroupNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSubnetGroupStateException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterAlreadyExistsException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidVPCNetworkStateException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSnapshotStateException" /> /// <exception cref="T:Amazon.Redshift.Model.AccessToSnapshotDeniedException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidRestoreException" /> /// <exception cref="T:Amazon.Redshift.Model.UnauthorizedOperationException" /> /// <exception cref="T:Amazon.Redshift.Model.InsufficientClusterCapacityException" /> /// <exception cref="T:Amazon.Redshift.Model.NumberOfNodesQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.NumberOfNodesPerClusterLimitExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSnapshotNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.HsmClientCertificateNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<RestoreFromClusterSnapshotResponse> RestoreFromClusterSnapshotAsync(RestoreFromClusterSnapshotRequest restoreFromClusterSnapshotRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RestoreFromClusterSnapshotRequestMarshaller(); var unmarshaller = RestoreFromClusterSnapshotResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, RestoreFromClusterSnapshotRequest, RestoreFromClusterSnapshotResponse>(restoreFromClusterSnapshotRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal RestoreFromClusterSnapshotResponse RestoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest request) { var task = RestoreFromClusterSnapshotAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
internal RestoreFromClusterSnapshotResponse RestoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest request) { var task = RestoreFromClusterSnapshotAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.Redshift.Model.RestoreFromClusterSnapshotResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.RestoreFromClusterSnapshotRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "RestoreFromClusterSnapshot"); try { #if DESKTOP return(client.RestoreFromClusterSnapshot(request)); #elif CORECLR return(client.RestoreFromClusterSnapshotAsync(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; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.RestoreFromClusterSnapshotRequest(); if (cmdletContext.AdditionalInfo != null) { request.AdditionalInfo = cmdletContext.AdditionalInfo; } if (cmdletContext.AllowVersionUpgrade != null) { request.AllowVersionUpgrade = cmdletContext.AllowVersionUpgrade.Value; } if (cmdletContext.AutomatedSnapshotRetentionPeriod != null) { request.AutomatedSnapshotRetentionPeriod = cmdletContext.AutomatedSnapshotRetentionPeriod.Value; } if (cmdletContext.AvailabilityZone != null) { request.AvailabilityZone = cmdletContext.AvailabilityZone; } if (cmdletContext.ClusterIdentifier != null) { request.ClusterIdentifier = cmdletContext.ClusterIdentifier; } if (cmdletContext.ClusterParameterGroupName != null) { request.ClusterParameterGroupName = cmdletContext.ClusterParameterGroupName; } if (cmdletContext.ClusterSecurityGroup != null) { request.ClusterSecurityGroups = cmdletContext.ClusterSecurityGroup; } if (cmdletContext.ClusterSubnetGroupName != null) { request.ClusterSubnetGroupName = cmdletContext.ClusterSubnetGroupName; } if (cmdletContext.ElasticIp != null) { request.ElasticIp = cmdletContext.ElasticIp; } if (cmdletContext.EnhancedVpcRouting != null) { request.EnhancedVpcRouting = cmdletContext.EnhancedVpcRouting.Value; } if (cmdletContext.HsmClientCertificateIdentifier != null) { request.HsmClientCertificateIdentifier = cmdletContext.HsmClientCertificateIdentifier; } if (cmdletContext.HsmConfigurationIdentifier != null) { request.HsmConfigurationIdentifier = cmdletContext.HsmConfigurationIdentifier; } if (cmdletContext.IamRole != null) { request.IamRoles = cmdletContext.IamRole; } if (cmdletContext.KmsKeyId != null) { request.KmsKeyId = cmdletContext.KmsKeyId; } if (cmdletContext.MaintenanceTrackName != null) { request.MaintenanceTrackName = cmdletContext.MaintenanceTrackName; } if (cmdletContext.ManualSnapshotRetentionPeriod != null) { request.ManualSnapshotRetentionPeriod = cmdletContext.ManualSnapshotRetentionPeriod.Value; } if (cmdletContext.NodeType != null) { request.NodeType = cmdletContext.NodeType; } if (cmdletContext.NumberOfNode != null) { request.NumberOfNodes = cmdletContext.NumberOfNode.Value; } if (cmdletContext.OwnerAccount != null) { request.OwnerAccount = cmdletContext.OwnerAccount; } if (cmdletContext.Port != null) { request.Port = cmdletContext.Port.Value; } if (cmdletContext.PreferredMaintenanceWindow != null) { request.PreferredMaintenanceWindow = cmdletContext.PreferredMaintenanceWindow; } if (cmdletContext.PubliclyAccessible != null) { request.PubliclyAccessible = cmdletContext.PubliclyAccessible.Value; } if (cmdletContext.SnapshotClusterIdentifier != null) { request.SnapshotClusterIdentifier = cmdletContext.SnapshotClusterIdentifier; } if (cmdletContext.SnapshotIdentifier != null) { request.SnapshotIdentifier = cmdletContext.SnapshotIdentifier; } if (cmdletContext.SnapshotScheduleIdentifier != null) { request.SnapshotScheduleIdentifier = cmdletContext.SnapshotScheduleIdentifier; } if (cmdletContext.VpcSecurityGroupId != null) { request.VpcSecurityGroupIds = cmdletContext.VpcSecurityGroupId; } 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 RestoreFromClusterSnapshot operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RestoreFromClusterSnapshot 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<RestoreFromClusterSnapshotResponse> RestoreFromClusterSnapshotAsync(RestoreFromClusterSnapshotRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RestoreFromClusterSnapshotRequestMarshaller(); var unmarshaller = RestoreFromClusterSnapshotResponseUnmarshaller.Instance; return InvokeAsync<RestoreFromClusterSnapshotRequest,RestoreFromClusterSnapshotResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeRestoreFromClusterSnapshot(RestoreFromClusterSnapshotRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new RestoreFromClusterSnapshotRequestMarshaller(); var unmarshaller = RestoreFromClusterSnapshotResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }