Alaya NeW Cloud

存储实例扩容

对指定 NAS 存储实例进行容量调整。通过 scaleType 指定扩容或缩容,capacity 指定本次变更的容量增量(GB)。扩容用于数据增长时增加可用空间,缩容用于回收冗余配额。

POSThttps://api.alayanew.com/v1/nasStorage/instance/{id}/scale

鉴权(Authorizations)

AuthorizationString必填

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

Path Parameters

idString必填

存储实例 ID。例如:72a2a885-e45e-4c79-aaf3-e1fa05abdb92

Request body

idString

存储实例 ID,与 Path 参数中的 id 保持一致。例如:72a2a885-e45e-4c79-aaf3-e1fa05abdb92

scaleTypeString

扩缩容类型:ScaleUp 表示扩容、ScaleDown 表示缩容。例如:ScaleUp

capacityInteger

扩缩容的容量数量,单位为 GB。表示本次变更的增量/减量容量,而非目标总容量。例如:50

Response

statusInteger

业务状态码,200 表示扩缩容请求已受理。

messageString

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

dataObject

本接口无返回业务数据,成功时为空对象。

curl -X 'POST' \
  'https://api.alayanew.com/v1/nasStorage/instance/72a2a885-e45e-4c79-aaf3-e1fa05abdb92/scale' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer [YOUR_API_KEY]' \
  -d '{
  "id": "72a2a885-e45e-4c79-aaf3-e1fa05abdb92",
  "scaleType": "ScaleUp",
  "capacity": 50
}'
import requests

storage_id = "72a2a885-e45e-4c79-aaf3-e1fa05abdb92"
url = f"https://api.alayanew.com/v1/nasStorage/instance/{storage_id}/scale"
headers = {
    "accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer [YOUR_API_KEY]"
}
payload = {
    "id": storage_id,
    "scaleType": "ScaleUp",
    "capacity": 50
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
const storageId = '72a2a885-e45e-4c79-aaf3-e1fa05abdb92';
const payload = {
  id: storageId,
  scaleType: 'ScaleUp',
  capacity: 50
};

fetch(`https://api.alayanew.com/v1/nasStorage/instance/${storageId}/scale`, {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'Content-Type': 'application/json',
    'Authorization': 'Bearer [YOUR_API_KEY]'
  },
  body: JSON.stringify(payload)
})
  .then(res => res.json())
  .then(console.log)
  .catch(console.error);
{
  "status": 200,
  "message": "OK",
  "data": {}
}
{
  "status": 403,
  "message": "Forbidden",
  "data": {}
}
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}

Last updated on