Azure Batch Service API Reference
This section provides detailed API reference documentation for the Azure Batch service. Use these APIs to manage your Batch accounts, jobs, tasks, and compute nodes programmatically.
Core Concepts and Operations
The Azure Batch service exposes REST APIs that allow you to interact with your Batch resources. You can perform operations such as:
- Account Management: Create, list, and delete Batch accounts.
- Job Management: Create, list, retrieve, terminate, and delete jobs.
- Task Management: Create, list, retrieve, update, and delete tasks within a job.
- Compute Node Management: List, enable, disable, re-image, and delete compute nodes.
- File Management: Upload and download files associated with tasks and nodes.
- Monitoring: Retrieve statistics and performance counters for jobs and nodes.
API Endpoints
The primary endpoint for interacting with the Azure Batch API is typically in the format:
https://{account_name}.{region}.batch.azure.com
Authentication
Authentication is typically handled via Azure Active Directory (Azure AD) tokens or shared key authentication.
Key Resource Collections
Below are some of the commonly used resource collections and their associated operations:
Jobs Collection
The Jobs collection allows you to manage all jobs within a Batch account.
HTTP Method | URL Path | Description |
---|---|---|
POST |
/jobs |
Creates a new job. |
GET |
/jobs |
Lists all jobs in the account. Supports filtering and OData query options. |
GET |
/jobs/{jobId} |
Retrieves information about a specific job. |
DELETE |
/jobs/{jobId} |
Deletes a job and all tasks associated with it. |
POST |
/jobs/{jobId}/disable |
Disables a job, preventing new tasks from being added. |
POST |
/jobs/{jobId}/enable |
Enables a job, allowing new tasks to be added. |
Tasks Collection
The Tasks collection allows you to manage tasks within a specific job.
HTTP Method | URL Path | Description |
---|---|---|
POST |
/jobs/{jobId}/tasks |
Creates a new task within a specified job. |
GET |
/jobs/{jobId}/tasks |
Lists all tasks for a specified job. Supports filtering. |
GET |
/jobs/{jobId}/tasks/{taskId} |
Retrieves information about a specific task. |
DELETE |
/jobs/{jobId}/tasks/{taskId} |
Deletes a specific task. |
Compute Nodes Collection
The Compute Nodes collection allows you to manage the nodes within your Batch pools.
HTTP Method | URL Path | Description |
---|---|---|
GET |
/pools/{poolId}/nodes |
Lists all compute nodes in a specified pool. |
GET |
/pools/{poolId}/nodes/{nodeId} |
Retrieves information about a specific compute node. |
POST |
/pools/{poolId}/nodes/{nodeId}/reimage |
Re-images a compute node. |
POST |
/pools/{poolId}/nodes/{nodeId}/disable |
Disables a compute node, preventing new tasks from being scheduled on it. |
POST |
/pools/{poolId}/nodes/{nodeId}/enable |
Enables a compute node, allowing new tasks to be scheduled on it. |