九章智算云
获取访问凭证

获取实例的 SSH 连接信息(连接命令与密码)。要求实例处于运行中(RUNNING)状态。同步返回。

POSThttps://api.alayanew.com/api/osm/v1/cci/instance/{id}/get-ssh

鉴权(Authorizations)

AuthorizationString必填

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

Path Parameters

idString必填

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

Response

statusInteger

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

messageString

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

dataObject

SSH 连接信息。

显示 properties
urlString

SSH 连接命令。例如:"ssh root@10.225.100.13 -p 31511"。

passwordString

SSH 连接密码。例如:"Ew7p1c9Kz2Qa"。

curl -X 'POST' \
  'https://api.alayanew.com/api/osm/v1/cci/instance/2006a5d0-0a55-4e8f-9d3c-b7a1f20c5d88/get-ssh' \
  -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}/get-ssh"
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}/get-ssh`, {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'Authorization': '[your-auth-header]'
  }
})
  .then(res => res.json())
  .then(console.log)
  .catch(console.error);
{
  "status": 200,
  "message": "OK",
  "data": {
    "url": "ssh root@10.225.100.13 -p 31511",
    "password": "Ew7p1c9Kz2Qa"
  }
}

最后更新于