Exemple #1
0
 private Amazon.ManagedBlockchain.Model.UpdateNodeResponse CallAWSServiceOperation(IAmazonManagedBlockchain client, Amazon.ManagedBlockchain.Model.UpdateNodeRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Managed Blockchain", "UpdateNode");
     try
     {
         #if DESKTOP
         return(client.UpdateNode(request));
         #elif CORECLR
         return(client.UpdateNodeAsync(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 #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ManagedBlockchain.Model.UpdateNodeRequest();


            // populate LogPublishingConfiguration
            var requestLogPublishingConfigurationIsNull = true;

            request.LogPublishingConfiguration = new Amazon.ManagedBlockchain.Model.NodeLogPublishingConfiguration();
            Amazon.ManagedBlockchain.Model.NodeFabricLogPublishingConfiguration requestLogPublishingConfiguration_logPublishingConfiguration_Fabric = null;
            if (cmdletContext.LogPublishingConfiguration_Fabric != null)
            {
                requestLogPublishingConfiguration_logPublishingConfiguration_Fabric = cmdletContext.LogPublishingConfiguration_Fabric;
            }
            if (requestLogPublishingConfiguration_logPublishingConfiguration_Fabric != null)
            {
                request.LogPublishingConfiguration.Fabric = requestLogPublishingConfiguration_logPublishingConfiguration_Fabric;
                requestLogPublishingConfigurationIsNull   = false;
            }
            // determine if request.LogPublishingConfiguration should be set to null
            if (requestLogPublishingConfigurationIsNull)
            {
                request.LogPublishingConfiguration = null;
            }
            if (cmdletContext.MemberId != null)
            {
                request.MemberId = cmdletContext.MemberId;
            }
            if (cmdletContext.NetworkId != null)
            {
                request.NetworkId = cmdletContext.NetworkId;
            }
            if (cmdletContext.NodeId != null)
            {
                request.NodeId = cmdletContext.NodeId;
            }

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