Updates a job template.
Try it now
Test
RAM authorization
Request syntax
PUT /api/v1/jobtemplates/{TemplateId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TemplateId |
string |
Yes |
The unique identifier of the job template. |
tplmceolmf2**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| TemplateName |
string |
No |
The name of the job template. |
job-template-example-1778047**** |
| Description |
string |
No |
The description of the job template. |
Template description |
| Metadata |
object |
No |
User-defined key-value pairs. |
{} |
| Content |
string |
No |
The configuration content of the job template. This parameter supports all fields from the |
{\"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 |
No |
The field constraints. The key is a JSONPath expression and the value is the constraint type. Valid values are |
{\"JobSpecs[0].Image\":\"locked\",\"UserCommand\":\"locked\",\"JobType\":\"locked\"} |
| SetAsDefault |
boolean |
No |
If |
true |
| version |
integer |
No |
This field is not supported. |
无效字段 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Version |
integer |
The version number. |
2 |
| VersionCreated |
boolean |
Indicates whether a new version was created. |
true |
| DefaultVersion |
integer |
The default version number. |
2 |
| GmtModifyTime |
string |
The time the template was last modified. |
2021-01-12T14:36:00Z |
| RequestId |
string |
The request ID, used for diagnostics and troubleshooting. |
473469C7-AA6F-4DC5-B3DB-xxxxxxx |
Examples
Success response
JSON format
{
"Version": 2,
"VersionCreated": true,
"DefaultVersion": 2,
"GmtModifyTime": "2021-01-12T14:36:00Z",
"RequestId": "473469C7-AA6F-4DC5-B3DB-xxxxxxx"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.