IAsyncResult invokeCreateCluster(CreateClusterRequest createClusterRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateClusterRequestMarshaller().Marshall(createClusterRequest); var unmarshaller = CreateClusterResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Creates a new cluster. To create the cluster in virtual private cloud (VPC), you must provide cluster subnet group name. If you don't /// provide a cluster subnet group name or the cluster security group parameter, Amazon Redshift creates a non-VPC cluster, it associates the /// default cluster security group with the cluster. 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="createClusterRequest">Container for the necessary parameters to execute the CreateCluster service method on /// AmazonRedshift.</param> /// /// <returns>The response from the CreateCluster 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="ClusterParameterGroupNotFoundException"/> /// <exception cref="InsufficientClusterCapacityException"/> /// <exception cref="UnauthorizedOperationException"/> /// <exception cref="NumberOfNodesQuotaExceededException"/> /// <exception cref="NumberOfNodesPerClusterLimitExceededException"/> /// <exception cref="HsmClientCertificateNotFoundException"/> /// <exception cref="ClusterQuotaExceededException"/> /// <exception cref="ClusterSecurityGroupNotFoundException"/> public CreateClusterResponse CreateCluster(CreateClusterRequest createClusterRequest) { IAsyncResult asyncResult = invokeCreateCluster(createClusterRequest, null, null, true); return EndCreateCluster(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the CreateCluster operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.CreateCluster"/> /// </summary> /// /// <param name="createClusterRequest">Container for the necessary parameters to execute the CreateCluster 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 EndCreateCluster /// operation.</returns> public IAsyncResult BeginCreateCluster(CreateClusterRequest createClusterRequest, AsyncCallback callback, object state) { return invokeCreateCluster(createClusterRequest, callback, state, false); }
/// <summary> /// Creates a new cluster. To create the cluster in virtual private cloud (VPC), you /// must provide cluster subnet group name. If you don't provide a cluster subnet group /// name or the cluster security group parameter, Amazon Redshift creates a non-VPC cluster, /// it associates the default cluster security group with the cluster. 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> . /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateCluster service method.</param> /// /// <returns>The response from the CreateCluster service method, as returned by Redshift.</returns> /// <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.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.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.InvalidSubnetException"> /// The requested subnet is not valid, or not all of the subnets are in the same VPC. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidTagException"> /// The tag is invalid. /// </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.TagLimitExceededException"> /// The request exceeds the limit of 10 tags for the resource. /// </exception> /// <exception cref="Amazon.Redshift.Model.UnauthorizedOperationException"> /// Your account is not authorized to perform the requested operation. /// </exception> public CreateClusterResponse CreateCluster(CreateClusterRequest request) { var marshaller = new CreateClusterRequestMarshaller(); var unmarshaller = CreateClusterResponseUnmarshaller.Instance; return Invoke<CreateClusterRequest,CreateClusterResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateCluster operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateCluster 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 EndCreateCluster /// operation.</returns> public IAsyncResult BeginCreateCluster(CreateClusterRequest request, AsyncCallback callback, object state) { var marshaller = new CreateClusterRequestMarshaller(); var unmarshaller = CreateClusterResponseUnmarshaller.Instance; return BeginInvoke<CreateClusterRequest>(request, marshaller, unmarshaller, callback, state); }
internal CreateClusterResponse CreateCluster(CreateClusterRequest request) { var task = CreateClusterAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Creates a new cluster. To create the cluster in virtual private cloud (VPC), you must provide cluster subnet group name. If you don't /// provide a cluster subnet group name or the cluster security group parameter, Amazon Redshift creates a non-VPC cluster, it associates the /// default cluster security group with the cluster. 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="createClusterRequest">Container for the necessary parameters to execute the CreateCluster service method on /// AmazonRedshift.</param> /// /// <returns>The response from the CreateCluster 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.ClusterParameterGroupNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.InsufficientClusterCapacityException" /> /// <exception cref="T:Amazon.Redshift.Model.UnauthorizedOperationException" /> /// <exception cref="T:Amazon.Redshift.Model.NumberOfNodesQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.NumberOfNodesPerClusterLimitExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.HsmClientCertificateNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSecurityGroupNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<CreateClusterResponse> CreateClusterAsync(CreateClusterRequest createClusterRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateClusterRequestMarshaller(); var unmarshaller = CreateClusterResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateClusterRequest, CreateClusterResponse>(createClusterRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal CreateClusterResponse CreateCluster(CreateClusterRequest request) { var task = CreateClusterAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Creates a new cluster. To create the cluster in virtual private cloud (VPC), you must provide cluster subnet group name. If you don't /// provide a cluster subnet group name or the cluster security group parameter, Amazon Redshift creates a non-VPC cluster, it associates the /// default cluster security group with the cluster. 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="createClusterRequest">Container for the necessary parameters to execute the CreateCluster service method on /// AmazonRedshift.</param> /// /// <returns>The response from the CreateCluster 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.ClusterParameterGroupNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.InsufficientClusterCapacityException" /> /// <exception cref="T:Amazon.Redshift.Model.UnauthorizedOperationException" /> /// <exception cref="T:Amazon.Redshift.Model.NumberOfNodesQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.NumberOfNodesPerClusterLimitExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.HsmClientCertificateNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSecurityGroupNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<CreateClusterResponse> CreateClusterAsync(CreateClusterRequest createClusterRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateClusterRequestMarshaller(); var unmarshaller = CreateClusterResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateClusterRequest, CreateClusterResponse>(createClusterRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the CreateCluster operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateCluster 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<CreateClusterResponse> CreateClusterAsync(CreateClusterRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateClusterRequestMarshaller(); var unmarshaller = CreateClusterResponseUnmarshaller.Instance; return InvokeAsync<CreateClusterRequest,CreateClusterResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeCreateCluster(CreateClusterRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new CreateClusterRequestMarshaller(); var unmarshaller = CreateClusterResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.CreateClusterRequest(); 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.ClusterType != null) { request.ClusterType = cmdletContext.ClusterType; } if (cmdletContext.ClusterVersion != null) { request.ClusterVersion = cmdletContext.ClusterVersion; } if (cmdletContext.DBName != null) { request.DBName = cmdletContext.DBName; } if (cmdletContext.ElasticIp != null) { request.ElasticIp = cmdletContext.ElasticIp; } if (cmdletContext.Encrypted != null) { request.Encrypted = cmdletContext.Encrypted.Value; } 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.MasterUsername != null) { request.MasterUsername = cmdletContext.MasterUsername; } if (cmdletContext.MasterUserPassword != null) { request.MasterUserPassword = cmdletContext.MasterUserPassword; } if (cmdletContext.NodeType != null) { request.NodeType = cmdletContext.NodeType; } if (cmdletContext.NumberOfNodes != null) { request.NumberOfNodes = cmdletContext.NumberOfNodes.Value; } 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.SnapshotScheduleIdentifier != null) { request.SnapshotScheduleIdentifier = cmdletContext.SnapshotScheduleIdentifier; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } 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); }
private Amazon.Redshift.Model.CreateClusterResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.CreateClusterRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "CreateCluster"); try { #if DESKTOP return(client.CreateCluster(request)); #elif CORECLR return(client.CreateClusterAsync(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; } }
private CreateClusterRequest CreateClusterRequest(RedshiftDeveloperOptions devOptions) { var request = new CreateClusterRequest() { AllowVersionUpgrade = devOptions.AllowVersionUpgrade, AutomatedSnapshotRetentionPeriod = devOptions.AutomatedSnapshotRetentionPeriod, AvailabilityZone = devOptions.AvailabilityZone, ClusterIdentifier = devOptions.ClusterIdentifier, ClusterParameterGroupName = devOptions.ClusterParameterGroupName, ClusterSecurityGroups = devOptions.ClusterSecurityGroups, ClusterSubnetGroupName = devOptions.ClusterSubnetGroupName, ClusterType = devOptions.ClusterType, ClusterVersion = devOptions.ClusterVersion, DBName = devOptions.DBName, ElasticIp = devOptions.ElasticIp, Encrypted = devOptions.Encrypted, HsmClientCertificateIdentifier = devOptions.HSMClientCertificateIdentifier, HsmConfigurationIdentifier = devOptions.HSMClientConfigurationIdentifier, MasterUsername = devOptions.MasterUserName, MasterUserPassword = devOptions.MasterPassword, NodeType = devOptions.NodeType, NumberOfNodes = devOptions.NumberOfNodes, Port = devOptions.Port, PreferredMaintenanceWindow = devOptions.PreferredMaintenanceWindow, PubliclyAccessible = devOptions.PubliclyAccessible, VpcSecurityGroupIds = devOptions.VpcSecurityGroupIds }; return request; }