Retrieves the details of a job template.
Try it now
Test
RAM authorization
Request syntax
GET /api/v1/jobtemplates/{TemplateId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TemplateId |
string |
Yes |
The ID of the job template. |
tplmceolmf2**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Version |
string |
No |
The version to retrieve. If omitted, the default version is returned. Specify |
all |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Details of the job template. |
||
| TemplateId |
string |
The ID of the job template. |
tplmceolmf2**** |
| TemplateName |
string |
The name of the job template. |
job-template-example-1778047**** |
| Description |
string |
A description of the job template. |
job template description |
| Metadata |
object |
A collection of user-defined key-value pairs. |
{} |
| UserId |
string |
The ID of the user who created the job template. |
20**************26 |
| WorkspaceId |
string |
The ID of the workspace that contains the job template. |
4***9 |
| TenantId |
string |
The ID of the tenant that owns the job template. |
142388383837**** |
| DefaultVersion |
integer |
The default version of the job template. |
2 |
| GmtCreateTime |
string |
The time the job template was created. |
2026-01-08T14:17:55Z |
| GmtModifyTime |
string |
The time the job template was last modified. |
2026-03-03T05:48:02Z |
| ModifiedBy |
string |
The ID of the user who last modified the job template. |
20**************26 |
| Versions |
array<object> |
An array of template versions. This array contains only one version if a specific version is requested, or all versions if |
|
|
array<object> |
Details of a template version. |
||
| Version |
integer |
The version number. |
2 |
| Content |
any |
The configuration of the version, in JSON format. |
{\"WorkspaceId\":\"15****05\",\"JobType\":\"PyTorchJob\",\"UserCommand\":\"echo hello\",\"JobSpecs\":[{\"Type\":\"Worker\",\"PodCount\":1,\"Image\":\"dsw-registry-vpc.cn-hangzhou.cr.aliyuncs.com/pai/pytorch:2.8.0-gpu-py313-cu129-ubuntu22.04-3995b779-1764361782\",\"EcsSpec\":\"ecs.gn7i-c8g1.2xlarge\"}],\"ResourceType\":\"ECS\",\"_ResourcePaymentType\":\"PostPaid\",\"CredentialConfig\":{\"EnableCredentialInject\":false},\"Accessibility\":\"PRIVATE\",\"Settings\":{\"JobReservedMinutes\":0,\"Tags\":{}}} |
| Constraints |
object |
The field constraint rules. The key is a JSONPath expression and the value is a constraint type. |
{\"JobSpecs[0].Image\":\"locked\",\"UserCommand\":\"locked\",\"JobType\":\"locked\"} |
| CreatedBy |
string |
The ID of the user who created the version. |
20**************26 |
| GmtCreateTime |
string |
The time the version was created. |
2026-01-08T14:17:55Z |
| TotalCount |
integer |
The total number of versions returned. This value is 1 if a specific version is queried, or the total count if all versions are queried. |
100 |
| RequestId |
string |
The ID of the request. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
Examples
Success response
JSON format
{
"TemplateId": "tplmceolmf2****",
"TemplateName": "job-template-example-1778047****",
"Description": "job template description",
"Metadata": {},
"UserId": "20**************26",
"WorkspaceId": "4***9",
"TenantId": "142388383837****",
"DefaultVersion": 2,
"GmtCreateTime": "2026-01-08T14:17:55Z",
"GmtModifyTime": "2026-03-03T05:48:02Z",
"ModifiedBy": "20**************26",
"Versions": [
{
"Version": 2,
"Content": "{\\\"WorkspaceId\\\":\\\"15****05\\\",\\\"JobType\\\":\\\"PyTorchJob\\\",\\\"UserCommand\\\":\\\"echo hello\\\",\\\"JobSpecs\\\":[{\\\"Type\\\":\\\"Worker\\\",\\\"PodCount\\\":1,\\\"Image\\\":\\\"dsw-registry-vpc.cn-hangzhou.cr.aliyuncs.com/pai/pytorch:2.8.0-gpu-py313-cu129-ubuntu22.04-3995b779-1764361782\\\",\\\"EcsSpec\\\":\\\"ecs.gn7i-c8g1.2xlarge\\\"}],\\\"ResourceType\\\":\\\"ECS\\\",\\\"_ResourcePaymentType\\\":\\\"PostPaid\\\",\\\"CredentialConfig\\\":{\\\"EnableCredentialInject\\\":false},\\\"Accessibility\\\":\\\"PRIVATE\\\",\\\"Settings\\\":{\\\"JobReservedMinutes\\\":0,\\\"Tags\\\":{}}}",
"Constraints": {
"test": "test",
"test2": 1
},
"CreatedBy": "20**************26",
"GmtCreateTime": "2026-01-08T14:17:55Z"
}
],
"TotalCount": 100,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.