예제 #1
0
 private Amazon.SageMaker.Model.UpdateTrainingJobResponse CallAWSServiceOperation(IAmazonSageMaker client, Amazon.SageMaker.Model.UpdateTrainingJobRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Service", "UpdateTrainingJob");
     try
     {
         #if DESKTOP
         return(client.UpdateTrainingJob(request));
         #elif CORECLR
         return(client.UpdateTrainingJobAsync(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.UpdateTrainingJobRequest();


            // populate ProfilerConfig
            var requestProfilerConfigIsNull = true;

            request.ProfilerConfig = new Amazon.SageMaker.Model.ProfilerConfigForUpdate();
            System.Boolean?requestProfilerConfig_profilerConfig_DisableProfiler = null;
            if (cmdletContext.ProfilerConfig_DisableProfiler != null)
            {
                requestProfilerConfig_profilerConfig_DisableProfiler = cmdletContext.ProfilerConfig_DisableProfiler.Value;
            }
            if (requestProfilerConfig_profilerConfig_DisableProfiler != null)
            {
                request.ProfilerConfig.DisableProfiler = requestProfilerConfig_profilerConfig_DisableProfiler.Value;
                requestProfilerConfigIsNull            = false;
            }
            System.Int64?requestProfilerConfig_profilerConfig_ProfilingIntervalInMillisecond = null;
            if (cmdletContext.ProfilerConfig_ProfilingIntervalInMillisecond != null)
            {
                requestProfilerConfig_profilerConfig_ProfilingIntervalInMillisecond = cmdletContext.ProfilerConfig_ProfilingIntervalInMillisecond.Value;
            }
            if (requestProfilerConfig_profilerConfig_ProfilingIntervalInMillisecond != null)
            {
                request.ProfilerConfig.ProfilingIntervalInMilliseconds = requestProfilerConfig_profilerConfig_ProfilingIntervalInMillisecond.Value;
                requestProfilerConfigIsNull = false;
            }
            Dictionary <System.String, System.String> requestProfilerConfig_profilerConfig_ProfilingParameter = null;

            if (cmdletContext.ProfilerConfig_ProfilingParameter != null)
            {
                requestProfilerConfig_profilerConfig_ProfilingParameter = cmdletContext.ProfilerConfig_ProfilingParameter;
            }
            if (requestProfilerConfig_profilerConfig_ProfilingParameter != null)
            {
                request.ProfilerConfig.ProfilingParameters = requestProfilerConfig_profilerConfig_ProfilingParameter;
                requestProfilerConfigIsNull = false;
            }
            System.String requestProfilerConfig_profilerConfig_S3OutputPath = null;
            if (cmdletContext.ProfilerConfig_S3OutputPath != null)
            {
                requestProfilerConfig_profilerConfig_S3OutputPath = cmdletContext.ProfilerConfig_S3OutputPath;
            }
            if (requestProfilerConfig_profilerConfig_S3OutputPath != null)
            {
                request.ProfilerConfig.S3OutputPath = requestProfilerConfig_profilerConfig_S3OutputPath;
                requestProfilerConfigIsNull         = false;
            }
            // determine if request.ProfilerConfig should be set to null
            if (requestProfilerConfigIsNull)
            {
                request.ProfilerConfig = null;
            }
            if (cmdletContext.ProfilerRuleConfiguration != null)
            {
                request.ProfilerRuleConfigurations = cmdletContext.ProfilerRuleConfiguration;
            }
            if (cmdletContext.TrainingJobName != null)
            {
                request.TrainingJobName = cmdletContext.TrainingJobName;
            }

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