修改优先级
修改排队中实例的优先级,取值范围 1~3,数值越小优先级越高。适用于 GPU 资源排队场景。
POST
https://api.alayanew.com/api/osm/v1/cci/instance/{id}/update-priority鉴权(Authorizations)
bearerAuthAuthorizationString必填用户获取Authorization请求头后,通过该请求头完成身份认证。例如:Authorization: [your-auth-header]。
Path Parameters
idString必填实例 ID(来自查询实例列表的 id)。例如:2006a5d0-0a55-4e8f-9d3c-b7a1f20c5d88。
Request body
application/jsonpriorityInteger必填优先级,取值 1~3,数值越小优先级越高。例如:1。
Response
application/json · 200statusInteger业务状态码,200 表示修改成功;失败时为错误码。
messageString响应信息,成功为 "OK";失败时为错误描述。
curl -X 'POST' \
'https://api.alayanew.com/api/osm/v1/cci/instance/2006a5d0-0a55-4e8f-9d3c-b7a1f20c5d88/update-priority' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: [your-auth-header]' \
-d '{
"priority": 1
}'import requests
instance_id = "2006a5d0-0a55-4e8f-9d3c-b7a1f20c5d88"
url = f"https://api.alayanew.com/api/osm/v1/cci/instance/{instance_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 instanceId = '2006a5d0-0a55-4e8f-9d3c-b7a1f20c5d88';
const payload = { priority: 1 };
fetch(`https://api.alayanew.com/api/osm/v1/cci/instance/${instanceId}/update-priority`, {
method: 'POST',
headers: {
'accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': '[your-auth-header]'
},
body: JSON.stringify(payload)
})
.then(res => res.json())
.then(console.log)
.catch(console.error);{
"status": 200,
"message": "OK"
}最后更新于
