Exemplo n.º 1
0
 internal PSTaskCounts(Microsoft.Azure.Batch.TaskCounts omObject)
 {
     if ((omObject == null))
     {
         throw new System.ArgumentNullException("omObject");
     }
     this.omObject = omObject;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the task counts for the job.
        /// </summary>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/>.</param>
        /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynchronous operation.</param>
        /// <remarks>The get job task counts operation runs asynchronously.</remarks>
        /// <returns>A <see cref="TaskCounts"/> object containing the task counts for the job.</returns>
        public async Task <TaskCounts> GetTaskCountsAsync(
            IEnumerable <BatchClientBehavior> additionalBehaviors = null,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            // set up behavior manager
            BehaviorManager bhMgr  = new BehaviorManager(this.CustomBehaviors, additionalBehaviors, detailLevel: null);
            TaskCounts      counts = await this.parentBatchClient.JobOperations.GetJobTaskCountsAsyncImpl(this.Id, bhMgr, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);

            return(counts);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the task counts for the job.
        /// </summary>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/>.</param>
        /// <returns>A <see cref="TaskCounts"/> object containing the task counts for the job</returns>
        /// <remarks>This is a blocking operation. For a non-blocking equivalent, see <see cref="GetTaskCountsAsync"/>.</remarks>
        public TaskCounts GetTaskCounts(IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            TaskCounts result = GetTaskCountsAsync(additionalBehaviors).WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);

            return(result);
        }