Package com.azure.compute.batch.models
Class BatchJobCreateContent
java.lang.Object
com.azure.compute.batch.models.BatchJobCreateContent
- All Implemented Interfaces:
com.azure.json.JsonSerializable<BatchJobCreateContent>
public final class BatchJobCreateContent
extends Object
implements com.azure.json.JsonSerializable<BatchJobCreateContent>
Parameters for creating an Azure Batch Job.
-
Constructor Summary
ConstructorsConstructorDescriptionBatchJobCreateContent
(String id, BatchPoolInfo poolInfo) Creates an instance of BatchJobCreateContent class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BatchJobCreateContent
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of BatchJobCreateContent from the JsonReader.Get the commonEnvironmentSettings property: The list of common environment variable settings.Get the constraints property: The execution constraints for the Job.Get the displayName property: The display name for the Job.getId()
Get the id property: A string that uniquely identifies the Job within the Account.Get the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started.Get the jobPreparationTask property: The Job Preparation Task.Get the jobReleaseTask property: The Job Release Task.Get the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job.Get the metadata property: A list of name-value pairs associated with the Job as metadata.Get the networkConfiguration property: The network configuration for the Job.Get the onAllTasksComplete property: The action the Batch service should take when all Tasks in the Job are in the completed state.Get the onTaskFailure property: The action the Batch service should take when any Task in the Job fails.Get the poolInfo property: The Pool on which the Batch service runs the Job's Tasks.Get the priority property: The priority of the Job.Get the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs.Get the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other.setAllowTaskPreemption
(Boolean allowTaskPreemption) Set the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs.setCommonEnvironmentSettings
(List<EnvironmentSetting> commonEnvironmentSettings) Set the commonEnvironmentSettings property: The list of common environment variable settings.setConstraints
(BatchJobConstraints constraints) Set the constraints property: The execution constraints for the Job.setDisplayName
(String displayName) Set the displayName property: The display name for the Job.setJobManagerTask
(BatchJobManagerTask jobManagerTask) Set the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started.setJobPreparationTask
(BatchJobPreparationTask jobPreparationTask) Set the jobPreparationTask property: The Job Preparation Task.setJobReleaseTask
(BatchJobReleaseTask jobReleaseTask) Set the jobReleaseTask property: The Job Release Task.setMaxParallelTasks
(Integer maxParallelTasks) Set the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job.setMetadata
(List<MetadataItem> metadata) Set the metadata property: A list of name-value pairs associated with the Job as metadata.setNetworkConfiguration
(BatchJobNetworkConfiguration networkConfiguration) Set the networkConfiguration property: The network configuration for the Job.setOnAllTasksComplete
(OnAllBatchTasksComplete onAllTasksComplete) Set the onAllTasksComplete property: The action the Batch service should take when all Tasks in the Job are in the completed state.setOnTaskFailure
(OnBatchTaskFailure onTaskFailure) Set the onTaskFailure property: The action the Batch service should take when any Task in the Job fails.setPriority
(Integer priority) Set the priority property: The priority of the Job.setUsesTaskDependencies
(Boolean usesTaskDependencies) Set the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
BatchJobCreateContent
Creates an instance of BatchJobCreateContent class.- Parameters:
id
- the id value to set.poolInfo
- the poolInfo value to set.
-
-
Method Details
-
getId
Get the id property: A string that uniquely identifies the Job within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case).- Returns:
- the id value.
-
getDisplayName
Get the displayName property: The display name for the Job. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.- Returns:
- the displayName value.
-
setDisplayName
Set the displayName property: The display name for the Job. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.- Parameters:
displayName
- the displayName value to set.- Returns:
- the BatchJobCreateContent object itself.
-
isUsesTaskDependencies
Get the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other. The default is false.- Returns:
- the usesTaskDependencies value.
-
setUsesTaskDependencies
Set the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other. The default is false.- Parameters:
usesTaskDependencies
- the usesTaskDependencies value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getPriority
Get the priority property: 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.- Returns:
- the priority value.
-
setPriority
Set the priority property: 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.- Parameters:
priority
- the priority value to set.- Returns:
- the BatchJobCreateContent object itself.
-
isAllowTaskPreemption
Get the allowTaskPreemption property: 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.- Returns:
- the allowTaskPreemption value.
-
setAllowTaskPreemption
Set the allowTaskPreemption property: 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.- Parameters:
allowTaskPreemption
- the allowTaskPreemption value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getMaxParallelTasks
Get the maxParallelTasks property: 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.- Returns:
- the maxParallelTasks value.
-
setMaxParallelTasks
Set the maxParallelTasks property: 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.- Parameters:
maxParallelTasks
- the maxParallelTasks value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getConstraints
Get the constraints property: The execution constraints for the Job.- Returns:
- the constraints value.
-
setConstraints
Set the constraints property: The execution constraints for the Job.- Parameters:
constraints
- the constraints value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getJobManagerTask
Get the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started. If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. The Job Manager Task's typical purpose is to control and/or monitor Job execution, for example by deciding what additional Tasks to run, determining when the work is complete, etc. (However, a Job Manager Task is not restricted to these activities - it is a fully-fledged Task in the system and perform whatever actions are required for the Job.) For example, a Job Manager Task might download a file specified as a parameter, analyze the contents of that file and submit additional Tasks based on those contents.- Returns:
- the jobManagerTask value.
-
setJobManagerTask
Set the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started. If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. The Job Manager Task's typical purpose is to control and/or monitor Job execution, for example by deciding what additional Tasks to run, determining when the work is complete, etc. (However, a Job Manager Task is not restricted to these activities - it is a fully-fledged Task in the system and perform whatever actions are required for the Job.) For example, a Job Manager Task might download a file specified as a parameter, analyze the contents of that file and submit additional Tasks based on those contents.- Parameters:
jobManagerTask
- the jobManagerTask value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getJobPreparationTask
Get the jobPreparationTask property: The Job Preparation Task. If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node.- Returns:
- the jobPreparationTask value.
-
setJobPreparationTask
Set the jobPreparationTask property: The Job Preparation Task. If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node.- Parameters:
jobPreparationTask
- the jobPreparationTask value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getJobReleaseTask
Get the jobReleaseTask property: The Job Release Task. A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Nodes that have run the Job Preparation Task. The primary purpose of the Job Release Task is to undo changes to Compute Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation.- Returns:
- the jobReleaseTask value.
-
setJobReleaseTask
Set the jobReleaseTask property: The Job Release Task. A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Nodes that have run the Job Preparation Task. The primary purpose of the Job Release Task is to undo changes to Compute Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation.- Parameters:
jobReleaseTask
- the jobReleaseTask value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getCommonEnvironmentSettings
Get the commonEnvironmentSettings property: 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.- Returns:
- the commonEnvironmentSettings value.
-
setCommonEnvironmentSettings
public BatchJobCreateContent setCommonEnvironmentSettings(List<EnvironmentSetting> commonEnvironmentSettings) Set the commonEnvironmentSettings property: 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.- Parameters:
commonEnvironmentSettings
- the commonEnvironmentSettings value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getPoolInfo
Get the poolInfo property: The Pool on which the Batch service runs the Job's Tasks.- Returns:
- the poolInfo value.
-
getOnAllTasksComplete
Get the onAllTasksComplete property: The action the Batch service should take when all Tasks in the Job are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction.- Returns:
- the onAllTasksComplete value.
-
setOnAllTasksComplete
Set the onAllTasksComplete property: The action the Batch service should take when all Tasks in the Job are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction.- Parameters:
onAllTasksComplete
- the onAllTasksComplete value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getOnTaskFailure
Get the onTaskFailure property: 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.- Returns:
- the onTaskFailure value.
-
setOnTaskFailure
Set the onTaskFailure property: 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.- Parameters:
onTaskFailure
- the onTaskFailure value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getNetworkConfiguration
Get the networkConfiguration property: The network configuration for the Job.- Returns:
- the networkConfiguration value.
-
setNetworkConfiguration
public BatchJobCreateContent setNetworkConfiguration(BatchJobNetworkConfiguration networkConfiguration) Set the networkConfiguration property: The network configuration for the Job.- Parameters:
networkConfiguration
- the networkConfiguration value to set.- Returns:
- the BatchJobCreateContent object itself.
-
getMetadata
Get the metadata property: 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.- Returns:
- the metadata value.
-
setMetadata
Set the metadata property: 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.- Parameters:
metadata
- the metadata value to set.- Returns:
- the BatchJobCreateContent object itself.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<BatchJobCreateContent>
- Throws:
IOException
-
fromJson
public static BatchJobCreateContent fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of BatchJobCreateContent from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of BatchJobCreateContent if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the BatchJobCreateContent.
-