平台端存储售卖与使用统计
平台(管理)端按存储类型查询 NAS 存储资源的售卖与使用汇总,返回可售卖容量、已占用容量、已使用容量与已开通实例数,用于运营侧评估存储资源池的水位与余量。容量单位为 TB(与企业存储用量概览的 GB 口径不同,使用时请注意单位换算)。
GET
https://api.alayanew.com/v1/nasStorage/instance/platform/statistics鉴权(Authorizations)
bearerAuthAuthorizationString必填用户可通过已获取的 Open API Key 做验证。例如:Bearer [YOUR_API_KEY]。
Query Parameters
storageTypeString必填存储类型,按该类型汇总统计。例如:nas-capacity(大容量型)、nas-performance(性能型)。
aidcIdInteger智算中心(AIDC)ID。指定后仅统计该智算中心范围内的资源;不传则按全局口径统计。例如:1。
Response
application/json · 200statusInteger业务状态码,200 表示成功。
messageString接口响应信息。例如:"OK"。
dataObjectNAS 存储资源售卖与使用统计信息。
显示 properties
usedCapacityNumber已使用容量(TB)。例如:12.5。
occupiedCapacityNumber占用(已开通)容量(TB)。即所有实例配额之和,通常不小于 usedCapacity。例如:50。
soldCapacityNumber可售卖容量(TB),即资源池可继续开通的总容量。例如:200。
activatedInstanceCountInteger已开通实例数量。例如:128。
curl -X 'GET' \
'https://api.alayanew.com/v1/nasStorage/instance/platform/statistics?storageType=nas-capacity&aidcId=1' \
-H 'accept: application/json' \
-H 'Authorization: Bearer [YOUR_API_KEY]'import requests
url = "https://api.alayanew.com/v1/nasStorage/instance/platform/statistics"
params = {
"storageType": "nas-capacity",
"aidcId": 1
}
headers = {
"accept": "application/json",
"Authorization": "Bearer [YOUR_API_KEY]"
}
response = requests.get(url, params=params, headers=headers)
print(response.json())const params = new URLSearchParams({
storageType: 'nas-capacity',
aidcId: '1'
});
fetch(`https://api.alayanew.com/v1/nasStorage/instance/platform/statistics?${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": {
"usedCapacity": 12.5,
"occupiedCapacity": 50,
"soldCapacity": 200,
"activatedInstanceCount": 128
}
}{
"status": 403,
"message": "Forbidden",
"data": {}
}{
"status": 500,
"message": "Internal Server Error",
"data": {}
}Last updated on
