Beispiel #1
0
 private Amazon.RDS.Model.ModifyDBProxyResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.ModifyDBProxyRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "ModifyDBProxy");
     try
     {
         #if DESKTOP
         return(client.ModifyDBProxy(request));
         #elif CORECLR
         return(client.ModifyDBProxyAsync(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;
     }
 }
Beispiel #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.RDS.Model.ModifyDBProxyRequest();

            if (cmdletContext.Auth != null)
            {
                request.Auth = cmdletContext.Auth;
            }
            if (cmdletContext.DBProxyName != null)
            {
                request.DBProxyName = cmdletContext.DBProxyName;
            }
            if (cmdletContext.DebugLogging != null)
            {
                request.DebugLogging = cmdletContext.DebugLogging.Value;
            }
            if (cmdletContext.IdleClientTimeout != null)
            {
                request.IdleClientTimeout = cmdletContext.IdleClientTimeout.Value;
            }
            if (cmdletContext.NewDBProxyName != null)
            {
                request.NewDBProxyName = cmdletContext.NewDBProxyName;
            }
            if (cmdletContext.RequireTLS != null)
            {
                request.RequireTLS = cmdletContext.RequireTLS.Value;
            }
            if (cmdletContext.RoleArn != null)
            {
                request.RoleArn = cmdletContext.RoleArn;
            }
            if (cmdletContext.SecurityGroup != null)
            {
                request.SecurityGroups = cmdletContext.SecurityGroup;
            }

            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);
        }