九章智算云

查询存储实例开通上限

查询当前企业(租户)在指定智算中心还能开通多少个 NAS 存储实例,用于在创建存储前做配额校验:返回已开通数量、最大可开通数量,以及是否已达上限。建议在开通入口先调用本接口判断 limitReached,若为 true 则提示用户先释放闲置实例,避免提交后被拒。

GEThttps://api.alayanew.com/v1/nasStorage/instance/tenant/limit

鉴权(Authorizations)

AuthorizationString必填

用户可通过已获取的 Open API Key 做验证。例如:Bearer [YOUR_API_KEY]

Query Parameters

tenantIdString必填

企业(租户)ID,统计该企业下的存储实例开通情况。例如:ca78d6b9-e196-5a0f-b1be-ab036b3cb91a

aidcIdInteger

智算中心(AIDC)ID。指定后仅统计该智算中心范围内的开通情况;不传则按企业整体口径统计。例如:1

storageTypeString

存储类型,用于按存储类型分别核算上限。例如:nas-capacity(大容量型)、nas-performance(性能型)。不传则不区分类型。

Response

statusInteger

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

messageString

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

dataObject

存储实例开通上限信息。

显示 properties
currentCountInteger

当前租户已开通的存储实例数量。例如:3

maxCountInteger

最大可开通存储实例数量(上限)。例如:10

limitReachedBoolean

是否已达到上限。true 表示已无可开通名额、false 表示仍可继续开通。通常当 currentCount 等于 maxCount 时为 true

curl -X 'GET' \
  'https://api.alayanew.com/v1/nasStorage/instance/tenant/limit?tenantId=ca78d6b9-e196-5a0f-b1be-ab036b3cb91a&aidcId=1&storageType=nas-capacity' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer [YOUR_API_KEY]'
import requests

url = "https://api.alayanew.com/v1/nasStorage/instance/tenant/limit"
params = {
    "tenantId": "ca78d6b9-e196-5a0f-b1be-ab036b3cb91a",
    "aidcId": 1,
    "storageType": "nas-capacity"
}
headers = {
    "accept": "application/json",
    "Authorization": "Bearer [YOUR_API_KEY]"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
const params = new URLSearchParams({
  tenantId: 'ca78d6b9-e196-5a0f-b1be-ab036b3cb91a',
  aidcId: '1',
  storageType: 'nas-capacity'
});

fetch(`https://api.alayanew.com/v1/nasStorage/instance/tenant/limit?${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": {
    "currentCount": 3,
    "maxCount": 10,
    "limitReached": false
  }
}
{
  "status": 403,
  "message": "Forbidden",
  "data": {}
}
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}

最后更新于