Inheritance: Microsoft.Azure.Commands.StreamAnalytics.Models.JobParametersBase
コード例 #1
0
        public virtual HttpStatusCode StartPSJob(StartPSJobParameter parameter)
        {
            if (parameter == null)
            {
                throw new ArgumentNullException("parameter");
            }

            return(StartPSJob(parameter.ResourceGroupName, parameter.JobName, parameter.StartParameters));
        }
コード例 #2
0
        public virtual void StartPSJob(StartPSJobParameter parameter)
        {
            if (parameter == null)
            {
                throw new ArgumentNullException("parameter");
            }

            StartPSJob(parameter.ResourceGroupName, parameter.JobName, parameter.StartParameters);
        }
        protected override void ProcessRecord()
        {
            if (ResourceGroupName != null && string.IsNullOrWhiteSpace(ResourceGroupName))
            {
                throw new PSArgumentNullException("ResourceGroupName");
            }

            StartPSJobParameter parameter = new StartPSJobParameter()
                {
                    ResourceGroupName = ResourceGroupName,
                    JobName = Name,
                    StartParameters = new JobStartParameters()
                    {
                        OutputStartMode = OutputStartMode,
                        OutputStartTime = OutputStartTime
                    }
                };

            try
            {
                HttpStatusCode statusCode = StreamAnalyticsClient.StartPSJob(parameter);
                if (statusCode == HttpStatusCode.OK)
                {
                    WriteObject(true);
                }
                else if (statusCode == HttpStatusCode.NoContent)
                {
                    WriteWarning(string.Format(CultureInfo.InvariantCulture, Resources.JobNotFound, Name, ResourceGroupName));
                }
                else 
                {
                    WriteObject(false);
                }
            }
            catch
            {
                WriteObject(false);
            }
        }
コード例 #4
0
        public virtual HttpStatusCode StartPSJob(StartPSJobParameter parameter)
        {
            if (parameter == null)
            {
                throw new ArgumentNullException("parameter");
            }

            return StartPSJob(parameter.ResourceGroupName, parameter.JobName, parameter.StartParameters);
        }