Package com.microsoft.azure.batch
Class JobOperations
- java.lang.Object
-
- com.microsoft.azure.batch.JobOperations
-
- All Implemented Interfaces:
IInheritedBehaviors
public class JobOperations extends Object implements IInheritedBehaviors
Performs job-related operations on an Azure Batch account.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createJob(JobAddParameter job)
Adds a job to the Batch account.void
createJob(JobAddParameter job, Iterable<BatchClientBehavior> additionalBehaviors)
Adds a job to the Batch account.void
createJob(String jobId, PoolInformation poolInfo)
Adds a job to the Batch account.void
createJob(String jobId, PoolInformation poolInfo, Iterable<BatchClientBehavior> additionalBehaviors)
Adds a job to the Batch account.Collection<BatchClientBehavior>
customBehaviors()
Gets a collection of behaviors that modify or customize requests to the Batch service.void
deleteJob(String jobId)
Deletes the specified job.void
deleteJob(String jobId, Iterable<BatchClientBehavior> additionalBehaviors)
Deletes the specified job.void
disableJob(String jobId, DisableJobOption disableJobOption)
Disables the specified job.void
disableJob(String jobId, DisableJobOption disableJobOption, Iterable<BatchClientBehavior> additionalBehaviors)
Disables the specified job.void
enableJob(String jobId)
Enables the specified job, allowing new tasks to run.void
enableJob(String jobId, Iterable<BatchClientBehavior> additionalBehaviors)
Enables the specified job, allowing new tasks to run.CloudJob
getJob(String jobId)
Gets the specifiedCloudJob
.CloudJob
getJob(String jobId, DetailLevel detailLevel)
Gets the specifiedCloudJob
.CloudJob
getJob(String jobId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Gets the specifiedCloudJob
.TaskCounts
getTaskCounts(String jobId)
Gets the task counts for the specified job.TaskCounts
getTaskCounts(String jobId, Iterable<BatchClientBehavior> additionalBehaviors)
Gets the task counts for the specified job.TaskCountsResult
getTaskCountsResult(String jobId)
Gets the task counts result for the specified job.TaskCountsResult
getTaskCountsResult(String jobId, Iterable<BatchClientBehavior> additionalBehaviors)
Gets the task counts result for the specified job.TaskSlotCounts
getTaskSlotCounts(String jobId)
Gets the task slot counts for the specified job.TaskSlotCounts
getTaskSlotCounts(String jobId, Iterable<BatchClientBehavior> additionalBehaviors)
Gets the task slot counts for the specified job.com.microsoft.azure.PagedList<CloudJob>
listJobs()
Lists thejobs
in the Batch account.com.microsoft.azure.PagedList<CloudJob>
listJobs(DetailLevel detailLevel)
Lists thejobs
in the Batch account.com.microsoft.azure.PagedList<CloudJob>
listJobs(DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Lists thejobs
in the Batch account.com.microsoft.azure.PagedList<CloudJob>
listJobs(String jobScheduleId)
Lists thejobs
created under the specified job schedule.com.microsoft.azure.PagedList<CloudJob>
listJobs(String jobScheduleId, DetailLevel detailLevel)
Lists thejobs
created under the specified job schedule.com.microsoft.azure.PagedList<CloudJob>
listJobs(String jobScheduleId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Lists thejobs
created under the specified jobSchedule.com.microsoft.azure.PagedList<JobPreparationAndReleaseTaskExecutionInformation>
listPreparationAndReleaseTaskStatus(String jobId)
Lists the status ofJobPreparationTask
andJobReleaseTask
tasks for the specified job.com.microsoft.azure.PagedList<JobPreparationAndReleaseTaskExecutionInformation>
listPreparationAndReleaseTaskStatus(String jobId, Iterable<BatchClientBehavior> additionalBehaviors)
Lists the status ofJobPreparationTask
andJobReleaseTask
tasks for the specified job.void
patchJob(String jobId, JobPatchParameter jobPatchParameter)
Updates the specified job.void
patchJob(String jobId, JobPatchParameter jobPatchParameter, Iterable<BatchClientBehavior> additionalBehaviors)
Updates the specified job.void
patchJob(String jobId, OnAllTasksComplete onAllTasksComplete)
Updates the specified job.void
patchJob(String jobId, PoolInformation poolInfo)
Updates the specified job.void
patchJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata)
Updates the specified job.void
patchJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata, Iterable<BatchClientBehavior> additionalBehaviors)
Updates the specified job.void
terminateJob(String jobId)
Terminates the specified job, marking it as completed.void
terminateJob(String jobId, String terminateReason)
Terminates the specified job, marking it as completed.void
terminateJob(String jobId, String terminateReason, Iterable<BatchClientBehavior> additionalBehaviors)
Terminates the specified job, marking it as completed.void
updateJob(String jobId, JobUpdateParameter param)
void
updateJob(String jobId, JobUpdateParameter param, Iterable<BatchClientBehavior> additionalBehaviors)
Updates the specified job This method performs a full replace of all updatable properties of the job.void
updateJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata)
Updates the specified job.void
updateJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata, Iterable<BatchClientBehavior> additionalBehaviors)
Updates the specified job.IInheritedBehaviors
withCustomBehaviors(Collection<BatchClientBehavior> behaviors)
Sets a collection of behaviors that modify or customize requests to the Batch service.
-
-
-
Method Detail
-
customBehaviors
public Collection<BatchClientBehavior> customBehaviors()
Gets a collection of behaviors that modify or customize requests to the Batch service.- Specified by:
customBehaviors
in interfaceIInheritedBehaviors
- Returns:
- A collection of
BatchClientBehavior
instances.
-
withCustomBehaviors
public IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> behaviors)
Sets a collection of behaviors that modify or customize requests to the Batch service.- Specified by:
withCustomBehaviors
in interfaceIInheritedBehaviors
- Parameters:
behaviors
- The collection ofBatchClientBehavior
instances.- Returns:
- The current instance.
-
getJob
public CloudJob getJob(String jobId) throws BatchErrorException, IOException
Gets the specifiedCloudJob
.- Parameters:
jobId
- The ID of the job to get.- Returns:
- A
CloudJob
containing information about the specified Azure Batch job. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getJob
public CloudJob getJob(String jobId, DetailLevel detailLevel) throws BatchErrorException, IOException
Gets the specifiedCloudJob
.- Parameters:
jobId
- The ID of the job to get.detailLevel
- ADetailLevel
used for controlling which properties are retrieved from the service.- Returns:
- A
CloudJob
containing information about the specified Azure Batch job. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getJob
public CloudJob getJob(String jobId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Gets the specifiedCloudJob
.- Parameters:
jobId
- The ID of the job to get.detailLevel
- ADetailLevel
used for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- A
CloudJob
containing information about the specified Azure Batch job. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listJobs
public com.microsoft.azure.PagedList<CloudJob> listJobs() throws BatchErrorException, IOException
Lists thejobs
in the Batch account.- Returns:
- A list of
CloudJob
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listJobs
public com.microsoft.azure.PagedList<CloudJob> listJobs(DetailLevel detailLevel) throws BatchErrorException, IOException
Lists thejobs
in the Batch account.- Parameters:
detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.- Returns:
- A list of
CloudJob
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listJobs
public com.microsoft.azure.PagedList<CloudJob> listJobs(DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Lists thejobs
in the Batch account.- Parameters:
detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- A list of
CloudJob
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listJobs
public com.microsoft.azure.PagedList<CloudJob> listJobs(String jobScheduleId) throws BatchErrorException, IOException
Lists thejobs
created under the specified job schedule.- Parameters:
jobScheduleId
- The ID of job schedule.- Returns:
- A list of
CloudJob
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listJobs
public com.microsoft.azure.PagedList<CloudJob> listJobs(String jobScheduleId, DetailLevel detailLevel) throws BatchErrorException, IOException
Lists thejobs
created under the specified job schedule.- Parameters:
jobScheduleId
- The ID of job schedule.detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.- Returns:
- A list of
CloudJob
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listJobs
public com.microsoft.azure.PagedList<CloudJob> listJobs(String jobScheduleId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Lists thejobs
created under the specified jobSchedule.- Parameters:
jobScheduleId
- The ID of jobSchedule.detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- A list of
CloudJob
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listPreparationAndReleaseTaskStatus
public com.microsoft.azure.PagedList<JobPreparationAndReleaseTaskExecutionInformation> listPreparationAndReleaseTaskStatus(String jobId) throws BatchErrorException, IOException
Lists the status ofJobPreparationTask
andJobReleaseTask
tasks for the specified job.- Parameters:
jobId
- The ID of the job.- Returns:
- A list of
JobPreparationAndReleaseTaskExecutionInformation
instances. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listPreparationAndReleaseTaskStatus
public com.microsoft.azure.PagedList<JobPreparationAndReleaseTaskExecutionInformation> listPreparationAndReleaseTaskStatus(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Lists the status ofJobPreparationTask
andJobReleaseTask
tasks for the specified job.- Parameters:
jobId
- The ID of the job.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- A list of
JobPreparationAndReleaseTaskExecutionInformation
instances. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
createJob
public void createJob(String jobId, PoolInformation poolInfo) throws BatchErrorException, IOException
Adds a job to the Batch account.- Parameters:
jobId
- The ID of the job to be added.poolInfo
- Specifies how a job should be assigned to a pool.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
createJob
public void createJob(String jobId, PoolInformation poolInfo, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Adds a job to the Batch account.- Parameters:
jobId
- The ID of the job to be added.poolInfo
- Specifies how a job should be assigned to a pool.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
createJob
public void createJob(JobAddParameter job) throws BatchErrorException, IOException
Adds a job to the Batch account.- Parameters:
job
- The job to be added.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
createJob
public void createJob(JobAddParameter job, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Adds a job to the Batch account.- Parameters:
job
- The job to be added.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteJob
public void deleteJob(String jobId) throws BatchErrorException, IOException
Deletes the specified job.- Parameters:
jobId
- The ID of the job.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteJob
public void deleteJob(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Deletes the specified job.- Parameters:
jobId
- The ID of the job.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
terminateJob
public void terminateJob(String jobId) throws BatchErrorException, IOException
Terminates the specified job, marking it as completed.- Parameters:
jobId
- The ID of the job.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
terminateJob
public void terminateJob(String jobId, String terminateReason) throws BatchErrorException, IOException
Terminates the specified job, marking it as completed.- Parameters:
jobId
- The ID of the job.terminateReason
- The message to describe the reason the job has terminated. This text will appear when you callJobExecutionInformation.terminateReason()
.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
terminateJob
public void terminateJob(String jobId, String terminateReason, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Terminates the specified job, marking it as completed.- Parameters:
jobId
- The ID of the job.terminateReason
- The message to describe the reason the job has terminated. This text will appear when you callJobExecutionInformation.terminateReason()
.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
enableJob
public void enableJob(String jobId) throws BatchErrorException, IOException
Enables the specified job, allowing new tasks to run.- Parameters:
jobId
- The ID of the job.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
enableJob
public void enableJob(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Enables the specified job, allowing new tasks to run.- Parameters:
jobId
- The ID of the job.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
disableJob
public void disableJob(String jobId, DisableJobOption disableJobOption) throws BatchErrorException, IOException
Disables the specified job. Disabled jobs do not run new tasks, but may be re-enabled later.- Parameters:
jobId
- The ID of the job.disableJobOption
- Specifies what to do with running tasks associated with the job.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
disableJob
public void disableJob(String jobId, DisableJobOption disableJobOption, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Disables the specified job. Disabled jobs do not run new tasks, but may be re-enabled later.- Parameters:
jobId
- The ID of the job.disableJobOption
- Specifies what to do with running tasks associated with the job.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
updateJob
public void updateJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata) throws BatchErrorException, IOException
Updates the specified job. This method performs a full replace of all updatable properties of the job. For example, if the constraints parameter is null, then the Batch service removes the job's existing constraints and replaces them with the default constraints.- Parameters:
jobId
- The ID of the job.poolInfo
- The pool on which the Batch service runs the job's tasks. You may change the pool for a job only when the job is disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job.priority
- 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. If null, it is set to the default value 0.constraints
- The execution constraints for the job. If null, the constraints are cleared.onAllTasksComplete
- Specifies an action the Batch service should take when all tasks in the job are in the completed state.metadata
- A list of name-value pairs associated with the job as metadata. If null, it takes the default value of an empty list; in effect, any existing metadata is deleted.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
updateJob
public void updateJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Updates the specified job. This method performs a full replace of all updatable properties of the job. For example, if the constraints parameter is null, then the Batch service removes the job's existing constraints and replaces them with the default constraints.- Parameters:
jobId
- The ID of the job.poolInfo
- The pool on which the Batch service runs the job's tasks. You may change the pool for a job only when the job is disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job.priority
- 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. If null, it is set to the default value 0.constraints
- The execution constraints for the job. If null, the constraints are cleared.onAllTasksComplete
- Specifies an action the Batch service should take when all tasks in the job are in the completed state.metadata
- A list of name-value pairs associated with the job as metadata. If null, it takes the default value of an empty list; in effect, any existing metadata is deleted.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
updateJob
public void updateJob(String jobId, JobUpdateParameter param) throws BatchErrorException, IOException
- Throws:
BatchErrorException
IOException
-
updateJob
public void updateJob(String jobId, JobUpdateParameter param, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Updates the specified job This method performs a full replace of all updatable properties of the job. For example, if the constraints parameter is null, then the Batch service removes the job's existing constraints and replaces them with the default constraints.- Parameters:
jobId
- The job to be updated.param
- Job Update parametersadditionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
patchJob
public void patchJob(String jobId, PoolInformation poolInfo) throws BatchErrorException, IOException
Updates the specified job. This method only replaces the properties specified with non-null values.- Parameters:
jobId
- The ID of the job.poolInfo
- The pool on which the Batch service runs the job's tasks. You may change the pool for a job only when the job is disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If null, the job continues to run on its current pool.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
patchJob
public void patchJob(String jobId, OnAllTasksComplete onAllTasksComplete) throws BatchErrorException, IOException
Updates the specified job. This method only replaces the properties specified with non-null values.- Parameters:
jobId
- The ID of the job.onAllTasksComplete
- Specifies an action the Batch service should take when all tasks in the job are in the completed state.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
patchJob
public void patchJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata) throws BatchErrorException, IOException
Updates the specified job. This method only replaces the properties specified with non-null values.- Parameters:
jobId
- The ID of the job.poolInfo
- The pool on which the Batch service runs the job's tasks. You may change the pool for a job only when the job is disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If null, the job continues to run on its current pool.priority
- 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. If null, the priority of the job is left unchanged.constraints
- The execution constraints for the job. If null, the existing execution constraints are left unchanged.onAllTasksComplete
- Specifies an action the Batch service should take when all tasks in the job are in the completed state.metadata
- A list of name-value pairs associated with the job as metadata. If null, the existing job metadata is left unchanged.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
patchJob
public void patchJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Updates the specified job. This method only replaces the properties specified with non-null values.- Parameters:
jobId
- The ID of the job.poolInfo
- The pool on which the Batch service runs the job's tasks. You may change the pool for a job only when the job is disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If null, the job continues to run on its current pool.priority
- 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. If null, the priority of the job is left unchanged.constraints
- The execution constraints for the job. If null, the existing execution constraints are left unchanged.onAllTasksComplete
- Specifies an action the Batch service should take when all tasks in the job are in the completed state.metadata
- A list of name-value pairs associated with the job as metadata. If null, the existing job metadata is left unchanged.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
patchJob
public void patchJob(String jobId, JobPatchParameter jobPatchParameter) throws BatchErrorException, IOException
Updates the specified job. This method only replaces the properties specified with non-null values.- Parameters:
jobId
- The ID of the job.jobPatchParameter
- The set of changes to be made to a job.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
patchJob
public void patchJob(String jobId, JobPatchParameter jobPatchParameter, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Updates the specified job. This method only replaces the properties specified with non-null values.- Parameters:
jobId
- The ID of the job.jobPatchParameter
- The parameter to update the job.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getTaskCounts
public TaskCounts getTaskCounts(String jobId) throws BatchErrorException, IOException
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.- Parameters:
jobId
- The ID of the job.- Returns:
- the TaskCounts object if successful.
- Throws:
BatchErrorException
- thrown if the request is rejected by serverIOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getTaskCounts
public TaskCounts getTaskCounts(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
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.- Parameters:
jobId
- The ID of the job.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- the TaskCounts object if successful.
- Throws:
BatchErrorException
- thrown if the request is rejected by serverIOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getTaskSlotCounts
public TaskSlotCounts getTaskSlotCounts(String jobId) throws BatchErrorException, IOException
Gets the task slot counts for the specified job. Task slot 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.- Parameters:
jobId
- The ID of the job.- Returns:
- the TaskSlotCounts object if successful.
- Throws:
BatchErrorException
- thrown if the request is rejected by serverIOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getTaskSlotCounts
public TaskSlotCounts getTaskSlotCounts(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Gets the task slot counts for the specified job. Task slot 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.- Parameters:
jobId
- The ID of the job.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- the TaskSlotCounts object if successful.
- Throws:
BatchErrorException
- thrown if the request is rejected by serverIOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getTaskCountsResult
public TaskCountsResult getTaskCountsResult(String jobId) throws BatchErrorException, IOException
Gets the task counts result for the specified job. The result includes both task counts and task slot counts. Each counts object provides 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.- Parameters:
jobId
- The ID of the job.- Returns:
- the TaskCountsResult object if successful.
- Throws:
BatchErrorException
- thrown if the request is rejected by serverIOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getTaskCountsResult
public TaskCountsResult getTaskCountsResult(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Gets the task counts result for the specified job. The result includes both task counts and task slot counts. Each counts object provides 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.- Parameters:
jobId
- The ID of the job.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- the TaskCountsResult object if successful.
- Throws:
BatchErrorException
- thrown if the request is rejected by serverIOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
-