Container for the parameters to the RegisterRdsDbInstance operation. Registers an Amazon RDS instance with a stack.

Required Permissions: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Inheritance: AmazonOpsWorksRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.OpsWorks.Model.RegisterRdsDbInstanceRequest();

            if (cmdletContext.DbPassword != null)
            {
                request.DbPassword = cmdletContext.DbPassword;
            }
            if (cmdletContext.DbUser != null)
            {
                request.DbUser = cmdletContext.DbUser;
            }
            if (cmdletContext.RdsDbInstanceArn != null)
            {
                request.RdsDbInstanceArn = cmdletContext.RdsDbInstanceArn;
            }
            if (cmdletContext.StackId != null)
            {
                request.StackId = cmdletContext.StackId;
            }

            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 RegisterRdsDbInstance operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the RegisterRdsDbInstance 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<RegisterRdsDbInstanceResponse> RegisterRdsDbInstanceAsync(RegisterRdsDbInstanceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new RegisterRdsDbInstanceRequestMarshaller();
            var unmarshaller = RegisterRdsDbInstanceResponseUnmarshaller.Instance;

            return InvokeAsync<RegisterRdsDbInstanceRequest,RegisterRdsDbInstanceResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal RegisterRdsDbInstanceResponse RegisterRdsDbInstance(RegisterRdsDbInstanceRequest request)
        {
            var marshaller = new RegisterRdsDbInstanceRequestMarshaller();
            var unmarshaller = RegisterRdsDbInstanceResponseUnmarshaller.Instance;

            return Invoke<RegisterRdsDbInstanceRequest,RegisterRdsDbInstanceResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the RegisterRdsDbInstance operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the RegisterRdsDbInstance operation on AmazonOpsWorksClient.</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 EndRegisterRdsDbInstance
        ///         operation.</returns>
        public IAsyncResult BeginRegisterRdsDbInstance(RegisterRdsDbInstanceRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new RegisterRdsDbInstanceRequestMarshaller();
            var unmarshaller = RegisterRdsDbInstanceResponseUnmarshaller.Instance;

            return BeginInvoke<RegisterRdsDbInstanceRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 internal RegisterRdsDbInstanceResponse RegisterRdsDbInstance(RegisterRdsDbInstanceRequest request)
 {
     var task = RegisterRdsDbInstanceAsync(request);
     try
     {
         return task.Result;
     }
     catch(AggregateException e)
     {
         ExceptionDispatchInfo.Capture(e.InnerException).Throw();
         return null;
     }
 }
        IAsyncResult invokeRegisterRdsDbInstance(RegisterRdsDbInstanceRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new RegisterRdsDbInstanceRequestMarshaller();
            var unmarshaller = RegisterRdsDbInstanceResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
 /// <summary>
 /// Initiates the asynchronous execution of the RegisterRdsDbInstance operation.
 /// <seealso cref="Amazon.OpsWorks.IAmazonOpsWorks"/>
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the RegisterRdsDbInstance operation on AmazonOpsWorksClient.</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 EndRegisterRdsDbInstance
 ///         operation.</returns>
 public IAsyncResult BeginRegisterRdsDbInstance(RegisterRdsDbInstanceRequest request, AsyncCallback callback, object state)
 {
     return invokeRegisterRdsDbInstance(request, callback, state, false);
 }
 /// <summary>
 /// Registers an Amazon RDS instance with a stack.
 /// </summary>
 /// <param name="request">Container for the necessary parameters to execute the RegisterRdsDbInstance service method.</param>
 /// 
 /// <returns>The response from the RegisterRdsDbInstance service method, as returned by OpsWorks.</returns>
 /// <exception cref="ResourceNotFoundException">
 /// Indicates that a resource was not found.
 /// </exception>
 /// <exception cref="ValidationException">
 /// Indicates that a request was invalid.
 /// </exception>
 public RegisterRdsDbInstanceResponse RegisterRdsDbInstance(RegisterRdsDbInstanceRequest request)
 {
     IAsyncResult asyncResult = invokeRegisterRdsDbInstance(request, null, null, true);
     return EndRegisterRdsDbInstance(asyncResult);
 }
 private Amazon.OpsWorks.Model.RegisterRdsDbInstanceResponse CallAWSServiceOperation(IAmazonOpsWorks client, Amazon.OpsWorks.Model.RegisterRdsDbInstanceRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS OpsWorks", "RegisterRdsDbInstance");
     try
     {
         #if DESKTOP
         return(client.RegisterRdsDbInstance(request));
         #elif CORECLR
         return(client.RegisterRdsDbInstanceAsync(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;
     }
 }
Exemple #10
0
 IAsyncResult invokeRegisterRdsDbInstance(RegisterRdsDbInstanceRequest request, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new RegisterRdsDbInstanceRequestMarshaller().Marshall(request);
     var unmarshaller = RegisterRdsDbInstanceResponseUnmarshaller.Instance;
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }