public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.CreateClusterSubnetGroupRequest(); if (cmdletContext.ClusterSubnetGroupName != null) { request.ClusterSubnetGroupName = cmdletContext.ClusterSubnetGroupName; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.SubnetId != null) { request.SubnetIds = cmdletContext.SubnetId; } 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 invokeCreateClusterSubnetGroup(CreateClusterSubnetGroupRequest createClusterSubnetGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateClusterSubnetGroupRequestMarshaller().Marshall(createClusterSubnetGroupRequest); var unmarshaller = CreateClusterSubnetGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the CreateClusterSubnetGroup operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.CreateClusterSubnetGroup"/> /// </summary> /// /// <param name="createClusterSubnetGroupRequest">Container for the necessary parameters to execute the CreateClusterSubnetGroup 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 /// EndCreateClusterSubnetGroup operation.</returns> public IAsyncResult BeginCreateClusterSubnetGroup(CreateClusterSubnetGroupRequest createClusterSubnetGroupRequest, AsyncCallback callback, object state) { return invokeCreateClusterSubnetGroup(createClusterSubnetGroupRequest, callback, state, false); }
/// <summary> /// <para> Creates a new Amazon Redshift subnet group. You must provide a list of one or more subnets in your existing Amazon Virtual Private /// Cloud (Amazon VPC) when creating Amazon Redshift subnet group. </para> <para> For information about subnet groups, go to <a /// href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-cluster-subnet-groups.html" >Amazon Redshift Cluster Subnet Groups</a> in /// the <i>Amazon Redshift Management Guide</i> . /// </para> /// </summary> /// /// <param name="createClusterSubnetGroupRequest">Container for the necessary parameters to execute the CreateClusterSubnetGroup service method /// on AmazonRedshift.</param> /// /// <returns>The response from the CreateClusterSubnetGroup service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="InvalidSubnetException"/> /// <exception cref="UnauthorizedOperationException"/> /// <exception cref="ClusterSubnetQuotaExceededException"/> /// <exception cref="ClusterSubnetGroupAlreadyExistsException"/> /// <exception cref="ClusterSubnetGroupQuotaExceededException"/> public CreateClusterSubnetGroupResponse CreateClusterSubnetGroup(CreateClusterSubnetGroupRequest createClusterSubnetGroupRequest) { IAsyncResult asyncResult = invokeCreateClusterSubnetGroup(createClusterSubnetGroupRequest, null, null, true); return EndCreateClusterSubnetGroup(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the CreateClusterSubnetGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateClusterSubnetGroup 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 EndCreateClusterSubnetGroup /// operation.</returns> public IAsyncResult BeginCreateClusterSubnetGroup(CreateClusterSubnetGroupRequest request, AsyncCallback callback, object state) { var marshaller = new CreateClusterSubnetGroupRequestMarshaller(); var unmarshaller = CreateClusterSubnetGroupResponseUnmarshaller.Instance; return BeginInvoke<CreateClusterSubnetGroupRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Creates a new Amazon Redshift subnet group. You must provide a list of one or more /// subnets in your existing Amazon Virtual Private Cloud (Amazon VPC) when creating Amazon /// Redshift subnet group. /// /// /// <para> /// For information about subnet groups, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-cluster-subnet-groups.html">Amazon /// Redshift Cluster Subnet Groups</a> in the <i>Amazon Redshift Cluster Management Guide</i>. /// /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateClusterSubnetGroup service method.</param> /// /// <returns>The response from the CreateClusterSubnetGroup service method, as returned by Redshift.</returns> /// <exception cref="Amazon.Redshift.Model.ClusterSubnetGroupAlreadyExistsException"> /// A <i>ClusterSubnetGroupName</i> is already used by an existing cluster subnet group. /// </exception> /// <exception cref="Amazon.Redshift.Model.ClusterSubnetGroupQuotaExceededException"> /// The request would result in user exceeding the allowed number of cluster subnet groups. /// 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.ClusterSubnetQuotaExceededException"> /// The request would result in user exceeding the allowed number of subnets in a cluster /// subnet groups. 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.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.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 CreateClusterSubnetGroupResponse CreateClusterSubnetGroup(CreateClusterSubnetGroupRequest request) { var marshaller = new CreateClusterSubnetGroupRequestMarshaller(); var unmarshaller = CreateClusterSubnetGroupResponseUnmarshaller.Instance; return Invoke<CreateClusterSubnetGroupRequest,CreateClusterSubnetGroupResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Creates a new Amazon Redshift subnet group. You must provide a list of one or more subnets in your existing Amazon Virtual Private /// Cloud (Amazon VPC) when creating Amazon Redshift subnet group. </para> <para> For information about subnet groups, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-cluster-subnet-groups.html">Amazon Redshift Cluster Subnet Groups</a> in /// the <i>Amazon Redshift Management Guide</i> . /// </para> /// </summary> /// /// <param name="createClusterSubnetGroupRequest">Container for the necessary parameters to execute the CreateClusterSubnetGroup service method /// on AmazonRedshift.</param> /// /// <returns>The response from the CreateClusterSubnetGroup service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidSubnetException" /> /// <exception cref="T:Amazon.Redshift.Model.UnauthorizedOperationException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetGroupAlreadyExistsException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetGroupQuotaExceededException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<CreateClusterSubnetGroupResponse> CreateClusterSubnetGroupAsync(CreateClusterSubnetGroupRequest createClusterSubnetGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateClusterSubnetGroupRequestMarshaller(); var unmarshaller = CreateClusterSubnetGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateClusterSubnetGroupRequest, CreateClusterSubnetGroupResponse>(createClusterSubnetGroupRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal CreateClusterSubnetGroupResponse CreateClusterSubnetGroup(CreateClusterSubnetGroupRequest request) { var task = CreateClusterSubnetGroupAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Creates a new Amazon Redshift subnet group. You must provide a list of one or more subnets in your existing Amazon Virtual Private /// Cloud (Amazon VPC) when creating Amazon Redshift subnet group. </para> <para> For information about subnet groups, go to <a href="http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-cluster-subnet-groups.html">Amazon Redshift Cluster Subnet Groups</a> in /// the <i>Amazon Redshift Management Guide</i> . /// </para> /// </summary> /// /// <param name="createClusterSubnetGroupRequest">Container for the necessary parameters to execute the CreateClusterSubnetGroup service method /// on AmazonRedshift.</param> /// /// <returns>The response from the CreateClusterSubnetGroup service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidSubnetException" /> /// <exception cref="T:Amazon.Redshift.Model.UnauthorizedOperationException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetQuotaExceededException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetGroupAlreadyExistsException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetGroupQuotaExceededException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<CreateClusterSubnetGroupResponse> CreateClusterSubnetGroupAsync(CreateClusterSubnetGroupRequest createClusterSubnetGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateClusterSubnetGroupRequestMarshaller(); var unmarshaller = CreateClusterSubnetGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateClusterSubnetGroupRequest, CreateClusterSubnetGroupResponse>(createClusterSubnetGroupRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal CreateClusterSubnetGroupResponse CreateClusterSubnetGroup(CreateClusterSubnetGroupRequest request) { var task = CreateClusterSubnetGroupAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the CreateClusterSubnetGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateClusterSubnetGroup 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<CreateClusterSubnetGroupResponse> CreateClusterSubnetGroupAsync(CreateClusterSubnetGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateClusterSubnetGroupRequestMarshaller(); var unmarshaller = CreateClusterSubnetGroupResponseUnmarshaller.Instance; return InvokeAsync<CreateClusterSubnetGroupRequest,CreateClusterSubnetGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeCreateClusterSubnetGroup(CreateClusterSubnetGroupRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new CreateClusterSubnetGroupRequestMarshaller(); var unmarshaller = CreateClusterSubnetGroupResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
private Amazon.Redshift.Model.CreateClusterSubnetGroupResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.CreateClusterSubnetGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "CreateClusterSubnetGroup"); try { #if DESKTOP return(client.CreateClusterSubnetGroup(request)); #elif CORECLR return(client.CreateClusterSubnetGroupAsync(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; } }