Share via


CloudJob Class

Definition

An Azure Batch job.

public class CloudJob : Microsoft.Azure.Batch.IInheritedBehaviors, Microsoft.Azure.Batch.IRefreshable
type CloudJob = class
    interface IRefreshable
    interface IInheritedBehaviors
Public Class CloudJob
Implements IInheritedBehaviors, IRefreshable
Inheritance
CloudJob
Implements

Constructors

CloudJob()

Default constructor to support mocking the CloudJob class.

Properties

AllowTaskPreemption

Gets or sets whether Tasks in this job can be preempted by other high priority jobs.

CommonEnvironmentSettings

Gets or sets a list of common environment variable settings. These environment variables are set for all tasks in this CloudJob (including the Job Manager, Job Preparation and Job Release tasks).

Constraints

Gets or sets the execution constraints for the job.

CreationTime

Gets the creation time of the job.

CustomBehaviors

Gets or sets a list of behaviors that modify or customize requests to the Batch service made via this CloudJob.

DisplayName

Gets or sets the display name of the job.

ETag

Gets the ETag for the job.

ExecutionInformation

Gets the execution information for the job.

Id

Gets or sets the id of the job.

JobManagerTask

Gets or sets the Job Manager task. The Job Manager task is launched when the CloudJob is started.

JobPreparationTask

Gets or sets the Job Preparation task. The Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.

JobReleaseTask

Gets or sets the Job Release Task runs when the Job ends, because of one of the following: The user calls the Terminate Job API, or the Delete Job API while the Job is still active, the Job's maximum wall clock time constraint is reached, and the Job is still active, or the Job's Job Manager Task completed, and the Job is configured to terminate when the Job Manager completes. The Job Release Task runs on each Node where Tasks of the Job have run and the Job Preparation Task ran and completed. If you reimage a Node after it has run the Job Preparation Task, and the Job ends without any further Tasks of the Job running on that Node (and hence the Job Preparation Task does not re-run), then the Job Release Task does not run on that Compute Node. If a Node reboots while the Job Release Task is still running, the Job Release Task runs again when the Compute Node starts up. The Job is not marked as complete until all Job Release Tasks have completed. The Job Release Task runs in the background. It does not occupy a scheduling slot; that is, it does not count towards the taskSlotsPerNode limit specified on the Pool.

LastModified

Gets the last modified time of the job.

MaxParallelTasks

Gets or sets the maximum number of tasks that can be executed in parallel for the job.

Metadata

Gets or sets a list of name-value pairs associated with the job as metadata.

NetworkConfiguration

Gets or sets the network configuration for the job.

OnAllTasksComplete

Gets or sets the action the Batch service should take when all tasks in the job are in the Completed state.

OnTaskFailure

Gets or sets the action the Batch service should take when any task in the job fails.

PoolInformation

Gets or sets the pool on which the Batch service runs the job's tasks.

PreviousState

Gets the previous state of the job.

PreviousStateTransitionTime

Gets the time at which the job entered its previous state.

Priority

Gets or sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority.

State

Gets the current state of the job.

StateTransitionTime

Gets the time at which the job entered its current state.

Statistics

Gets resource usage statistics for the entire lifetime of the job.

Url

Gets the URL of the job.

UsesTaskDependencies

Gets or sets whether tasks in the job can define dependencies on each other.

Methods

AddTask(CloudTask, IEnumerable<BatchClientBehavior>)

Adds a single task to this CloudJob. To add multiple tasks, use JobOperations.AddTaskAsync.

AddTask(IEnumerable<CloudTask>, BatchClientParallelOptions, ConcurrentBag<ConcurrentDictionary<Type, IFileStagingArtifact>>, Nullable<TimeSpan>, IEnumerable<BatchClientBehavior>)

Adds tasks to a job.

AddTaskAsync(CloudTask, ConcurrentDictionary<Type,IFileStagingArtifact>, IEnumerable<BatchClientBehavior>, CancellationToken)

Adds a single task to this CloudJob. To add multiple tasks, use JobOperations.AddTaskAsync.

AddTaskAsync(IEnumerable<CloudTask>, BatchClientParallelOptions, ConcurrentBag<ConcurrentDictionary<Type,IFileStagingArtifact>>, Nullable<TimeSpan>, IEnumerable<BatchClientBehavior>)

