public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.ModifyClusterSubnetGroupRequest(); if (cmdletContext.ClusterSubnetGroupName != null) { request.ClusterSubnetGroupName = cmdletContext.ClusterSubnetGroupName; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.SubnetId != null) { request.SubnetIds = cmdletContext.SubnetId; } 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 invokeModifyClusterSubnetGroup(ModifyClusterSubnetGroupRequest modifyClusterSubnetGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ModifyClusterSubnetGroupRequestMarshaller().Marshall(modifyClusterSubnetGroupRequest); var unmarshaller = ModifyClusterSubnetGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the ModifyClusterSubnetGroup operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.ModifyClusterSubnetGroup"/> /// </summary> /// /// <param name="modifyClusterSubnetGroupRequest">Container for the necessary parameters to execute the ModifyClusterSubnetGroup 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 /// EndModifyClusterSubnetGroup operation.</returns> public IAsyncResult BeginModifyClusterSubnetGroup(ModifyClusterSubnetGroupRequest modifyClusterSubnetGroupRequest, AsyncCallback callback, object state) { return invokeModifyClusterSubnetGroup(modifyClusterSubnetGroupRequest, callback, state, false); }
/// <summary> /// <para> Modifies a cluster subnet group to include the specified list of VPC subnets. The operation replaces the existing list of subnets /// with the new list of subnets. </para> /// </summary> /// /// <param name="modifyClusterSubnetGroupRequest">Container for the necessary parameters to execute the ModifyClusterSubnetGroup service method /// on AmazonRedshift.</param> /// /// <returns>The response from the ModifyClusterSubnetGroup service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="SubnetAlreadyInUseException"/> /// <exception cref="InvalidSubnetException"/> /// <exception cref="UnauthorizedOperationException"/> /// <exception cref="ClusterSubnetQuotaExceededException"/> /// <exception cref="ClusterSubnetGroupNotFoundException"/> public ModifyClusterSubnetGroupResponse ModifyClusterSubnetGroup(ModifyClusterSubnetGroupRequest modifyClusterSubnetGroupRequest) { IAsyncResult asyncResult = invokeModifyClusterSubnetGroup(modifyClusterSubnetGroupRequest, null, null, true); return EndModifyClusterSubnetGroup(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the ModifyClusterSubnetGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyClusterSubnetGroup 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 EndModifyClusterSubnetGroup /// operation.</returns> public IAsyncResult BeginModifyClusterSubnetGroup(ModifyClusterSubnetGroupRequest request, AsyncCallback callback, object state) { var marshaller = new ModifyClusterSubnetGroupRequestMarshaller(); var unmarshaller = ModifyClusterSubnetGroupResponseUnmarshaller.Instance; return BeginInvoke<ModifyClusterSubnetGroupRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Modifies a cluster subnet group to include the specified list of VPC subnets. The /// operation replaces the existing list of subnets with the new list of subnets. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyClusterSubnetGroup service method.</param> /// /// <returns>The response from the ModifyClusterSubnetGroup service method, as returned by Redshift.</returns> /// <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.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.SubnetAlreadyInUseException"> /// A specified subnet is already in use by another cluster. /// </exception> /// <exception cref="Amazon.Redshift.Model.UnauthorizedOperationException"> /// Your account is not authorized to perform the requested operation. /// </exception> public ModifyClusterSubnetGroupResponse ModifyClusterSubnetGroup(ModifyClusterSubnetGroupRequest request) { var marshaller = new ModifyClusterSubnetGroupRequestMarshaller(); var unmarshaller = ModifyClusterSubnetGroupResponseUnmarshaller.Instance; return Invoke<ModifyClusterSubnetGroupRequest,ModifyClusterSubnetGroupResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Modifies a cluster subnet group to include the specified list of VPC subnets. The operation replaces the existing list of subnets /// with the new list of subnets. </para> /// </summary> /// /// <param name="modifyClusterSubnetGroupRequest">Container for the necessary parameters to execute the ModifyClusterSubnetGroup service method /// on AmazonRedshift.</param> /// /// <returns>The response from the ModifyClusterSubnetGroup service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.SubnetAlreadyInUseException" /> /// <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.ClusterSubnetGroupNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<ModifyClusterSubnetGroupResponse> ModifyClusterSubnetGroupAsync(ModifyClusterSubnetGroupRequest modifyClusterSubnetGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyClusterSubnetGroupRequestMarshaller(); var unmarshaller = ModifyClusterSubnetGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ModifyClusterSubnetGroupRequest, ModifyClusterSubnetGroupResponse>(modifyClusterSubnetGroupRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal ModifyClusterSubnetGroupResponse ModifyClusterSubnetGroup(ModifyClusterSubnetGroupRequest request) { var task = ModifyClusterSubnetGroupAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Modifies a cluster subnet group to include the specified list of VPC subnets. The operation replaces the existing list of subnets /// with the new list of subnets. </para> /// </summary> /// /// <param name="modifyClusterSubnetGroupRequest">Container for the necessary parameters to execute the ModifyClusterSubnetGroup service method /// on AmazonRedshift.</param> /// /// <returns>The response from the ModifyClusterSubnetGroup service method, as returned by AmazonRedshift.</returns> /// /// <exception cref="T:Amazon.Redshift.Model.SubnetAlreadyInUseException" /> /// <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.ClusterSubnetGroupNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<ModifyClusterSubnetGroupResponse> ModifyClusterSubnetGroupAsync(ModifyClusterSubnetGroupRequest modifyClusterSubnetGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyClusterSubnetGroupRequestMarshaller(); var unmarshaller = ModifyClusterSubnetGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ModifyClusterSubnetGroupRequest, ModifyClusterSubnetGroupResponse>(modifyClusterSubnetGroupRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal ModifyClusterSubnetGroupResponse ModifyClusterSubnetGroup(ModifyClusterSubnetGroupRequest request) { var task = ModifyClusterSubnetGroupAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the ModifyClusterSubnetGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyClusterSubnetGroup 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<ModifyClusterSubnetGroupResponse> ModifyClusterSubnetGroupAsync(ModifyClusterSubnetGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyClusterSubnetGroupRequestMarshaller(); var unmarshaller = ModifyClusterSubnetGroupResponseUnmarshaller.Instance; return InvokeAsync<ModifyClusterSubnetGroupRequest,ModifyClusterSubnetGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeModifyClusterSubnetGroup(ModifyClusterSubnetGroupRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new ModifyClusterSubnetGroupRequestMarshaller(); var unmarshaller = ModifyClusterSubnetGroupResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
private Amazon.Redshift.Model.ModifyClusterSubnetGroupResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.ModifyClusterSubnetGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "ModifyClusterSubnetGroup"); try { #if DESKTOP return(client.ModifyClusterSubnetGroup(request)); #elif CORECLR return(client.ModifyClusterSubnetGroupAsync(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; } }