All Products
Search
Document Center

Cloud Storage Gateway:ExpandCacheDisk

Last Updated:Feb 27, 2024

Scales up a cache disk for a gateway.

Usage notes

When you call this operation, take note of the following items:

  • You fully understand the billing methods and pricing of Cloud Storage Gateway (CSG).
  • Make sure that you have created a cache disk. You need to click the URL that is returned as a response parameter to scale up the cache disk.
    • The maximum capacity of a single cache disk is 1 TB for a basic gateway, 2 TB for a standard gateway, and 6 TB for other gateway specifications. You can add multiple cache disks to meet your cache capacity requirements.
    • The minimum capacity of a single cache disk is 40 GB for a file gateway and 20 GB for a block gateway.
    • You cannot scale down a cache disk.
    • If a cache disk is attached to a share, delete the share before you scale up the cache disk.
Warning Scaling cache disks will cause temporary business interruptions. Exercise caution when performing this action.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ExpandCacheDisk

The operation that you want to perform. Set the value to ExpandCacheDisk.

GatewayId String Yes gw-000eg44nmxbsfwbvq***

The ID of the gateway.

NewSizeInGB Integer Yes 101

The cache disk capacity after scaling. Unit: GB. Take note of the following requirements for cache scaling:

  • The capacity after scaling must be greater than the original capacity. This is because you cannot scale down a cache disk.
  • The maximum capacity of a single cache disk is 1 TB for a basic gateway, 2 TB for a standard gateway, and 6 TB for other gateway specifications.
  • The minimum capacity of a single cache disk is 40 GB for a file gateway and 20 GB for a block gateway.
LocalFilePath String Yes /dev/vdb

The path of the cache disk. You can query the path of the cache disk by calling the DescribeGatewayCaches operation.

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}&regionId=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.

TaskId String t-000eg44nmxbsh3qk3***

The ID of the task.

RequestId String F8B59F29-453D-49BF-8673-EEB8F9F2D5C6

The ID of the request.

Message String successful

The description of the request result.

Code String 200

The HTTP status code returned. A value of 200 indicates that the request was successful.

Success Boolean true

Indicates whether the request was successful. Valid values:

  • true
  • false

Examples

Sample requests

http(s)://[Endpoint]/?Action=ExpandCacheDisk
&GatewayId=gw-000eg44nmxbsfwbvq***
&NewSizeInGB=101
&LocalFilePath=/dev/vdb
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ExpandCacheDiskResponse>
    <BuyURL>https://common-buy.aliyun.com/?commodityCode=hcs_sgw_csg_pre&amp;request={"gateway_id":"gw-0007va9bnidei3s8a***","directBuy":"false","gateway_class":"standard","cache_cloud_efficiency_size":0}&amp;regionId=cn-hangzhou#/buy</BuyURL>
    <TaskId>t-000eg44nmxbsh3qk3***</TaskId>
    <RequestId>F8B59F29-453D-49BF-8673-EEB8F9F2D5C6</RequestId>
    <Message>successful</Message>
    <Code>200</Code>
    <Success>true</Success>
</ExpandCacheDiskResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/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}&regionId=cn-hangzhou#/buy",
  "TaskId" : "t-000eg44nmxbsh3qk3***",
  "RequestId" : "F8B59F29-453D-49BF-8673-EEB8F9F2D5C6",
  "Message" : "successful",
  "Code" : "200",
  "Success" : true
}

Error codes

HttpCode Error code Error message Description
400 EmptyGatewayId You must enter a valid ID for the gateway. The error message returned because no gateway ID is specified.
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 scaled-up capacity specified for the cache disk exceeds the upper limit of 1 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 2 TB. The error message returned because the scaled-up capacity specified for the cache disk exceeds the upper limit of 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 specified scaled-up capacity of the cache disk is invalid.
400 GatewayNotExist The specified gateway does not exist. You must specify a valid parameter. The error message returned because the specified gateway does not exist. Check whether the parameters are valid.
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 GatewayInOperation The gateway is processing requests. Try again later. The error message returned because another operation is in progress. Try again later.
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 CacheNotExist The specified cache disk does not exist. You must specify a valid parameter. The error message returned because the specified cache disk does not exist. Check whether the parameters are valid.
400 EmptyLocalFilePath You must enter an local file path for the cache disk. The error message returned because the path of the cache disk is not specified.
400 InvalidNewSizeInGB The scale-up size that you specified for the cache disk is invalid. You must specify a valid size. The error message returned because the scaled capacity of the cache disk is invalid. Check whether the parameters are valid.

For a list of error codes, see Service error codes.