public class JobOperations extends Object implements IInheritedBehaviors
Modifier and Type | Method and 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.
|
JobStatistics |
getAllJobsLifetimeStatistics()
Gets lifetime summary statistics for all of the jobs in the current account.
|
JobStatistics |
getAllJobsLifetimeStatistics(Iterable<BatchClientBehavior> additionalBehaviors)
Gets lifetime summary statistics for all of the jobs in the current account.
|
CloudJob |
getJob(String jobId)
Gets the specified
CloudJob . |
CloudJob |
getJob(String jobId,
DetailLevel detailLevel)
Gets the specified
CloudJob . |
CloudJob |
getJob(String jobId,
DetailLevel detailLevel,
Iterable<BatchClientBehavior> additionalBehaviors)
Gets the specified
CloudJob . |
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.
|
List<CloudJob> |
listJobs()
Lists the
jobs in the Batch account. |
List<CloudJob> |
listJobs(DetailLevel detailLevel)
Lists the
jobs in the Batch account. |
List<CloudJob> |
listJobs(DetailLevel detailLevel,
Iterable<BatchClientBehavior> additionalBehaviors)
Lists the
jobs in the Batch account. |
List<CloudJob> |
listJobs(String jobScheduleId)
Lists the
jobs created under the specified job schedule. |
List<CloudJob> |
listJobs(String jobScheduleId,
DetailLevel detailLevel)
Lists the
jobs created under the specified job schedule. |
List<CloudJob> |
listJobs(String jobScheduleId,
DetailLevel detailLevel,
Iterable<BatchClientBehavior> additionalBehaviors)
Lists the
jobs created under the specified jobSchedule. |
List<JobPreparationAndReleaseTaskExecutionInformation> |
listPreparationAndReleaseTaskStatus(String jobId)
Lists the status of
JobPreparationTask and JobReleaseTask tasks for the specified job. |
List<JobPreparationAndReleaseTaskExecutionInformation> |
listPreparationAndReleaseTaskStatus(String jobId,
Iterable<BatchClientBehavior> additionalBehaviors)
Lists the status of
JobPreparationTask and JobReleaseTask 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,
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.
|
public Collection<BatchClientBehavior> customBehaviors()
customBehaviors
in interface IInheritedBehaviors
BatchClientBehavior
instances.public IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> behaviors)
withCustomBehaviors
in interface IInheritedBehaviors
behaviors
- The collection of BatchClientBehavior
instances.public JobStatistics getAllJobsLifetimeStatistics() throws BatchErrorException, IOException
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.public JobStatistics getAllJobsLifetimeStatistics(Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.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.public CloudJob getJob(String jobId) throws BatchErrorException, IOException
CloudJob
.jobId
- The ID of the job to get.CloudJob
containing information about the specified Azure Batch job.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.public CloudJob getJob(String jobId, DetailLevel detailLevel) throws BatchErrorException, IOException
CloudJob
.jobId
- The ID of the job to get.detailLevel
- A DetailLevel
used for controlling which properties are retrieved from the service.CloudJob
containing information about the specified Azure Batch job.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.public CloudJob getJob(String jobId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
CloudJob
.jobId
- The ID of the job to get.detailLevel
- A DetailLevel
used for controlling which properties are retrieved from the service.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.CloudJob
containing information about the specified Azure Batch job.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.public List<CloudJob> listJobs() throws BatchErrorException, IOException
jobs
in the Batch account.CloudJob
objects.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.public List<CloudJob> listJobs(DetailLevel detailLevel) throws BatchErrorException, IOException
jobs
in the Batch account.detailLevel
- A DetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.CloudJob
objects.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.public List<CloudJob> listJobs(DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
jobs
in the Batch account.detailLevel
- A DetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.CloudJob
objects.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.public List<CloudJob> listJobs(String jobScheduleId) throws BatchErrorException, IOException
jobs
created under the specified job schedule.jobScheduleId
- The ID of job schedule.CloudJob
objects.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.public List<CloudJob> listJobs(String jobScheduleId, DetailLevel detailLevel) throws BatchErrorException, IOException
jobs
created under the specified job schedule.jobScheduleId
- The ID of job schedule.detailLevel
- A DetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.CloudJob
objects.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.public List<CloudJob> listJobs(String jobScheduleId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
jobs
created under the specified jobSchedule.jobScheduleId
- The ID of jobSchedule.detailLevel
- A DetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.CloudJob
objects.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.public List<JobPreparationAndReleaseTaskExecutionInformation> listPreparationAndReleaseTaskStatus(String jobId) throws BatchErrorException, IOException
JobPreparationTask
and JobReleaseTask
tasks for the specified job.jobId
- The ID of the job.JobPreparationAndReleaseTaskExecutionInformation
instances.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.public List<JobPreparationAndReleaseTaskExecutionInformation> listPreparationAndReleaseTaskStatus(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
JobPreparationTask
and JobReleaseTask
tasks for the specified job.jobId
- The ID of the job.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.JobPreparationAndReleaseTaskExecutionInformation
instances.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.public void createJob(String jobId, PoolInformation poolInfo) throws BatchErrorException, IOException
jobId
- The ID of the job to be added.poolInfo
- Specifies how a job should be assigned to a pool.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.public void createJob(String jobId, PoolInformation poolInfo, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
jobId
- The ID of the job to be added.poolInfo
- Specifies how a job should be assigned to a pool.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.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.public void createJob(JobAddParameter job) throws BatchErrorException, IOException
job
- The job to be added.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.public void createJob(JobAddParameter job, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
job
- The job to be added.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.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.public void deleteJob(String jobId) throws BatchErrorException, IOException
jobId
- The ID of the job.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.public void deleteJob(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
jobId
- The ID of the job.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.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.public void terminateJob(String jobId) throws BatchErrorException, IOException
jobId
- The ID of the job.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.public void terminateJob(String jobId, String terminateReason) throws BatchErrorException, IOException
jobId
- The ID of the job.terminateReason
- The message to describe the reason the job has terminated. This text will appear when you call JobExecutionInformation.terminateReason()
.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.public void terminateJob(String jobId, String terminateReason, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
jobId
- The ID of the job.terminateReason
- The message to describe the reason the job has terminated. This text will appear when you call JobExecutionInformation.terminateReason()
.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.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.public void enableJob(String jobId) throws BatchErrorException, IOException
jobId
- The ID of the job.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.public void enableJob(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
jobId
- The ID of the job.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.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.public void disableJob(String jobId, DisableJobOption disableJobOption) throws BatchErrorException, IOException
jobId
- The ID of the job.disableJobOption
- Specifies what to do with running tasks associated with the job.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.public void disableJob(String jobId, DisableJobOption disableJobOption, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
jobId
- The ID of the job.disableJobOption
- Specifies what to do with running tasks associated with the job.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.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.public void updateJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata) throws BatchErrorException, IOException
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.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.public void updateJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
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 of BatchClientBehavior
instances that are applied to the Batch service request.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.public void patchJob(String jobId, PoolInformation poolInfo) throws BatchErrorException, IOException
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.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.public void patchJob(String jobId, OnAllTasksComplete onAllTasksComplete) throws BatchErrorException, IOException
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.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.public void patchJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata) throws BatchErrorException, IOException
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.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.public void patchJob(String jobId, PoolInformation poolInfo, Integer priority, JobConstraints constraints, OnAllTasksComplete onAllTasksComplete, List<MetadataItem> metadata, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
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 of BatchClientBehavior
instances that are applied to the Batch service request.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.public void patchJob(String jobId, JobPatchParameter jobPatchParameter) throws BatchErrorException, IOException
jobId
- The ID of the job.jobPatchParameter
- The set of changes to be made to a job.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.public void patchJob(String jobId, JobPatchParameter jobPatchParameter, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
jobId
- The ID of the job.jobPatchParameter
- The parameter to update the job.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.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.public TaskCounts getTaskCounts(String jobId) throws BatchErrorException, IOException
jobId
- The ID of the job.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.public TaskCounts getTaskCounts(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
jobId
- The ID of the job.additionalBehaviors
- A collection of BatchClientBehavior
instances that are applied to the Batch service request.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.Copyright © 2019. All rights reserved.