Partilhar via


ComputeBatchModelFactory.BatchJob Method

Definition

Initializes a new instance of BatchJob.

public static Azure.Compute.Batch.BatchJob BatchJob (string id = default, string displayName = default, bool? usesTaskDependencies = default, string url = default, string eTag = default, DateTimeOffset? lastModified = default, DateTimeOffset? creationTime = default, Azure.Compute.Batch.BatchJobState? state = default, DateTimeOffset? stateTransitionTime = default, Azure.Compute.Batch.BatchJobState? previousState = default, DateTimeOffset? previousStateTransitionTime = default, int? priority = default, bool? allowTaskPreemption = default, int? maxParallelTasks = default, Azure.Compute.Batch.BatchJobConstraints constraints = default, Azure.Compute.Batch.BatchJobManagerTask jobManagerTask = default, Azure.Compute.Batch.BatchJobPreparationTask jobPreparationTask = default, Azure.Compute.Batch.BatchJobReleaseTask jobReleaseTask = default, System.Collections.Generic.IEnumerable<Azure.Compute.Batch.EnvironmentSetting> commonEnvironmentSettings = default, Azure.Compute.Batch.BatchPoolInfo poolInfo = default, Azure.Compute.Batch.OnAllBatchTasksComplete? onAllTasksComplete = default, Azure.Compute.Batch.OnBatchTaskFailure? onTaskFailure = default, Azure.Compute.Batch.BatchJobNetworkConfiguration networkConfiguration = default, System.Collections.Generic.IEnumerable<Azure.Compute.Batch.MetadataItem> metadata = default, Azure.Compute.Batch.BatchJobExecutionInfo executionInfo = default, Azure.Compute.Batch.BatchJobStatistics stats = default);
static member BatchJob : string * string * Nullable<bool> * string * string * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> * Nullable<Azure.Compute.Batch.BatchJobState> * Nullable<DateTimeOffset> * Nullable<Azure.Compute.Batch.BatchJobState> * Nullable<DateTimeOffset> * Nullable<int> * Nullable<bool> * Nullable<int> * Azure.Compute.Batch.BatchJobConstraints * Azure.Compute.Batch.BatchJobManagerTask * Azure.Compute.Batch.BatchJobPreparationTask * Azure.Compute.Batch.BatchJobReleaseTask * seq<Azure.Compute.Batch.EnvironmentSetting> * Azure.Compute.Batch.BatchPoolInfo * Nullable<Azure.Compute.Batch.OnAllBatchTasksComplete> * Nullable<Azure.Compute.Batch.OnBatchTaskFailure> * Azure.Compute.Batch.BatchJobNetworkConfiguration * seq<Azure.Compute.Batch.MetadataItem> * Azure.Compute.Batch.BatchJobExecutionInfo * Azure.Compute.Batch.BatchJobStatistics -> Azure.Compute.Batch.BatchJob
Public Shared Function BatchJob (Optional id As String = Nothing, Optional displayName As String = Nothing, Optional usesTaskDependencies As Nullable(Of Boolean) = Nothing, Optional url As String = Nothing, Optional eTag As String = Nothing, Optional lastModified As Nullable(Of DateTimeOffset) = Nothing, Optional creationTime As Nullable(Of DateTimeOffset) = Nothing, Optional state As Nullable(Of BatchJobState) = Nothing, Optional stateTransitionTime As Nullable(Of DateTimeOffset) = Nothing, Optional previousState As Nullable(Of BatchJobState) = Nothing, Optional previousStateTransitionTime As Nullable(Of DateTimeOffset) = Nothing, Optional priority As Nullable(Of Integer) = Nothing, Optional allowTaskPreemption As Nullable(Of Boolean) = Nothing, Optional maxParallelTasks As Nullable(Of Integer) = Nothing, Optional constraints As BatchJobConstraints = Nothing, Optional jobManagerTask As BatchJobManagerTask = Nothing, Optional jobPreparationTask As BatchJobPreparationTask = Nothing, Optional jobReleaseTask As BatchJobReleaseTask = Nothing, Optional commonEnvironmentSettings As IEnumerable(Of EnvironmentSetting) = Nothing, Optional poolInfo As BatchPoolInfo = Nothing, Optional onAllTasksComplete As Nullable(Of OnAllBatchTasksComplete) = Nothing, Optional onTaskFailure As Nullable(Of OnBatchTaskFailure) = Nothing, Optional networkConfiguration As BatchJobNetworkConfiguration = Nothing, Optional metadata As IEnumerable(Of MetadataItem) = Nothing, Optional executionInfo As BatchJobExecutionInfo = Nothing, Optional stats As BatchJobStatistics = Nothing) As BatchJob

Parameters

id
String

A string that uniquely identifies the Job within the Account. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case).

displayName
String

The display name for the Job.

usesTaskDependencies
Nullable<Boolean>

Whether Tasks in the Job can define dependencies on each other. The default is false.

url
String

The URL of the Job.

eTag
String

The ETag of the Job. This is an opaque string. You can use it to detect whether the Job has changed between requests. In particular, you can be pass the ETag when updating a Job to specify that your changes should take effect only if nobody else has modified the Job in the meantime.

lastModified
Nullable<DateTimeOffset>

The last modified time of the Job. This is the last time at which the Job level data, such as the Job state or priority, changed. It does not factor in task-level changes such as adding new Tasks or Tasks changing state.

creationTime
Nullable<DateTimeOffset>

The creation time of the Job.

state
Nullable<BatchJobState>

The current state of the Job.

stateTransitionTime
Nullable<DateTimeOffset>

The time at which the Job entered its current state.

previousState
Nullable<BatchJobState>

The previous state of the Job. This property is not set if the Job is in its initial Active state.

previousStateTransitionTime
Nullable<DateTimeOffset>

The time at which the Job entered its previous state. This property is not set if the Job is in its initial Active state.

priority
Nullable<Int32>

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. The default value is 0.

allowTaskPreemption
Nullable<Boolean>

Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API.

maxParallelTasks
Nullable<Int32>

The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API.

constraints
BatchJobConstraints

The execution constraints for the Job.

jobManagerTask
BatchJobManagerTask

Details of a Job Manager Task to be launched when the Job is started.

jobPreparationTask
BatchJobPreparationTask

The Job Preparation Task. The Job Preparation Task is a special Task run on each Compute Node before any other Task of the Job.

jobReleaseTask
BatchJobReleaseTask

The Job Release Task. The Job Release Task is a special Task run at the end of the Job on each Compute Node that has run any other Task of the Job.

commonEnvironmentSettings
IEnumerable<EnvironmentSetting>

The list of common environment variable settings. These environment variables are set for all Tasks in the Job (including the Job Manager, Job Preparation and Job Release Tasks). Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value.

poolInfo
BatchPoolInfo

The Pool settings associated with the Job.

onAllTasksComplete
Nullable<OnAllBatchTasksComplete>

The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction.

onTaskFailure
Nullable<OnBatchTaskFailure>

The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction.

networkConfiguration
BatchJobNetworkConfiguration

The network configuration for the Job.

metadata
IEnumerable<MetadataItem>

A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code.

executionInfo
BatchJobExecutionInfo

The execution information for the Job.

stats
BatchJobStatistics

Resource usage statistics for the entire lifetime of the Job. This property is populated only if the CloudJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes.

Returns

A new BatchJob instance for mocking.

Applies to