查询产品是否开通
检查当前企业是否已在指定智算中心开通分布式训练产品。建议在调用创建分布式训练任务前先调用本接口,确认产品可用后再发起创建。
GET
https://api.alayanew.com/v1/training/instance/checkIsEnabled鉴权(Authorizations)
bearerAuthAuthorizationString必填用户可通过已获取的 Open API Key 做验证。例如:Bearer [YOUR_API_KEY]。
Query Parameters
aidcIdInteger智算中心 ID,指定要查询的智算中心。选填,不传时按默认智算中心判断。例如:1001。
Response
application/json · 200statusInteger业务状态码,200 表示查询成功。
messageString接口响应信息。例如:"OK"。
dataBoolean产品开通状态:true 表示已开通分布式训练产品,false 表示未开通。
curl -X 'GET' \
'https://api.alayanew.com/v1/training/instance/checkIsEnabled?aidcId=1001' \
-H 'accept: application/json' \
-H 'Authorization: Bearer [YOUR_API_KEY]'import requests
url = "https://api.alayanew.com/v1/training/instance/checkIsEnabled"
params = {"aidcId": 1001}
headers = {
"accept": "application/json",
"Authorization": "Bearer [YOUR_API_KEY]"
}
response = requests.get(url, params=params, headers=headers)
print(response.json())const params = new URLSearchParams({ aidcId: '1001' });
fetch(`https://api.alayanew.com/v1/training/instance/checkIsEnabled?${params}`, {
method: 'GET',
headers: {
'accept': 'application/json',
'Authorization': 'Bearer [YOUR_API_KEY]'
}
})
.then(res => res.json())
.then(console.log)
.catch(console.error);{
"status": 200,
"message": "OK",
"data": true
}{
"status": 403,
"message": "Forbidden",
"data": {}
}{
"status": 500,
"message": "Internal Server Error",
"data": {}
}Last updated on
