扩容 / 缩容
调整实例容量,同步完成;完成后按新容量计费;实例须为活跃状态。
capacity 为容量变化量而非目标容量:扩容 = 目标容量 − 当前容量,缩容 = 当前容量 − 目标容量;容量上下限与步进以可售 SKU 列表的规格为准,缩容下限为规格最小值与已用量的较大者。全闪(nas-performance)与 AI DingoFS(nas-ai-dingofs)仅支持扩容,不支持缩容。
POST
https://api.alayanew.com/api/osm/v1/nasStorage/instance/{id}/scale鉴权(Authorizations)
bearerAuthAuthorizationString必填用户获取Authorization请求头后,通过该请求头完成身份认证。例如:Authorization: [your-auth-header]。
Path Parameters
idString必填实例 ID(来自分页查询 NAS 实例列表的 id)。例如:3f2b8c94-6d17-4a52-9c8e-7b1d0a5f6e21。
Request body
application/jsonscaleTypeString必填ScaleUp 扩容 / ScaleDown 缩容。
capacityLong必填容量变化量(GB),须大于 0。例如:50。
Response
application/json · 200statusInteger业务状态码,200 表示成功;失败时为错误码。
messageString响应信息,成功为 "OK";失败时为错误描述。
curl -X 'POST' \
'https://api.alayanew.com/api/osm/v1/nasStorage/instance/3f2b8c94-6d17-4a52-9c8e-7b1d0a5f6e21/scale' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: [your-auth-header]' \
-d '{
"scaleType": "ScaleUp",
"capacity": 50
}'import requests
instance_id = "3f2b8c94-6d17-4a52-9c8e-7b1d0a5f6e21"
url = f"https://api.alayanew.com/api/osm/v1/nasStorage/instance/{instance_id}/scale"
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": "[your-auth-header]"
}
payload = {
"scaleType": "ScaleUp",
"capacity": 50
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())const instanceId = '3f2b8c94-6d17-4a52-9c8e-7b1d0a5f6e21';
const payload = {
scaleType: 'ScaleUp',
capacity: 50
};
fetch(`https://api.alayanew.com/api/osm/v1/nasStorage/instance/${instanceId}/scale`, {
method: 'POST',
headers: {
'accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': '[your-auth-header]'
},
body: JSON.stringify(payload)
})
.then(res => res.json())
.then(console.log)
.catch(console.error);{
"status": 200,
"message": "OK"
}最后更新于
