在网关下创建一个缓存盘。
接口说明
接口说明
使用该接口时,需要注意如下事项:
仅对线上网关有效
如果网关是预付费,该接口会返回一个 buyURL, 需要完成支付后,缓存盘会被自动创建完成。
如果网关是后付费,该接口会返回对应创建缓存盘的任务 ID。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
hcs-sgw:CreateGatewayCacheDisk |
create |
*全部资源
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
GatewayId |
string |
是 |
网关 ID。 |
gw-000eg44nmxbsfwbvq*** |
CacheDiskCategory |
string |
否 |
缓存盘的类型。取值范围:
|
cloud_efficiency |
CacheDiskSizeInGB |
integer |
是 |
缓存盘的容量大小。单位:GB。缓存盘容量要求:
|
100 |
PerformanceLevel |
string |
否 |
ESSD 云盘性能等级。当 CacheDiskCategory 取值为 cloud_essd 时需要传入此参数。取值范围:
|
PL1 |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
|||
BuyURL |
string |
预付费情况下, 售卖链接。 |
https://common-buy.aliyun.com/?commodityCode=hcs_sgw_csg_pre&request={"gateway_id":"gw-0007va9bnidei3s8a***","directBuy":"false","gateway_class":"standard","cache_cloud_efficiency_size":0}®ionId=cn-hangzhou#/buy |
TaskId |
string |
按量付费情况下,创建缓存盘的任务 ID。 |
t-0001xv7je357xv4st*** |
RequestId |
string |
请求 ID。 |
8E69E1A1-9076-4C8C-8ADF-ACD253886E22 |
Message |
string |
请求结果描述。 |
successful |
Code |
string |
状态码。状态码为 200 表示请求成功。 |
200 |
Success |
boolean |
请求是否成功。 |
true |
示例
正常返回示例
JSON
格式
{
"BuyURL": "https://common-buy.aliyun.com/?commodityCode=hcs_sgw_csg_pre&request={\"gateway_id\":\"gw-0007va9bnidei3s8a***\",\"directBuy\":\"false\",\"gateway_class\":\"standard\",\"cache_cloud_efficiency_size\":0}®ionId=cn-hangzhou#/buy",
"TaskId": "t-0001xv7je357xv4st***",
"RequestId": "8E69E1A1-9076-4C8C-8ADF-ACD253886E22",
"Message": "successful",
"Code": "200",
"Success": true
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 | LocationCloudRequired | You must specify a cloud gateway. Try again later. | 需要网关为线上网关,请检查后重试。 |
400 | BadRequest | Invalid request. You must specify valid parameters in the request. | 非法请求,请检查请求参数。 |
400 | GatewayOperationNotAllowed | You cannot perform the operation when the gateway is in the current state. | 网关当前状态不允许执行该操作。 |
400 | InvalidCacheDiskCategory | The category that you specified for the cache disk is invalid. You must specify a valid category. | 无效的缓存盘类型。 |
400 | CacheSizeLimitForBasic | The specified scale-up size exceeds the maximum limit. The maximum scale-up size of cache disks for a Basic gateway is 4 TB. | 扩容量超过最大缓存盘上限,基础型网关缓存盘上限为4 TB。 |
400 | CacheSizeLimitForStandard | The specified scale-up size exceeds the maximum limit. The maximum scale-up size of cache disks for a Standard gateway is 8 TB. | 扩容量超过最大缓存盘上限,标准型网关缓存盘上限为8 TB。 |
400 | CacheSizeLimit | The maximum size of cache disks for the gateway is 32 TB. | 网关缓存盘大小上限32 TB。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。