九章智算云
强制关机

强制关机。适用于关机中(STOPPING)长时间未完成或失败(FAILED)等异常场景,可能丢失未落盘数据。允许在运行中、关机中、失败状态下调用。

关机异步完成:返回后实例进入关机中(STOPPING),可通过查询实例列表或获取实例详情轮询 status 字段,变为 STOPPED 表示关机完成。

POSThttps://api.alayanew.com/api/osm/v1/cci/instance/{id}/stop-force

鉴权(Authorizations)

AuthorizationString必填

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

Path Parameters

idString必填

实例 ID(来自查询实例列表的 id)。例如:2006a5d0-0a55-4e8f-9d3c-b7a1f20c5d88。

Response

statusInteger

业务状态码,200 表示强制关机请求已受理;失败时为错误码。

messageString

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

curl -X 'POST' \
  'https://api.alayanew.com/api/osm/v1/cci/instance/2006a5d0-0a55-4e8f-9d3c-b7a1f20c5d88/stop-force' \
  -H 'accept: application/json' \
  -H 'Authorization: [your-auth-header]'
import requests

instance_id = "2006a5d0-0a55-4e8f-9d3c-b7a1f20c5d88"
url = f"https://api.alayanew.com/api/osm/v1/cci/instance/{instance_id}/stop-force"
headers = {
    "accept": "application/json",
    "Authorization": "[your-auth-header]"
}

response = requests.post(url, headers=headers)
print(response.json())
const instanceId = '2006a5d0-0a55-4e8f-9d3c-b7a1f20c5d88';

fetch(`https://api.alayanew.com/api/osm/v1/cci/instance/${instanceId}/stop-force`, {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'Authorization': '[your-auth-header]'
  }
})
  .then(res => res.json())
  .then(console.log)
  .catch(console.error);
{
  "status": 200,
  "message": "OK"
}

最后更新于