Adds tasks to a job.

Commit(IEnumerable<BatchClientBehavior>)

Commits this CloudJob to the Azure Batch service.

CommitAsync(IEnumerable<BatchClientBehavior>, CancellationToken)

Commits this CloudJob to the Azure Batch service.

CommitChanges(IEnumerable<BatchClientBehavior>)

Commits all pending changes to this CloudJob to the Azure Batch service.

CommitChangesAsync(IEnumerable<BatchClientBehavior>, CancellationToken)

Commits all pending changes to this CloudJob to the Azure Batch service.

Delete(IEnumerable<BatchClientBehavior>)

Deletes this CloudJob.

DeleteAsync(IEnumerable<BatchClientBehavior>, CancellationToken)

Deletes this CloudJob.

Disable(DisableJobOption, IEnumerable<BatchClientBehavior>)

Disables this CloudJob. Disabled jobs do not run new tasks, but may be re-enabled later.

DisableAsync(DisableJobOption, IEnumerable<BatchClientBehavior>, CancellationToken)

Disables this CloudJob. Disabled jobs do not run new tasks, but may be re-enabled later.

Enable(IEnumerable<BatchClientBehavior>)

Enables this CloudJob, allowing new tasks to run.

EnableAsync(IEnumerable<BatchClientBehavior>, CancellationToken)

Enables this CloudJob, allowing new tasks to run.

GetTask(String, DetailLevel, IEnumerable<BatchClientBehavior>)

Gets the specified CloudTask.

GetTaskAsync(String, DetailLevel, IEnumerable<BatchClientBehavior>, CancellationToken)

Gets the specified CloudTask.

GetTaskCounts(IEnumerable<BatchClientBehavior>)

Gets the Task counts for the specified Job. Task counts provide a count of the Tasks by active, running or completed Task state, and a count of Tasks which succeeded or failed.Tasks in the preparing state are counted as running.Note that the numbers returned may not always be up to date. If you need exact task counts, use a list query.

GetTaskCountsAsync(IEnumerable<BatchClientBehavior>, CancellationToken)

Gets the Task counts for the specified Job. Task counts provide a count of the Tasks by active, running or completed Task state, and a count of Tasks which succeeded or failed.Tasks in the preparing state are counted as running.Note that the numbers returned may not always be up to date. If you need exact task counts, use a list query.

ListTasks(DetailLevel, IEnumerable<BatchClientBehavior>)

Enumerates the tasks of this CloudJob.

Refresh(DetailLevel, IEnumerable<BatchClientBehavior>)

Refreshes the current CloudJob.

RefreshAsync(DetailLevel, IEnumerable<BatchClientBehavior>, CancellationToken)

Refreshes the current CloudJob.

Terminate(String, IEnumerable<BatchClientBehavior>)

Terminates this CloudJob, marking it as completed.

TerminateAsync(String, IEnumerable<BatchClientBehavior>, CancellationToken)

Terminates this CloudJob, marking it as completed.

Extension Methods

GetOutputStorageContainerUrl(CloudJob, BlobServiceClient, TimeSpan)

Gets the URL, including a Shared Access Signature (SAS) that permits writing, for the job's output storage container in Azure blob storage. This URL is suitable for passing to tasks so they can use the JobOutputStorage(Uri) or TaskOutputStorage(Uri, String) constructors that take a Uri.

GetOutputStorageContainerUrl(CloudJob, BlobServiceClient)

Gets the URL, including a Shared Access Signature (SAS) that permits writing, for the job's output storage container in Azure blob storage. This URL is suitable for passing to tasks so they can use the JobOutputStorage(Uri) or TaskOutputStorage(Uri, String) constructors that take a Uri.

GetOutputStoragePath(CloudJob, JobOutputKind)

Gets the Blob name prefix/folder where files of the given kind are stored

OutputStorage(CloudJob, BlobServiceClient)

Gets the JobOutputStorage for a specified CloudJob.

OutputStorageContainerName(CloudJob)

Gets the name of the Azure blob storage container for the outputs of a CloudJob.

PrepareOutputStorageAsync(CloudJob, BlobServiceClient, CancellationToken)

Creates an Azure blob storage container for the outputs of a CloudJob.

Applies to