Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Job

Package version

Class representing a Job.

Hierarchy

  • Job

Index

Constructors

constructor

Methods

add

  • The Batch service supports two ways to control the work done as part of a job. In the first approach, the user specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming jobs, avoid including sensitive information such as user names or secret project names. This information may appear in telemetry logs accessible to Microsoft Support engineers.

    summary

    Adds a job to the specified account.

    Parameters

    • job: JobAddParameter

      The job to be added.

    • Optional options: Models.JobAddOptionalParams

    Returns Promise<Models.JobAddResponse>

    Promise<Models.JobAddResponse>

  • Parameters

    • job: JobAddParameter

      The job to be added.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    Returns void

deleteMethod

  • deleteMethod(jobId: string, options?: Models.JobDeleteMethodOptionalParams): Promise<Models.JobDeleteResponse>
  • deleteMethod(jobId: string, callback: msRest.ServiceCallback<void>): void
  • deleteMethod(jobId: string, options: JobDeleteMethodOptionalParams, callback: msRest.ServiceCallback<void>): void
  • Deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes, the Batch services deletes those tasks' working directories and all their contents. When a Delete Job request is received, the Batch service sets the job to the deleting state. All update operations on a job that is in deleting state will fail with status code 409 (Conflict), with additional information indicating that the job is being deleted.

    summary

    Deletes a job.

    Parameters

    • jobId: string

      The ID of the job to delete.

    • Optional options: Models.JobDeleteMethodOptionalParams

    Returns Promise<Models.JobDeleteResponse>

    Promise<Models.JobDeleteResponse>

  • Parameters

    • jobId: string

      The ID of the job to delete.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job to delete.

    • options: JobDeleteMethodOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

disable

  • disable(jobId: string, disableTasks: Models.DisableJobOption, options?: Models.JobDisableOptionalParams): Promise<Models.JobDisableResponse>
  • disable(jobId: string, disableTasks: Models.DisableJobOption, callback: msRest.ServiceCallback<void>): void
  • disable(jobId: string, disableTasks: Models.DisableJobOption, options: JobDisableOptionalParams, callback: msRest.ServiceCallback<void>): void
  • The Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling state until the disable operation is completed and all tasks have been dealt with according to the disableTasks option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the request fails with status code 409.

    summary

    Disables the specified job, preventing new tasks from running.

    Parameters

    • jobId: string

      The ID of the job to disable.

    • disableTasks: Models.DisableJobOption

      What to do with active tasks associated with the job. Possible values include: 'requeue', 'terminate', 'wait'

    • Optional options: Models.JobDisableOptionalParams

    Returns Promise<Models.JobDisableResponse>

    Promise<Models.JobDisableResponse>

  • Parameters

    • jobId: string

      The ID of the job to disable.

    • disableTasks: Models.DisableJobOption

      What to do with active tasks associated with the job. Possible values include: 'requeue', 'terminate', 'wait'

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job to disable.

    • disableTasks: Models.DisableJobOption

      What to do with active tasks associated with the job. Possible values include: 'requeue', 'terminate', 'wait'

    • options: JobDisableOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

enable

  • enable(jobId: string, options?: Models.JobEnableOptionalParams): Promise<Models.JobEnableResponse>
  • enable(jobId: string, callback: msRest.ServiceCallback<void>): void
  • enable(jobId: string, options: JobEnableOptionalParams, callback: msRest.ServiceCallback<void>): void
  • When you call this API, the Batch service sets a disabled job to the enabling state. After the this operation is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch service does not allow a task to remain in the active state for more than 180 days. Therefore, if you enable a job containing active tasks which were added more than 180 days ago, those tasks will not run.

    summary

    Enables the specified job, allowing new tasks to run.

    Parameters

    • jobId: string

      The ID of the job to enable.

    • Optional options: Models.JobEnableOptionalParams

    Returns Promise<Models.JobEnableResponse>

    Promise<Models.JobEnableResponse>

  • Parameters

    • jobId: string

      The ID of the job to enable.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job to enable.

    • options: JobEnableOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

get

  • get(jobId: string, options?: Models.JobGetOptionalParams): Promise<Models.JobGetResponse>
  • get(jobId: string, callback: msRest.ServiceCallback<CloudJob>): void
  • get(jobId: string, options: JobGetOptionalParams, callback: msRest.ServiceCallback<CloudJob>): void
  • summary

    Gets information about the specified job.

    Parameters

    • jobId: string

      The ID of the job.

    • Optional options: Models.JobGetOptionalParams

    Returns Promise<Models.JobGetResponse>

    Promise<Models.JobGetResponse>

  • Parameters

    • jobId: string

      The ID of the job.

    • callback: msRest.ServiceCallback<CloudJob>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job.

    • options: JobGetOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<CloudJob>

      The callback

    Returns void

