示例#1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ManagedBlockchain.Model.CreateNodeRequest();

            if (cmdletContext.ClientRequestToken != null)
            {
                request.ClientRequestToken = cmdletContext.ClientRequestToken;
            }
            if (cmdletContext.MemberId != null)
            {
                request.MemberId = cmdletContext.MemberId;
            }
            if (cmdletContext.NetworkId != null)
            {
                request.NetworkId = cmdletContext.NetworkId;
            }

            // populate NodeConfiguration
            var requestNodeConfigurationIsNull = true;

            request.NodeConfiguration = new Amazon.ManagedBlockchain.Model.NodeConfiguration();
            System.String requestNodeConfiguration_nodeConfiguration_AvailabilityZone = null;
            if (cmdletContext.NodeConfiguration_AvailabilityZone != null)
            {
                requestNodeConfiguration_nodeConfiguration_AvailabilityZone = cmdletContext.NodeConfiguration_AvailabilityZone;
            }
            if (requestNodeConfiguration_nodeConfiguration_AvailabilityZone != null)
            {
                request.NodeConfiguration.AvailabilityZone = requestNodeConfiguration_nodeConfiguration_AvailabilityZone;
                requestNodeConfigurationIsNull             = false;
            }
            System.String requestNodeConfiguration_nodeConfiguration_InstanceType = null;
            if (cmdletContext.NodeConfiguration_InstanceType != null)
            {
                requestNodeConfiguration_nodeConfiguration_InstanceType = cmdletContext.NodeConfiguration_InstanceType;
            }
            if (requestNodeConfiguration_nodeConfiguration_InstanceType != null)
            {
                request.NodeConfiguration.InstanceType = requestNodeConfiguration_nodeConfiguration_InstanceType;
                requestNodeConfigurationIsNull         = false;
            }
            Amazon.ManagedBlockchain.StateDBType requestNodeConfiguration_nodeConfiguration_StateDB = null;
            if (cmdletContext.NodeConfiguration_StateDB != null)
            {
                requestNodeConfiguration_nodeConfiguration_StateDB = cmdletContext.NodeConfiguration_StateDB;
            }
            if (requestNodeConfiguration_nodeConfiguration_StateDB != null)
            {
                request.NodeConfiguration.StateDB = requestNodeConfiguration_nodeConfiguration_StateDB;
                requestNodeConfigurationIsNull    = false;
            }
            Amazon.ManagedBlockchain.Model.NodeLogPublishingConfiguration requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration = null;

            // populate LogPublishingConfiguration
            var requestNodeConfiguration_nodeConfiguration_LogPublishingConfigurationIsNull = true;

            requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration = new Amazon.ManagedBlockchain.Model.NodeLogPublishingConfiguration();
            Amazon.ManagedBlockchain.Model.NodeFabricLogPublishingConfiguration requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration_logPublishingConfiguration_Fabric = null;
            if (cmdletContext.LogPublishingConfiguration_Fabric != null)
            {
                requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration_logPublishingConfiguration_Fabric = cmdletContext.LogPublishingConfiguration_Fabric;
            }
            if (requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration_logPublishingConfiguration_Fabric != null)
            {
                requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration.Fabric = requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration_logPublishingConfiguration_Fabric;
                requestNodeConfiguration_nodeConfiguration_LogPublishingConfigurationIsNull  = false;
            }
            // determine if requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration should be set to null
            if (requestNodeConfiguration_nodeConfiguration_LogPublishingConfigurationIsNull)
            {
                requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration = null;
            }
            if (requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration != null)
            {
                request.NodeConfiguration.LogPublishingConfiguration = requestNodeConfiguration_nodeConfiguration_LogPublishingConfiguration;
                requestNodeConfigurationIsNull = false;
            }
            // determine if request.NodeConfiguration should be set to null
            if (requestNodeConfigurationIsNull)
            {
                request.NodeConfiguration = null;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            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);
        }
示例#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);
        }