コード例 #1
0
 private Amazon.SageMaker.Model.CreateAutoMLJobResponse CallAWSServiceOperation(IAmazonSageMaker client, Amazon.SageMaker.Model.CreateAutoMLJobRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Service", "CreateAutoMLJob");
     try
     {
         #if DESKTOP
         return(client.CreateAutoMLJob(request));
         #elif CORECLR
         return(client.CreateAutoMLJobAsync(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;
     }
 }
コード例 #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SageMaker.Model.CreateAutoMLJobRequest();


            // populate AutoMLJobConfig
            var requestAutoMLJobConfigIsNull = true;

            request.AutoMLJobConfig = new Amazon.SageMaker.Model.AutoMLJobConfig();
            Amazon.SageMaker.Model.AutoMLJobCompletionCriteria requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria = null;

            // populate CompletionCriteria
            var requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull = true;

            requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria = new Amazon.SageMaker.Model.AutoMLJobCompletionCriteria();
            System.Int32?requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxAutoMLJobRuntimeInSecond = null;
            if (cmdletContext.CompletionCriteria_MaxAutoMLJobRuntimeInSecond != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxAutoMLJobRuntimeInSecond = cmdletContext.CompletionCriteria_MaxAutoMLJobRuntimeInSecond.Value;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxAutoMLJobRuntimeInSecond != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria.MaxAutoMLJobRuntimeInSeconds = requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxAutoMLJobRuntimeInSecond.Value;
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull = false;
            }
            System.Int32?requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxCandidate = null;
            if (cmdletContext.CompletionCriteria_MaxCandidate != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxCandidate = cmdletContext.CompletionCriteria_MaxCandidate.Value;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxCandidate != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria.MaxCandidates = requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxCandidate.Value;
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull         = false;
            }
            System.Int32?requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxRuntimePerTrainingJobInSecond = null;
            if (cmdletContext.CompletionCriteria_MaxRuntimePerTrainingJobInSecond != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxRuntimePerTrainingJobInSecond = cmdletContext.CompletionCriteria_MaxRuntimePerTrainingJobInSecond.Value;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxRuntimePerTrainingJobInSecond != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria.MaxRuntimePerTrainingJobInSeconds = requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxRuntimePerTrainingJobInSecond.Value;
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull = false;
            }
            // determine if requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria should be set to null
            if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull)
            {
                requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria = null;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria != null)
            {
                request.AutoMLJobConfig.CompletionCriteria = requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria;
                requestAutoMLJobConfigIsNull = false;
            }
            Amazon.SageMaker.Model.AutoMLSecurityConfig requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig = null;

            // populate SecurityConfig
            var requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull = true;

            requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig = new Amazon.SageMaker.Model.AutoMLSecurityConfig();
            System.Boolean?requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_EnableInterContainerTrafficEncryption = null;
            if (cmdletContext.SecurityConfig_EnableInterContainerTrafficEncryption != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_EnableInterContainerTrafficEncryption = cmdletContext.SecurityConfig_EnableInterContainerTrafficEncryption.Value;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_EnableInterContainerTrafficEncryption != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig.EnableInterContainerTrafficEncryption = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_EnableInterContainerTrafficEncryption.Value;
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull = false;
            }
            System.String requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_VolumeKmsKeyId = null;
            if (cmdletContext.SecurityConfig_VolumeKmsKeyId != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_VolumeKmsKeyId = cmdletContext.SecurityConfig_VolumeKmsKeyId;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_VolumeKmsKeyId != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig.VolumeKmsKeyId = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_VolumeKmsKeyId;
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull          = false;
            }
            Amazon.SageMaker.Model.VpcConfig requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig = null;

            // populate VpcConfig
            var requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfigIsNull = true;

            requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig = new Amazon.SageMaker.Model.VpcConfig();
            List <System.String> requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_SecurityGroupId = null;

            if (cmdletContext.VpcConfig_SecurityGroupId != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_SecurityGroupId = cmdletContext.VpcConfig_SecurityGroupId;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_SecurityGroupId != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig.SecurityGroupIds = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_SecurityGroupId;
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfigIsNull            = false;
            }
            List <System.String> requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_Subnet = null;

            if (cmdletContext.VpcConfig_Subnet != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_Subnet = cmdletContext.VpcConfig_Subnet;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_Subnet != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig.Subnets = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_Subnet;
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfigIsNull   = false;
            }
            // determine if requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig should be set to null
            if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfigIsNull)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig = null;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig != null)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig.VpcConfig = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig;
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull     = false;
            }
            // determine if requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig should be set to null
            if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull)
            {
                requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig = null;
            }
            if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig != null)
            {
                request.AutoMLJobConfig.SecurityConfig = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig;
                requestAutoMLJobConfigIsNull           = false;
            }
            // determine if request.AutoMLJobConfig should be set to null
            if (requestAutoMLJobConfigIsNull)
            {
                request.AutoMLJobConfig = null;
            }
            if (cmdletContext.AutoMLJobName != null)
            {
                request.AutoMLJobName = cmdletContext.AutoMLJobName;
            }

            // populate AutoMLJobObjective
            var requestAutoMLJobObjectiveIsNull = true;

            request.AutoMLJobObjective = new Amazon.SageMaker.Model.AutoMLJobObjective();
            Amazon.SageMaker.AutoMLMetricEnum requestAutoMLJobObjective_autoMLJobObjective_MetricName = null;
            if (cmdletContext.AutoMLJobObjective_MetricName != null)
            {
                requestAutoMLJobObjective_autoMLJobObjective_MetricName = cmdletContext.AutoMLJobObjective_MetricName;
            }
            if (requestAutoMLJobObjective_autoMLJobObjective_MetricName != null)
            {
                request.AutoMLJobObjective.MetricName = requestAutoMLJobObjective_autoMLJobObjective_MetricName;
                requestAutoMLJobObjectiveIsNull       = false;
            }
            // determine if request.AutoMLJobObjective should be set to null
            if (requestAutoMLJobObjectiveIsNull)
            {
                request.AutoMLJobObjective = null;
            }
            if (cmdletContext.GenerateCandidateDefinitionsOnly != null)
            {
                request.GenerateCandidateDefinitionsOnly = cmdletContext.GenerateCandidateDefinitionsOnly.Value;
            }
            if (cmdletContext.InputDataConfig != null)
            {
                request.InputDataConfig = cmdletContext.InputDataConfig;
            }

            // populate OutputDataConfig
            var requestOutputDataConfigIsNull = true;

            request.OutputDataConfig = new Amazon.SageMaker.Model.AutoMLOutputDataConfig();
            System.String requestOutputDataConfig_outputDataConfig_KmsKeyId = null;
            if (cmdletContext.OutputDataConfig_KmsKeyId != null)
            {
                requestOutputDataConfig_outputDataConfig_KmsKeyId = cmdletContext.OutputDataConfig_KmsKeyId;
            }
            if (requestOutputDataConfig_outputDataConfig_KmsKeyId != null)
            {
                request.OutputDataConfig.KmsKeyId = requestOutputDataConfig_outputDataConfig_KmsKeyId;
                requestOutputDataConfigIsNull     = false;
            }
            System.String requestOutputDataConfig_outputDataConfig_S3OutputPath = null;
            if (cmdletContext.OutputDataConfig_S3OutputPath != null)
            {
                requestOutputDataConfig_outputDataConfig_S3OutputPath = cmdletContext.OutputDataConfig_S3OutputPath;
            }
            if (requestOutputDataConfig_outputDataConfig_S3OutputPath != null)
            {
                request.OutputDataConfig.S3OutputPath = requestOutputDataConfig_outputDataConfig_S3OutputPath;
                requestOutputDataConfigIsNull         = false;
            }
            // determine if request.OutputDataConfig should be set to null
            if (requestOutputDataConfigIsNull)
            {
                request.OutputDataConfig = null;
            }
            if (cmdletContext.ProblemType != null)
            {
                request.ProblemType = cmdletContext.ProblemType;
            }
            if (cmdletContext.RoleArn != null)
            {
                request.RoleArn = cmdletContext.RoleArn;
            }
            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);
        }