getAllLifetimeStatistics

  • getAllLifetimeStatistics(options?: Models.JobGetAllLifetimeStatisticsOptionalParams): Promise<Models.JobGetAllLifetimeStatisticsResponse>
  • getAllLifetimeStatistics(callback: msRest.ServiceCallback<JobStatistics>): void
  • getAllLifetimeStatistics(options: JobGetAllLifetimeStatisticsOptionalParams, callback: msRest.ServiceCallback<JobStatistics>): void
  • Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last update time of the statistics. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes.

    summary

    Gets lifetime summary statistics for all of the jobs in the specified account.

    Parameters

    • Optional options: Models.JobGetAllLifetimeStatisticsOptionalParams

    Returns Promise<Models.JobGetAllLifetimeStatisticsResponse>

    Promise<Models.JobGetAllLifetimeStatisticsResponse>

  • Parameters

    Returns void

  • Parameters

    Returns void

getTaskCounts

  • getTaskCounts(jobId: string, options?: Models.JobGetTaskCountsOptionalParams): Promise<Models.JobGetTaskCountsResponse>
  • getTaskCounts(jobId: string, callback: msRest.ServiceCallback<TaskCounts>): void
  • getTaskCounts(jobId: string, options: JobGetTaskCountsOptionalParams, callback: msRest.ServiceCallback<TaskCounts>): void
  • 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.

    summary

    Gets the task counts for the specified job.

    Parameters

    • jobId: string

      The ID of the job.

    • Optional options: Models.JobGetTaskCountsOptionalParams

    Returns Promise<Models.JobGetTaskCountsResponse>

    Promise<Models.JobGetTaskCountsResponse>

  • Parameters

    • jobId: string

      The ID of the job.

    • callback: msRest.ServiceCallback<TaskCounts>

      The callback

    Returns void

  • Parameters

    Returns void

list

listFromJobSchedule

  • listFromJobSchedule(jobScheduleId: string, options?: Models.JobListFromJobScheduleOptionalParams): Promise<Models.JobListFromJobScheduleResponse>
  • listFromJobSchedule(jobScheduleId: string, callback: msRest.ServiceCallback<CloudJobListResult>): void
  • listFromJobSchedule(jobScheduleId: string, options: JobListFromJobScheduleOptionalParams, callback: msRest.ServiceCallback<CloudJobListResult>): void
  • summary

    Lists the jobs that have been created under the specified job schedule.

    Parameters

    • jobScheduleId: string

      The ID of the job schedule from which you want to get a list of jobs.

    • Optional options: Models.JobListFromJobScheduleOptionalParams

    Returns Promise<Models.JobListFromJobScheduleResponse>

    Promise<Models.JobListFromJobScheduleResponse>

  • Parameters

    • jobScheduleId: string

      The ID of the job schedule from which you want to get a list of jobs.

    • callback: msRest.ServiceCallback<CloudJobListResult>

      The callback

    Returns void

  • Parameters

    Returns void

listFromJobScheduleNext

  • listFromJobScheduleNext(nextPageLink: string, options?: Models.JobListFromJobScheduleNextOptionalParams): Promise<Models.JobListFromJobScheduleResponse>
  • listFromJobScheduleNext(nextPageLink: string, callback: msRest.ServiceCallback<CloudJobListResult>): void
  • listFromJobScheduleNext(nextPageLink: string, options: JobListFromJobScheduleNextOptionalParams, callback: msRest.ServiceCallback<CloudJobListResult>): void
  • summary

    Lists the jobs that have been created under the specified job schedule.

    Parameters

    • nextPageLink: string

      The NextLink from the previous successful call to List operation.

    • Optional options: Models.JobListFromJobScheduleNextOptionalParams

    Returns Promise<Models.JobListFromJobScheduleResponse>

    Promise<Models.JobListFromJobScheduleResponse>

  • Parameters

    • nextPageLink: string

      The NextLink from the previous successful call to List operation.

    • callback: msRest.ServiceCallback<CloudJobListResult>

      The callback

    Returns void

  • Parameters

    Returns void

listNext

  • listNext(nextPageLink: string, options?: Models.JobListNextOptionalParams): Promise<Models.JobListResponse>
  • listNext(nextPageLink: string, callback: msRest.ServiceCallback<CloudJobListResult>): void
  • listNext(nextPageLink: string, options: JobListNextOptionalParams, callback: msRest.ServiceCallback<CloudJobListResult>): void
  • summary

    Lists all of the jobs in the specified account.

    Parameters

    • nextPageLink: string

      The NextLink from the previous successful call to List operation.

    • Optional options: Models.JobListNextOptionalParams

    Returns Promise<Models.JobListResponse>

    Promise<Models.JobListResponse>

  • Parameters

    • nextPageLink: string

      The NextLink from the previous successful call to List operation.

    • callback: msRest.ServiceCallback<CloudJobListResult>

      The callback

    Returns void

  • Parameters

    Returns void

