protected override void ProcessRecord() { AmazonRDS client = base.GetClient(); Amazon.RDS.Model.RevokeDBSecurityGroupIngressRequest request = new Amazon.RDS.Model.RevokeDBSecurityGroupIngressRequest(); request.DBSecurityGroupName = this._DBSecurityGroupName; request.CIDRIP = this._CIDRIP; request.EC2SecurityGroupName = this._EC2SecurityGroupName; request.EC2SecurityGroupOwnerId = this._EC2SecurityGroupOwnerId; Amazon.RDS.Model.RevokeDBSecurityGroupIngressResponse response = client.RevokeDBSecurityGroupIngress(request); base.WriteObject(response.RevokeDBSecurityGroupIngressResult, true); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.RDS.Model.RevokeDBSecurityGroupIngressRequest(); if (cmdletContext.CIDRIP != null) { request.CIDRIP = cmdletContext.CIDRIP; } if (cmdletContext.DBSecurityGroupName != null) { request.DBSecurityGroupName = cmdletContext.DBSecurityGroupName; } if (cmdletContext.EC2SecurityGroupId != null) { request.EC2SecurityGroupId = cmdletContext.EC2SecurityGroupId; } if (cmdletContext.EC2SecurityGroupName != null) { request.EC2SecurityGroupName = cmdletContext.EC2SecurityGroupName; } if (cmdletContext.EC2SecurityGroupOwnerId != null) { request.EC2SecurityGroupOwnerId = cmdletContext.EC2SecurityGroupOwnerId; } 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 invokeRevokeDBSecurityGroupIngress(RevokeDBSecurityGroupIngressRequest revokeDBSecurityGroupIngressRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new RevokeDBSecurityGroupIngressRequestMarshaller().Marshall(revokeDBSecurityGroupIngressRequest); var unmarshaller = RevokeDBSecurityGroupIngressResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Revokes ingress from a DBSecurityGroup for previously authorized IP ranges or EC2 or VPC Security Groups. Required parameters for /// this API are one of CIDRIP, EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId). /// </para> /// </summary> /// /// <param name="revokeDBSecurityGroupIngressRequest">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress service /// method on AmazonRDS.</param> /// /// <returns>The response from the RevokeDBSecurityGroupIngress service method, as returned by AmazonRDS.</returns> /// /// <exception cref="DBSecurityGroupNotFoundException"/> /// <exception cref="InvalidDBSecurityGroupStateException"/> /// <exception cref="AuthorizationNotFoundException"/> public RevokeDBSecurityGroupIngressResponse RevokeDBSecurityGroupIngress(RevokeDBSecurityGroupIngressRequest revokeDBSecurityGroupIngressRequest) { IAsyncResult asyncResult = invokeRevokeDBSecurityGroupIngress(revokeDBSecurityGroupIngressRequest, null, null, true); return EndRevokeDBSecurityGroupIngress(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the RevokeDBSecurityGroupIngress operation. /// <seealso cref="Amazon.RDS.AmazonRDS.RevokeDBSecurityGroupIngress"/> /// </summary> /// /// <param name="revokeDBSecurityGroupIngressRequest">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress /// 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> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking /// EndRevokeDBSecurityGroupIngress operation.</returns> public IAsyncResult BeginRevokeDBSecurityGroupIngress(RevokeDBSecurityGroupIngressRequest revokeDBSecurityGroupIngressRequest, AsyncCallback callback, object state) { return invokeRevokeDBSecurityGroupIngress(revokeDBSecurityGroupIngressRequest, callback, state, false); }
/// <summary> /// Initiates the asynchronous execution of the RevokeDBSecurityGroupIngress operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress 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<RevokeDBSecurityGroupIngressResponse> RevokeDBSecurityGroupIngressAsync(RevokeDBSecurityGroupIngressRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RevokeDBSecurityGroupIngressRequestMarshaller(); var unmarshaller = RevokeDBSecurityGroupIngressResponseUnmarshaller.Instance; return InvokeAsync<RevokeDBSecurityGroupIngressRequest,RevokeDBSecurityGroupIngressResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Revokes ingress from a DBSecurityGroup for previously authorized IP ranges or EC2 /// or VPC Security Groups. Required parameters for this API are one of CIDRIP, EC2SecurityGroupId /// for VPC, or (EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId). /// </summary> /// <param name="request">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress service method.</param> /// /// <returns>The response from the RevokeDBSecurityGroupIngress service method, as returned by RDS.</returns> /// <exception cref="Amazon.RDS.Model.AuthorizationNotFoundException"> /// Specified CIDRIP or EC2 security group is not authorized for the specified DB security /// group. /// /// /// <para> /// RDS may not also be authorized via IAM to perform necessary actions on your behalf. /// </para> /// </exception> /// <exception cref="Amazon.RDS.Model.DBSecurityGroupNotFoundException"> /// <i>DBSecurityGroupName</i> does not refer to an existing DB security group. /// </exception> /// <exception cref="Amazon.RDS.Model.InvalidDBSecurityGroupStateException"> /// The state of the DB security group does not allow deletion. /// </exception> public RevokeDBSecurityGroupIngressResponse RevokeDBSecurityGroupIngress(RevokeDBSecurityGroupIngressRequest request) { var marshaller = new RevokeDBSecurityGroupIngressRequestMarshaller(); var unmarshaller = RevokeDBSecurityGroupIngressResponseUnmarshaller.Instance; return Invoke<RevokeDBSecurityGroupIngressRequest,RevokeDBSecurityGroupIngressResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the RevokeDBSecurityGroupIngress operation. /// <seealso cref="Amazon.RDS.IAmazonRDS.RevokeDBSecurityGroupIngress"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress 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<RevokeDBSecurityGroupIngressResponse> RevokeDBSecurityGroupIngressAsync(RevokeDBSecurityGroupIngressRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RevokeDBSecurityGroupIngressRequestMarshaller(); var unmarshaller = RevokeDBSecurityGroupIngressResponseUnmarshaller.GetInstance(); return Invoke<IRequest, RevokeDBSecurityGroupIngressRequest, RevokeDBSecurityGroupIngressResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Revokes ingress from a DBSecurityGroup for previously authorized IP ranges or EC2 or VPC Security Groups. Required parameters for /// this API are one of CIDRIP, EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId). /// </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress service /// method on AmazonRDS.</param> /// /// <returns>The response from the RevokeDBSecurityGroupIngress service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.DBSecurityGroupNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.InvalidDBSecurityGroupStateException" /> /// <exception cref="T:Amazon.RDS.Model.AuthorizationNotFoundException" /> public RevokeDBSecurityGroupIngressResponse RevokeDBSecurityGroupIngress(RevokeDBSecurityGroupIngressRequest request) { var task = RevokeDBSecurityGroupIngressAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Revokes ingress from a DBSecurityGroup for previously authorized IP ranges or EC2 or VPC Security Groups. Required parameters for /// this API are one of CIDRIP, EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId). /// </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress service /// method on AmazonRDS.</param> /// /// <returns>The response from the RevokeDBSecurityGroupIngress service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.DBSecurityGroupNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.InvalidDBSecurityGroupStateException" /> /// <exception cref="T:Amazon.RDS.Model.AuthorizationNotFoundException" /> public RevokeDBSecurityGroupIngressResponse RevokeDBSecurityGroupIngress(RevokeDBSecurityGroupIngressRequest request) { var task = RevokeDBSecurityGroupIngressAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Revokes ingress from a DBSecurityGroup for previously authorized IP ranges or EC2 or VPC Security Groups. Required parameters for /// this API are one of CIDRIP, EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId). /// </para> /// </summary> /// /// <param name="revokeDBSecurityGroupIngressRequest">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress service /// method on AmazonRDS.</param> /// /// <returns>The response from the RevokeDBSecurityGroupIngress service method, as returned by AmazonRDS.</returns> /// /// <exception cref="T:Amazon.RDS.Model.DBSecurityGroupNotFoundException" /> /// <exception cref="T:Amazon.RDS.Model.InvalidDBSecurityGroupStateException" /> /// <exception cref="T:Amazon.RDS.Model.AuthorizationNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<RevokeDBSecurityGroupIngressResponse> RevokeDBSecurityGroupIngressAsync(RevokeDBSecurityGroupIngressRequest revokeDBSecurityGroupIngressRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RevokeDBSecurityGroupIngressRequestMarshaller(); var unmarshaller = RevokeDBSecurityGroupIngressResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, RevokeDBSecurityGroupIngressRequest, RevokeDBSecurityGroupIngressResponse>(revokeDBSecurityGroupIngressRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the RevokeDBSecurityGroupIngress operation. /// <seealso cref="Amazon.RDS.IAmazonRDS"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress 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 EndRevokeDBSecurityGroupIngress /// operation.</returns> public IAsyncResult BeginRevokeDBSecurityGroupIngress(RevokeDBSecurityGroupIngressRequest request, AsyncCallback callback, object state) { var marshaller = new RevokeDBSecurityGroupIngressRequestMarshaller(); var unmarshaller = RevokeDBSecurityGroupIngressResponseUnmarshaller.Instance; return BeginInvoke<RevokeDBSecurityGroupIngressRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Revokes ingress from a DBSecurityGroup for previously authorized IP ranges or EC2 or VPC Security Groups. Required parameters for /// this API are one of CIDRIP, EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId). /// </para> /// </summary> /// /// <param name="revokeDBSecurityGroupIngressRequest">Container for the necessary parameters to execute the RevokeDBSecurityGroupIngress service /// method on AmazonRDS.</param> /// /// <returns>The response from the RevokeDBSecurityGroupIngress service method, as returned by AmazonRDS.</returns> /// /// <exception cref="DBSecurityGroupNotFoundException"/> /// <exception cref="InvalidDBSecurityGroupStateException"/> /// <exception cref="AuthorizationNotFoundException"/> public RevokeDBSecurityGroupIngressResponse RevokeDBSecurityGroupIngress(RevokeDBSecurityGroupIngressRequest revokeDBSecurityGroupIngressRequest) { IRequest<RevokeDBSecurityGroupIngressRequest> request = new RevokeDBSecurityGroupIngressRequestMarshaller().Marshall(revokeDBSecurityGroupIngressRequest); RevokeDBSecurityGroupIngressResponse response = Invoke<RevokeDBSecurityGroupIngressRequest, RevokeDBSecurityGroupIngressResponse> (request, this.signer, RevokeDBSecurityGroupIngressResponseUnmarshaller.GetInstance()); return response; }
private Amazon.RDS.Model.RevokeDBSecurityGroupIngressResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.RevokeDBSecurityGroupIngressRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "RevokeDBSecurityGroupIngress"); try { #if DESKTOP return(client.RevokeDBSecurityGroupIngress(request)); #elif CORECLR return(client.RevokeDBSecurityGroupIngressAsync(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; } }