Beispiel #1
0
        /// <summary>
        /// Creates a test job for use in Scenario tests.
        /// </summary>
        public static void CreateTestJob(BatchController controller, BatchAccountContext context, string jobId, string poolId = SharedPool)
        {
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            PSPoolInformation poolInfo = new PSPoolInformation();

            poolInfo.PoolId = poolId;

            NewJobParameters parameters = new NewJobParameters(context, jobId)
            {
                PoolInformation = poolInfo
            };

            client.CreateJob(parameters);
        }
Beispiel #2
0
        public override void ExecuteCmdlet()
        {
            NewJobParameters parameters = new NewJobParameters(this.BatchContext, this.Id, this.AdditionalBehaviors)
            {
                CommonEnvironmentSettings = this.CommonEnvironmentSettings,
                DisplayName        = this.DisplayName,
                Constraints        = this.Constraints,
                JobManagerTask     = this.JobManagerTask,
                JobPreparationTask = this.JobPreparationTask,
                JobReleaseTask     = this.JobReleaseTask,
                Metadata           = this.Metadata,
                PoolInformation    = this.PoolInformation,
                Priority           = this.Priority
            };

            BatchClient.CreateJob(parameters);
        }
Beispiel #3
0
        /// <summary>
        /// Creates a test job for use in Scenario tests.
        /// </summary>
        public static void CreateTestJob(BatchController controller, BatchAccountContext context, string jobId)
        {
            RequestInterceptor interceptor = CreateHttpRecordingInterceptor();

            BatchClientBehavior[] behaviors = new BatchClientBehavior[] { interceptor };
            BatchClient           client    = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            PSPoolInformation poolInfo = new PSPoolInformation();

            poolInfo.PoolId = SharedPool;

            NewJobParameters parameters = new NewJobParameters(context, jobId, behaviors)
            {
                PoolInformation = poolInfo
            };

            client.CreateJob(parameters);
        }
Beispiel #4
0
        protected override void ExecuteCmdletImpl()
        {
            NewJobParameters parameters = new NewJobParameters(this.BatchContext, this.Id, this.AdditionalBehaviors)
            {
                CommonEnvironmentSettings = this.CommonEnvironmentSettings,
                DisplayName          = this.DisplayName,
                Constraints          = this.Constraints,
                JobManagerTask       = this.JobManagerTask,
                JobPreparationTask   = this.JobPreparationTask,
                JobReleaseTask       = this.JobReleaseTask,
                Metadata             = this.Metadata,
                PoolInformation      = this.PoolInformation,
                Priority             = this.Priority,
                UsesTaskDependencies = this.UsesTaskDependencies.IsPresent,
                OnAllTasksComplete   = this.OnAllTasksComplete,
                OnTaskFailure        = this.OnTaskFailure,
            };

            BatchClient.CreateJob(parameters);
        }