listPreparationAndReleaseTaskStatus

  • This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from the pool. If this API is invoked on a job which has no Job Preparation or Job Release task, the Batch service returns HTTP status code 409 (Conflict) with an error code of JobPreparationTaskNotSpecified.

    summary

    Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run.

    Parameters

    • jobId: string

      The ID of the job.

    • Optional options: Models.JobListPreparationAndReleaseTaskStatusOptionalParams

    Returns Promise<Models.JobListPreparationAndReleaseTaskStatusResponse>

    Promise<Models.JobListPreparationAndReleaseTaskStatusResponse>

  • Parameters

    Returns void

  • Parameters

    Returns void

listPreparationAndReleaseTaskStatusNext

  • This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from the pool. If this API is invoked on a job which has no Job Preparation or Job Release task, the Batch service returns HTTP status code 409 (Conflict) with an error code of JobPreparationTaskNotSpecified.

    summary

    Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run.

    Parameters

    • nextPageLink: string

      The NextLink from the previous successful call to List operation.

    • Optional options: Models.JobListPreparationAndReleaseTaskStatusNextOptionalParams

    Returns Promise<Models.JobListPreparationAndReleaseTaskStatusResponse>

    Promise<Models.JobListPreparationAndReleaseTaskStatusResponse>

  • Parameters

    Returns void

  • Parameters

    Returns void

patch

  • patch(jobId: string, jobPatchParameter: JobPatchParameter, options?: Models.JobPatchOptionalParams): Promise<Models.JobPatchResponse>
  • patch(jobId: string, jobPatchParameter: JobPatchParameter, callback: msRest.ServiceCallback<void>): void
  • patch(jobId: string, jobPatchParameter: JobPatchParameter, options: JobPatchOptionalParams, callback: msRest.ServiceCallback<void>): void
  • This replaces only the job properties specified in the request. For example, if the job has constraints, and a request does not specify the constraints element, then the job keeps the existing constraints.

    summary

    Updates the properties of the specified job.

    Parameters

    • jobId: string

      The ID of the job whose properties you want to update.

    • jobPatchParameter: JobPatchParameter

      The parameters for the request.

    • Optional options: Models.JobPatchOptionalParams

    Returns Promise<Models.JobPatchResponse>

    Promise<Models.JobPatchResponse>

  • Parameters

    • jobId: string

      The ID of the job whose properties you want to update.

    • jobPatchParameter: JobPatchParameter

      The parameters for the request.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job whose properties you want to update.

    • jobPatchParameter: JobPatchParameter

      The parameters for the request.

    • options: JobPatchOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

terminate

  • terminate(jobId: string, options?: Models.JobTerminateOptionalParams): Promise<Models.JobTerminateResponse>
  • terminate(jobId: string, callback: msRest.ServiceCallback<void>): void
  • terminate(jobId: string, options: JobTerminateOptionalParams, callback: msRest.ServiceCallback<void>): void
  • When a Terminate Job request is received, the Batch service sets the job to the terminating state. The Batch service then terminates any running tasks associated with the job and runs any required job release tasks. Then the job moves into the completed state. If there are any tasks in the job in the active state, they will remain in the active state. Once a job is terminated, new tasks cannot be added and any remaining active tasks will not be scheduled.

    summary

    Terminates the specified job, marking it as completed.

    Parameters

    • jobId: string

      The ID of the job to terminate.

    • Optional options: Models.JobTerminateOptionalParams

    Returns Promise<Models.JobTerminateResponse>

    Promise<Models.JobTerminateResponse>

  • Parameters

    • jobId: string

      The ID of the job to terminate.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job to terminate.

    • options: JobTerminateOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

update

  • update(jobId: string, jobUpdateParameter: JobUpdateParameter, options?: Models.JobUpdateOptionalParams): Promise<Models.JobUpdateResponse>
  • update(jobId: string, jobUpdateParameter: JobUpdateParameter, callback: msRest.ServiceCallback<void>): void
  • update(jobId: string, jobUpdateParameter: JobUpdateParameter, options: JobUpdateOptionalParams, callback: msRest.ServiceCallback<void>): void
  • This fully replaces all the updatable properties of the job. For example, if the job has constraints associated with it and if constraints is not specified with this request, then the Batch service will remove the existing constraints.

    summary

    Updates the properties of the specified job.

    Parameters

    • jobId: string

      The ID of the job whose properties you want to update.

    • jobUpdateParameter: JobUpdateParameter

      The parameters for the request.

    • Optional options: Models.JobUpdateOptionalParams

    Returns Promise<Models.JobUpdateResponse>

    Promise<Models.JobUpdateResponse>

  • Parameters

    • jobId: string

      The ID of the job whose properties you want to update.

    • jobUpdateParameter: JobUpdateParameter

      The parameters for the request.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job whose properties you want to update.

    • jobUpdateParameter: JobUpdateParameter

      The parameters for the request.

    • options: JobUpdateOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

Generated using TypeDoc