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