全部產品
Search
文件中心

Platform For AI:UpdateJobTemplate - 更新工作範本

更新時間:May 07, 2026

更新工作範本。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求文法

PUT /api/v1/jobtemplates/{TemplateId} HTTP/1.1

路徑參數

名稱

類型

必填

描述

樣本值

TemplateId

string

工作範本的唯一標識

tplmceolmf2****

請求參數

名稱

類型

必填

描述

樣本值

body

object

請求 Body 參數。

TemplateName

string

工作範本的名稱

job-template-example-1778047****

Description

string

工作範本的描述資訊

Template description

Metadata

object

使用者自訂的索引值對中繼資料

{}

Content

string

工作範本的配置內容,支援 CreateJob 介面的所有參數欄位,以 JSON 格式傳入。提供時會建立新版本。

{\"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

欄位約束規則。Key 為 JSONPath 運算式,Value 為約束類型:locked(鎖定不可覆蓋)、overridable(可覆蓋)、required(必填)。需與 Content 同時提供,不允許單獨更新。

{\"JobSpecs[0].Image\":\"locked\",\"UserCommand\":\"locked\",\"JobType\":\"locked\"}

SetAsDefault

boolean

當建立了新版本時,是否將新版本設為預設版本。

true

version

integer

無效欄位

無效欄位

返回參數

名稱

類型

描述

樣本值

object

Version

integer

版本號碼

2

VersionCreated

boolean

是否建立了新版本

true

DefaultVersion

integer

當前使用的預設版本號碼

2

GmtModifyTime

string

模板的最後修改時間

2021-01-12T14:36:00Z

RequestId

string

本次請求的 ID,用於診斷和答疑。

473469C7-AA6F-4DC5-B3DB-xxxxxxx

樣本

正常返回樣本

JSON格式

{
  "Version": 2,
  "VersionCreated": true,
  "DefaultVersion": 2,
  "GmtModifyTime": "2021-01-12T14:36:00Z",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-xxxxxxx"
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情