Creates a cache disk for a gateway.
When you call the operation, take note of the following information:
- You can create a cache disk only for a gateway that is deployed in Alibaba Cloud.
- If the billing method of the gateway is subscription, you need to click the URL that is returned as a response parameter to purchase a cache disk.
- If the billing method of the gateway is pay-as-you-go, the ID of the task used to create a cache disk is returned.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateGatewayCacheDisk |
The operation that you want to perform. Set the value to CreateGatewayCacheDisk. |
CacheDiskSizeInGB | Long | Yes | 60 |
The capacity of the cache disk. Unit: GB. Take note of the following information:
|
GatewayId | String | Yes | gw-000eg44nmxbsfwbvq*** |
The ID of the gateway. |
CacheDiskCategory | String | No | cloud_efficiency |
The type of the cache disk. Valid values:
Default value: cloud_efficiency |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
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 |
The URL of the CSG buy page. The parameter takes effect only when the billing method of the cache disk is subscription. |
Code | String | 200 |
The HTTP status code. If the request is successful, 200 is returned. |
Message | String | successful |
The description of the status code. |
RequestId | String | 8E69E1A1-9076-4C8C-8ADF-ACD253886E22 |
The ID of the request. |
Success | Boolean | true |
Indicates whether the request is successful. |
TaskId | String | t-0001xv7je357xv4st*** |
The ID of the task that is used to create the cache disk. The parameter takes effect only when the billing method of the cache disk is pay-as-you-go. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CreateGatewayCacheDisk
&CacheDiskSizeInGB=60
&GatewayId=gw-000eg44nmxbsfwbvq***
&<Common request parameters>
Sample success responses
XML
format
<CreateGatewayCacheDiskResponse>
<Message>successful</Message>
<RequestId>8E69E1A1-9076-4C8C-8ADF-ACD253886E22</RequestId>
<TaskId>t-0001xv7je357xv4st***</TaskId>
<BuyURL>https://common-buy.aliyun.com/?commodityCode=hcs_sgw_csg_pre&request=%7B%22gateway_id%22:%22gw-0007va9bnidei3s8a09e%22,%22directBuy%22:%22false%22,%22gateway_class%22:%22standard%22,%22cache_cloud_efficiency_size%22:0%7D®ionId=cn-hangzhou#/buy</BuyURL>
<Code>200</Code>
<Success>true</Success>
</CreateGatewayCacheDiskResponse>
JSON
format
{
"Message":"successful",
"RequestId":"8E69E1A1-9076-4C8C-8ADF-ACD253886E22",
"TaskId":"t-0001xv7je357xv4st***",
"BuyURL":"https://common-buy.aliyun.com/?commodityCode=hcs_sgw_csg_pre&request=%7B%22gateway_id%22:%22gw-0007va9bnidei3s8a09e%22,%22directBuy%22:%22false%22,%22gateway_class%22:%22standard%22,%22cache_cloud_efficiency_size%22:0%7D®ionId=cn-hangzhou#/buy",
"Code":"200",
"Success":true
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | LocationCloudRequired | You must specify a cloud gateway. Try again later. | The error message returned because the gateway is not deployed in Alibaba Cloud. |
400 | CacheSizeLimitForBasic | The specified scale-up size exceeds the maximum limit. The maximum scale-up size of cache disks for a Basic gateway is 1 TB. | The error message returned because the scaling step size of the cache disk for the basic gateway exceeds the upper limit, which is 1 TB. |
400 | BadRequest | Invalid request. You must specify valid parameters in the request. | The error message returned because the request is invalid. Check the request parameters and try again. |
400 | CacheSizeLimitForStandard | The specified scale-up size exceeds the maximum limit. The maximum scale-up size of cache disks for a Standard gateway is 2 TB. | The error message returned because the scaling step size of the cache disk for the standard gateway exceeds the upper limit, which is 2 TB. |
400 | CacheSizeLimit | The maximum size of cache disks for the gateway is 32 TB. The maximum scale-up size is 6 TB. | The error message returned because the new capacity of the cache disk is invalid. The maximum capacity of the cache disk is 32 TB and the maximum scaling step size of the cache disk is 6 TB. |
400 | GatewayOperationNotAllowed | You cannot perform the operation when the gateway is in the current state. | The error message returned because the operation is not supported while 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. | The error message returned because the type of the cache disk is invalid. |
For a list of error codes, visit the API Error Center.