九章智算云
修改排队优先级

修改排队中任务的优先级。同步完成:仅 Queued 状态可调用,取值 1~3,数值越小优先级越高。任务 ID 可从任务列表获取,当前优先级可在任务详情中查看。

POSThttps://api.alayanew.com/api/osm/v1/training/instance/{id}/update-priority

鉴权(Authorizations)

AuthorizationString必填

用户获取Authorization请求头后,通过该请求头完成身份认证。例如:Authorization: [your-auth-header]。

Path Parameters

idString必填

训练任务 ID(来自任务列表的 id)。例如:a3c8f6d1-7b42-4e95-9d20-8f1a4c6b3e58。

Request body

priorityInteger必填

任务优先级,取值范围 1~3,数值越小优先级越高。例如:1。

Response

statusInteger

业务状态码,200 表示修改成功;失败时为错误码。

messageString

响应信息,成功为 "OK";失败时为错误描述。

curl -X 'POST' \
  'https://api.alayanew.com/api/osm/v1/training/instance/a3c8f6d1-7b42-4e95-9d20-8f1a4c6b3e58/update-priority' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: [your-auth-header]' \
  -d '{
  "priority": 1
}'
import requests

task_id = "a3c8f6d1-7b42-4e95-9d20-8f1a4c6b3e58"
url = f"https://api.alayanew.com/api/osm/v1/training/instance/{task_id}/update-priority"
headers = {
    "accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "[your-auth-header]"
}
payload = {"priority": 1}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
const taskId = 'a3c8f6d1-7b42-4e95-9d20-8f1a4c6b3e58';

fetch(`https://api.alayanew.com/api/osm/v1/training/instance/${taskId}/update-priority`, {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'Content-Type': 'application/json',
    'Authorization': '[your-auth-header]'
  },
  body: JSON.stringify({ priority: 1 })
})
  .then(res => res.json())
  .then(console.log)
  .catch(console.error);
{
  "status": 200,
  "message": "OK"
}

最后更新于