Beispiel #1
0
        public void Verify_Default_Top()
        {
            this.Initialize();
            var getjobs_options = new ListJobOptions();

            var jobs = this.AnalyticsClient.Jobs.ListJobs(getjobs_options).ToList();

            Assert.IsTrue(jobs.Count > 2);
        }
Beispiel #2
0
        public void Verify_Paging_300()
        {
            this.Initialize();
            var getjobs_options = new ListJobOptions();

            getjobs_options.Top = JobCommands.ADLJobPageSize;

            var jobs = this.AnalyticsClient.Jobs.ListJobs(getjobs_options).ToList();

            Assert.AreEqual(JobCommands.ADLJobPageSize, jobs.Count);
        }
Beispiel #3
0
        public void Verify_Paging_1()
        {
            this.Initialize();
            var getjobs_options = new ListJobOptions();

            getjobs_options.Top = 100;

            var jobs = this.AnalyticsClient.Jobs.ListJobs(getjobs_options).ToList();

            Assert.AreEqual(100, jobs.Count);
        }
Beispiel #4
0
        public override void ExecuteCmdlet()
        {
            ListJobOptions options = new ListJobOptions(this.BatchContext, this.WorkItemName, this.WorkItem, this.AdditionalBehaviors)
            {
                JobName  = this.Name,
                Filter   = this.Filter,
                MaxCount = this.MaxCount
            };

            // The enumerator will internally query the service in chunks. Using WriteObject with the enumerate flag will enumerate
            // the entire collection first and then write the items out one by one in a single group.  Using foreach, we can take
            // advantage of the enumerator's behavior and write output to the pipeline in bursts.
            foreach (PSCloudJob job in BatchClient.ListJobs(options))
            {
                WriteObject(job);
            }
        }
Beispiel #5
0
        public void List_Jobs_Running()
        {
            this.Initialize();
            var getjobs_options = new ListJobOptions();

            getjobs_options.Top = 30;
            getjobs_options.Filter.State.IsOneOf(JobState.Running);

            var jobs = this.AnalyticsClient.Jobs.ListJobs(getjobs_options).ToList();

            if (jobs.Count > 0)
            {
                foreach (var job in jobs)
                {
                    Assert.AreEqual(JobState.Running, job.State);
                }
            }
        }
Beispiel #6
0
        public void List_Jobs()
        {
            this.Initialize();

            var jobfields = new JobFields();

            var getjobs_options = new ListJobOptions();

            getjobs_options.Top               = 30;
            getjobs_options.Sorting.Field     = jobfields.DegreeOfParallelism;
            getjobs_options.Sorting.Direction = AdlClient.OData.Enums.OrderByDirection.Descending;

            var jobs = this.AnalyticsClient.Jobs.ListJobs(getjobs_options).ToList();

            foreach (var job in jobs)
            {
                System.Console.WriteLine("submitter{0} dop {1}", job.Submitter, job.DegreeOfParallelism);
            }
        }
Beispiel #7
0
        public void List_Jobs_Ended_Failed()
        {
            this.Initialize();
            var getjobs_options = new ListJobOptions();

            getjobs_options.Top = 30;
            getjobs_options.Filter.State.IsOneOf(JobState.Ended);
            getjobs_options.Filter.Result.IsOneOf(JobResult.Failed);

            var jobs = this.AnalyticsClient.Jobs.ListJobs(getjobs_options).ToList();

            if (jobs.Count > 0)
            {
                foreach (var job in jobs)
                {
                    Assert.AreEqual(JobState.Ended, job.State);
                    Assert.AreEqual(JobResult.Failed, job.Result);
                }
            }
        }
        protected override void ProcessRecord()
        {
            ListJobOptions options = new ListJobOptions(this.BatchContext, this.AdditionalBehaviors)
            {
                JobId         = this.Id,
                JobScheduleId = this.JobScheduleId,
                JobSchedule   = this.JobSchedule,
                Filter        = this.Filter,
                Select        = this.Select,
                Expand        = this.Expand,
                MaxCount      = this.MaxCount
            };

            // The enumerator will internally query the service in chunks. Using WriteObject with the enumerate flag will enumerate
            // the entire collection first and then write the items out one by one in a single group.  Using foreach, we can take
            // advantage of the enumerator's behavior and write output to the pipeline in bursts.
            foreach (PSCloudJob job in BatchClient.ListJobs(options))
            {
                WriteObject(job);
            }
        }