예제 #1
0
        public override void ExecuteCmdlet()
        {
            string rawJsonContent = StreamAnalyticsClient.ReadJsonFileContent(this.TryResolvePath(File));

            Name = ResolveResourceName(rawJsonContent, Name, "Job");

            if (Name != null && string.IsNullOrWhiteSpace(Name))
            {
                throw new ArgumentException(Resources.JobNameCannotBeEmpty);
            }

            CreatePSJobParameter parameter = new CreatePSJobParameter
            {
                ResourceGroupName = ResourceGroupName,
                JobName           = Name,
                RawJsonContent    = rawJsonContent,
                Force             = Force.IsPresent,
                ConfirmAction     = ConfirmAction
            };

            var result = StreamAnalyticsClient.CreatePSJob(parameter);

            if (result != null)
            {
                WriteObject(result);
            }
        }
예제 #2
0
        public override void ExecuteCmdlet()
        {
            string rawJsonContent = StreamAnalyticsClient.ReadJsonFileContent(this.TryResolvePath(File));

            Name = ResolveResourceName(rawJsonContent, Name, "Job");

            CreatePSJobParameter parameter = new CreatePSJobParameter
            {
                ResourceGroupName = ResourceGroupName,
                JobName           = Name,
                RawJsonContent    = rawJsonContent,
                Force             = Force.IsPresent,
                ConfirmAction     = ConfirmAction
            };

            WriteObject(StreamAnalyticsClient.CreatePSJob(parameter));
        }