Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Task

Package version

Class representing a Task.

Hierarchy

  • Task

Index

Constructors

constructor

Methods

add

  • The maximum lifetime of a task from addition to completion is 180 days. If a task has not completed within 180 days of being added it will be terminated by the Batch service and left in whatever state it was in at that time.

    summary

    Adds a task to the specified job.

    Parameters

    • jobId: string

      The ID of the job to which the task is to be added.

    • task: TaskAddParameter

      The task to be added.

    • Optional options: Models.TaskAddOptionalParams

    Returns Promise<Models.TaskAddResponse>

    Promise<Models.TaskAddResponse>

  • Parameters

    • jobId: string

      The ID of the job to which the task is to be added.

    • task: TaskAddParameter

      The task to be added.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job to which the task is to be added.

    • task: TaskAddParameter

      The task to be added.

    • options: TaskAddOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

addCollection

  • Note that each task must have a unique ID. The Batch service may not return the results for each task in the same order the tasks were submitted in this request. If the server times out or the connection is closed during the request, the request may have been partially or fully processed, or not at all. In such cases, the user should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request. For example, you should use the same task IDs during a retry so that if the prior operation succeeded, the retry will not create extra tasks unexpectedly. If the response contains any tasks which failed to add, a client can retry the request. In a retry, it is most efficient to resubmit only tasks that failed to add, and to omit tasks that were successfully added on the first attempt. The maximum lifetime of a task from addition to completion is 180 days. If a task has not completed within 180 days of being added it will be terminated by the Batch service and left in whatever state it was in at that time.

    summary

    Adds a collection of tasks to the specified job.

    Parameters

    • jobId: string

      The ID of the job to which the task collection is to be added.

    • value: TaskAddParameter[]

      The collection of tasks to add. The maximum count of tasks is 100. The total serialized size of this collection must be less than 1MB. If it is greater than 1MB (for example if each task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer tasks.

    • Optional options: Models.TaskAddCollectionOptionalParams

    Returns Promise<Models.TaskAddCollectionResponse>

    Promise<Models.TaskAddCollectionResponse>

  • Parameters

    • jobId: string

      The ID of the job to which the task collection is to be added.

    • value: TaskAddParameter[]

      The collection of tasks to add. The maximum count of tasks is 100. The total serialized size of this collection must be less than 1MB. If it is greater than 1MB (for example if each task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer tasks.

    • callback: msRest.ServiceCallback<TaskAddCollectionResult>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job to which the task collection is to be added.

    • value: TaskAddParameter[]

      The collection of tasks to add. The maximum count of tasks is 100. The total serialized size of this collection must be less than 1MB. If it is greater than 1MB (for example if each task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer tasks.

    • options: TaskAddCollectionOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<TaskAddCollectionResult>

      The callback

    Returns void

deleteMethod

  • deleteMethod(jobId: string, taskId: string, options?: Models.TaskDeleteMethodOptionalParams): Promise<Models.TaskDeleteResponse>
  • deleteMethod(jobId: string, taskId: string, callback: msRest.ServiceCallback<void>): void
  • deleteMethod(jobId: string, taskId: string, options: TaskDeleteMethodOptionalParams, callback: msRest.ServiceCallback<void>): void
  • When a task is deleted, all of the files in its directory on the compute node where it ran are also deleted (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the primary task; subtasks and their files are then deleted asynchronously in the background.

    summary

    Deletes a task from the specified job.

    Parameters

    • jobId: string

      The ID of the job from which to delete the task.

    • taskId: string

      The ID of the task to delete.

    • Optional options: Models.TaskDeleteMethodOptionalParams

    Returns Promise<Models.TaskDeleteResponse>

    Promise<Models.TaskDeleteResponse>

  • Parameters

    • jobId: string

      The ID of the job from which to delete the task.

    • taskId: string

      The ID of the task to delete.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job from which to delete the task.

    • taskId: string

      The ID of the task to delete.

    • options: TaskDeleteMethodOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

get

  • get(jobId: string, taskId: string, options?: Models.TaskGetOptionalParams): Promise<Models.TaskGetResponse>
  • get(jobId: string, taskId: string, callback: msRest.ServiceCallback<CloudTask>): void
  • get(jobId: string, taskId: string, options: TaskGetOptionalParams, callback: msRest.ServiceCallback<CloudTask>): void
  • For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subtasks API to retrieve information about subtasks.

    summary

    Gets information about the specified task.

    Parameters

    • jobId: string

      The ID of the job that contains the task.

    • taskId: string

      The ID of the task to get information about.

    • Optional options: Models.TaskGetOptionalParams

    Returns Promise<Models.TaskGetResponse>

    Promise<Models.TaskGetResponse>

  • Parameters

    • jobId: string

      The ID of the job that contains the task.

    • taskId: string

      The ID of the task to get information about.

    • callback: msRest.ServiceCallback<CloudTask>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job that contains the task.

    • taskId: string

      The ID of the task to get information about.

    • options: TaskGetOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<CloudTask>

      The callback

    Returns void

list

  • For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subtasks API to retrieve information about subtasks.

    summary

    Lists all of the tasks that are associated with the specified job.

    Parameters

    • jobId: string

      The ID of the job.

    • Optional options: Models.TaskListOptionalParams

    Returns Promise<Models.TaskListResponse>

    Promise<Models.TaskListResponse>

  • Parameters

    • jobId: string

      The ID of the job.

    • callback: msRest.ServiceCallback<CloudTaskListResult>

      The callback

    Returns void

  • Parameters

    Returns void

listNext

  • listNext(nextPageLink: string, options?: Models.TaskListNextOptionalParams): Promise<Models.TaskListResponse>
  • listNext(nextPageLink: string, callback: msRest.ServiceCallback<CloudTaskListResult>): void
  • listNext(nextPageLink: string, options: TaskListNextOptionalParams, callback: msRest.ServiceCallback<CloudTaskListResult>): void
  • For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subtasks API to retrieve information about subtasks.

    summary

    Lists all of the tasks that are associated with the specified job.

    Parameters

    • nextPageLink: string

      The NextLink from the previous successful call to List operation.

    • Optional options: Models.TaskListNextOptionalParams

    Returns Promise<Models.TaskListResponse>

    Promise<Models.TaskListResponse>

  • Parameters

    • nextPageLink: string

      The NextLink from the previous successful call to List operation.

    • callback: msRest.ServiceCallback<CloudTaskListResult>

      The callback

    Returns void

  • Parameters

    Returns void

listSubtasks

  • If the task is not a multi-instance task then this returns an empty collection.

    summary

    Lists all of the subtasks that are associated with the specified multi-instance task.

    Parameters

    • jobId: string

      The ID of the job.

    • taskId: string

      The ID of the task.

    • Optional options: Models.TaskListSubtasksOptionalParams

    Returns Promise<Models.TaskListSubtasksResponse>

    Promise<Models.TaskListSubtasksResponse>

  • Parameters

    • jobId: string

      The ID of the job.

    • taskId: string

      The ID of the task.

    • callback: msRest.ServiceCallback<CloudTaskListSubtasksResult>

      The callback

    Returns void

  • Parameters

    Returns void

reactivate

  • reactivate(jobId: string, taskId: string, options?: Models.TaskReactivateOptionalParams): Promise<Models.TaskReactivateResponse>
  • reactivate(jobId: string, taskId: string, callback: msRest.ServiceCallback<void>): void
  • reactivate(jobId: string, taskId: string, options: TaskReactivateOptionalParams, callback: msRest.ServiceCallback<void>): void
  • Reactivation makes a task eligible to be retried again up to its maximum retry count. The task's state is changed to active. As the task is no longer in the completed state, any previous exit code or failure information is no longer available after reactivation. Each time a task is reactivated, its retry count is reset to 0. Reactivation will fail for tasks that are not completed or that previously completed successfully (with an exit code of 0). Additionally, it will fail if the job has completed (or is terminating or deleting).

    summary

    Reactivates a task, allowing it to run again even if its retry count has been exhausted.

    Parameters

    • jobId: string

      The ID of the job containing the task.

    • taskId: string

      The ID of the task to reactivate.

    • Optional options: Models.TaskReactivateOptionalParams

    Returns Promise<Models.TaskReactivateResponse>

    Promise<Models.TaskReactivateResponse>

  • Parameters

    • jobId: string

      The ID of the job containing the task.

    • taskId: string

      The ID of the task to reactivate.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job containing the task.

    • taskId: string

      The ID of the task to reactivate.

    • options: TaskReactivateOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

terminate

  • terminate(jobId: string, taskId: string, options?: Models.TaskTerminateOptionalParams): Promise<Models.TaskTerminateResponse>
  • terminate(jobId: string, taskId: string, callback: msRest.ServiceCallback<void>): void
  • terminate(jobId: string, taskId: string, options: TaskTerminateOptionalParams, callback: msRest.ServiceCallback<void>): void
  • When the task has been terminated, it moves to the completed state. For multi-instance tasks, the terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in the background.

    summary

    Terminates the specified task.

    Parameters

    • jobId: string

      The ID of the job containing the task.

    • taskId: string

      The ID of the task to terminate.

    • Optional options: Models.TaskTerminateOptionalParams

    Returns Promise<Models.TaskTerminateResponse>

    Promise<Models.TaskTerminateResponse>

  • Parameters

    • jobId: string

      The ID of the job containing the task.

    • taskId: string

      The ID of the task to terminate.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job containing the task.

    • taskId: string

      The ID of the task to terminate.

    • options: TaskTerminateOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

update

  • update(jobId: string, taskId: string, options?: Models.TaskUpdateOptionalParams): Promise<Models.TaskUpdateResponse>
  • update(jobId: string, taskId: string, callback: msRest.ServiceCallback<void>): void
  • update(jobId: string, taskId: string, options: TaskUpdateOptionalParams, callback: msRest.ServiceCallback<void>): void
  • Updates the properties of the specified task.

    Parameters

    • jobId: string

      The ID of the job containing the task.

    • taskId: string

      The ID of the task to update.

    • Optional options: Models.TaskUpdateOptionalParams

    Returns Promise<Models.TaskUpdateResponse>

    Promise<Models.TaskUpdateResponse>

  • Parameters

    • jobId: string

      The ID of the job containing the task.

    • taskId: string

      The ID of the task to update.

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

  • Parameters

    • jobId: string

      The ID of the job containing the task.

    • taskId: string

      The ID of the task to update.

    • options: TaskUpdateOptionalParams

      The optional parameters

    • callback: msRest.ServiceCallback<void>

      The callback

    Returns void

Generated using TypeDoc