GetJobTemplate
Retrieves the details of a task template.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
paidlc:GetJobTemplate |
get |
*All Resource
|
None | None |
Request syntax
GET /api/v1/jobtemplates/{TemplateId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TemplateId |
string |
Yes |
The unique identifier of the task template. |
tplmceolmf2**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Version |
string |
No |
The version number. If you do not specify this parameter, the default version is returned. If you specify a number, the specified version is returned. If you specify all, all versions are returned. |
all |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The task template details. |
||
| TemplateId |
string |
The unique identifier of the task template. |
tplmceolmf2**** |
| TemplateName |
string |
The name of the task template. |
job-template-example-1778047**** |
| Description |
string |
The description of the task template. |
job template description |
| Metadata |
object |
The custom key-value pair metadata defined by the user. |
{} |
| UserId |
string |
The ID of the user who created the template. |
20**************26 |
| WorkspaceId |
string |
The ID of the workspace to which the template belongs. |
4***9 |
| TenantId |
string |
The ID of the tenant to which the template belongs. |
142388383837**** |
| DefaultVersion |
integer |
The default version number currently in use. |
2 |
| GmtCreateTime |
string |
The time when the template was created. |
2026-01-08T14:17:55Z |
| GmtModifyTime |
string |
The time when the template was last modified. |
2026-03-03T05:48:02Z |
| LastUsedTime |
string |
The time when the template was last used. |
2026-09-03T11:30:00Z |
| ModifiedBy |
string |
The ID of the user who last modified the template. |
20**************26 |
| Versions |
array<object> |
The list of template version details. When a single version is queried, one element is returned. When all versions are queried, all elements are returned. |
|
|
array<object> |
The version details. |
||
| Version |
integer |
The version number. |
2 |
| Content |
any |
The template configuration content of this 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 the 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 when the version was created. |
2026-01-08T14:17:55Z |
| TotalCount |
integer |
The total number of versions. If a single version is queried, 1 is returned. If all versions are queried, the actual total number is returned. |
100 |
| RequestId |
string |
The ID of the request, which is used for diagnostics and troubleshooting. |
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",
"LastUsedTime": "2026-09-03T11:30:00Z",
"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.