Deletes a DB subnet group.
NOTE:The specified database subnet group must not be associated with any DB instances.
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.RDS.Model.DeleteDBSubnetGroupRequest(); if (cmdletContext.DBSubnetGroupName != null) { request.DBSubnetGroupName = cmdletContext.DBSubnetGroupName; } 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 DeleteDBSubnetGroup operation. /// <seealso cref="Amazon.RDS.AmazonRDS.DeleteDBSubnetGroup"/> /// </summary> /// /// <param name="deleteDBSubnetGroupRequest">Container for the necessary parameters to execute the DeleteDBSubnetGroup operation on /// AmazonRDS.</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> public IAsyncResult BeginDeleteDBSubnetGroup(DeleteDBSubnetGroupRequest deleteDBSubnetGroupRequest, AsyncCallback callback, object state) { return invokeDeleteDBSubnetGroup(deleteDBSubnetGroupRequest, callback, state, false); }
IAsyncResult invokeDeleteDBSubnetGroup(DeleteDBSubnetGroupRequest deleteDBSubnetGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteDBSubnetGroupRequestMarshaller().Marshall(deleteDBSubnetGroupRequest); var unmarshaller = DeleteDBSubnetGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Deletes a DB subnet group. </para> <para><b>NOTE:</b>The specified database subnet group must not be associated with any DB /// instances.</para> /// </summary> /// /// <param name="deleteDBSubnetGroupRequest">Container for the necessary parameters to execute the DeleteDBSubnetGroup service method on /// AmazonRDS.</param> /// /// <exception cref="DBSubnetGroupNotFoundException"/> /// <exception cref="InvalidDBSubnetGroupStateException"/> /// <exception cref="InvalidDBSubnetStateException"/> public DeleteDBSubnetGroupResponse DeleteDBSubnetGroup(DeleteDBSubnetGroupRequest deleteDBSubnetGroupRequest) { IAsyncResult asyncResult = invokeDeleteDBSubnetGroup(deleteDBSubnetGroupRequest, null, null, true); return EndDeleteDBSubnetGroup(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DeleteDBSubnetGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteDBSubnetGroup 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<DeleteDBSubnetGroupResponse> DeleteDBSubnetGroupAsync(DeleteDBSubnetGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteDBSubnetGroupRequestMarshaller(); var unmarshaller = DeleteDBSubnetGroupResponseUnmarshaller.Instance; return InvokeAsync<DeleteDBSubnetGroupRequest,DeleteDBSubnetGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Deletes a DB subnet group. /// /// <note>The specified database subnet group must not be associated with any DB instances.</note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDBSubnetGroup service method.</param> /// /// <returns>The response from the DeleteDBSubnetGroup service method, as returned by RDS.</returns> /// <exception cref="Amazon.RDS.Model.DBSubnetGroupNotFoundException"> /// <i>DBSubnetGroupName</i> does not refer to an existing DB subnet group. /// </exception> /// <exception cref="Amazon.RDS.Model.InvalidDBSubnetGroupStateException"> /// The DB subnet group cannot be deleted because it is in use. /// </exception> /// <exception cref="Amazon.RDS.Model.InvalidDBSubnetStateException"> /// The DB subnet is not in the <i>available</i> state. /// </exception> public DeleteDBSubnetGroupResponse DeleteDBSubnetGroup(DeleteDBSubnetGroupRequest request) { var marshaller = new DeleteDBSubnetGroupRequestMarshaller(); var unmarshaller = DeleteDBSubnetGroupResponseUnmarshaller.Instance; return Invoke<DeleteDBSubnetGroupRequest,DeleteDBSubnetGroupResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeleteDBSubnetGroup operation. /// <seealso cref="Amazon.RDS.IAmazonRDS.DeleteDBSubnetGroup"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteDBSubnetGroup 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<DeleteDBSubnetGroupResponse> DeleteDBSubnetGroupAsync(DeleteDBSubnetGroupRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteDBSubnetGroupRequestMarshaller(); var unmarshaller = DeleteDBSubnetGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteDBSubnetGroupRequest, DeleteDBSubnetGroupResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Deletes a DB subnet group. </para> <para><b>NOTE:</b>The specified database subnet group must not be associated with any DB /// instances.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteDBSubnetGroup service method on /// AmazonRDS.</param> /// /// <exception cref="T:Amazon.RDS.Model.DBSubnetGroupNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.InvalidDBSubnetGroupStateException" /> /// <exception cref="T:Amazon.RDS.Model.InvalidDBSubnetStateException" /> public DeleteDBSubnetGroupResponse DeleteDBSubnetGroup(DeleteDBSubnetGroupRequest request) { var task = DeleteDBSubnetGroupAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Deletes a DB subnet group. </para> <para><b>NOTE:</b>The specified database subnet group must not be associated with any DB /// instances.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteDBSubnetGroup service method on /// AmazonRDS.</param> /// /// <exception cref="T:Amazon.RDS.Model.DBSubnetGroupNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.InvalidDBSubnetGroupStateException" /> /// <exception cref="T:Amazon.RDS.Model.InvalidDBSubnetStateException" /> public DeleteDBSubnetGroupResponse DeleteDBSubnetGroup(DeleteDBSubnetGroupRequest request) { var task = DeleteDBSubnetGroupAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Deletes a DB subnet group. </para> <para><b>NOTE:</b>The specified database subnet group must not be associated with any DB /// instances.</para> /// </summary> /// /// <param name="deleteDBSubnetGroupRequest">Container for the necessary parameters to execute the DeleteDBSubnetGroup service method on /// AmazonRDS.</param> /// /// <exception cref="T:Amazon.RDS.Model.DBSubnetGroupNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.InvalidDBSubnetGroupStateException" /> /// <exception cref="T:Amazon.RDS.Model.InvalidDBSubnetStateException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<DeleteDBSubnetGroupResponse> DeleteDBSubnetGroupAsync(DeleteDBSubnetGroupRequest deleteDBSubnetGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteDBSubnetGroupRequestMarshaller(); var unmarshaller = DeleteDBSubnetGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteDBSubnetGroupRequest, DeleteDBSubnetGroupResponse>(deleteDBSubnetGroupRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the DeleteDBSubnetGroup operation. /// <seealso cref="Amazon.RDS.IAmazonRDS"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteDBSubnetGroup 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 EndDeleteDBSubnetGroup /// operation.</returns> public IAsyncResult BeginDeleteDBSubnetGroup(DeleteDBSubnetGroupRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteDBSubnetGroupRequestMarshaller(); var unmarshaller = DeleteDBSubnetGroupResponseUnmarshaller.Instance; return BeginInvoke<DeleteDBSubnetGroupRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Deletes a DB subnet group. </para> <para><b>NOTE:</b>The specified database subnet group must not be associated with any DB /// instances.</para> /// </summary> /// /// <param name="deleteDBSubnetGroupRequest">Container for the necessary parameters to execute the DeleteDBSubnetGroup service method on /// AmazonRDS.</param> /// /// <exception cref="DBSubnetGroupNotFoundException"/> /// <exception cref="InvalidDBSubnetGroupStateException"/> /// <exception cref="InvalidDBSubnetStateException"/> public DeleteDBSubnetGroupResponse DeleteDBSubnetGroup(DeleteDBSubnetGroupRequest deleteDBSubnetGroupRequest) { IRequest<DeleteDBSubnetGroupRequest> request = new DeleteDBSubnetGroupRequestMarshaller().Marshall(deleteDBSubnetGroupRequest); DeleteDBSubnetGroupResponse response = Invoke<DeleteDBSubnetGroupRequest, DeleteDBSubnetGroupResponse> (request, this.signer, DeleteDBSubnetGroupResponseUnmarshaller.GetInstance()); return response; }
private Amazon.RDS.Model.DeleteDBSubnetGroupResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.DeleteDBSubnetGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "DeleteDBSubnetGroup"); try { #if DESKTOP return(client.DeleteDBSubnetGroup(request)); #elif CORECLR return(client.DeleteDBSubnetGroupAsync(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; } }