九章智算云

删除训练任务模版

按模版 ID 删除一个训练任务模版。删除后该模版不再出现在训练任务模版列表中,但不影响已基于该模版创建的训练任务。此操作不可恢复,请谨慎执行。

DELETEhttps://api.alayanew.com/v1/training/template/{id}/delete

鉴权(Authorizations)

AuthorizationString必填

用户可通过已获取的 Open API Key 做验证。例如:Bearer [YOUR_API_KEY]

Path Parameters

idString必填

待删除的训练任务模版 ID(来自模版列表id)。例如:tpl_6f1a62c0a5bf4e0c9b2f

Response

statusInteger

业务状态码,200 表示成功。

messageString

接口响应信息。例如:"OK"

dataObject

删除结果。删除成功时不返回额外业务数据。

curl -X 'DELETE' \
  'https://api.alayanew.com/v1/training/template/tpl_6f1a62c0a5bf4e0c9b2f/delete' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer [YOUR_API_KEY]'
import requests

template_id = "tpl_6f1a62c0a5bf4e0c9b2f"
url = f"https://api.alayanew.com/v1/training/template/{template_id}/delete"
headers = {
    "accept": "application/json",
    "Authorization": "Bearer [YOUR_API_KEY]"
}

response = requests.delete(url, headers=headers)
print(response.json())
const templateId = 'tpl_6f1a62c0a5bf4e0c9b2f';

fetch(`https://api.alayanew.com/v1/training/template/${templateId}/delete`, {
  method: 'DELETE',
  headers: {
    'accept': 'application/json',
    'Authorization': 'Bearer [YOUR_API_KEY]'
  }
})
  .then(res => res.json())
  .then(console.log)
  .catch(console.error);
{
  "status": 200,
  "message": "OK",
  "data": {}
}
{
  "status": 403,
  "message": "Forbidden",
  "data": {}
}
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}

最后更新于