All Products
Search
Document Center

Cloud Storage Gateway:CreateGatewayCacheDisk

Last Updated:Oct 12, 2025

Creates a cache disk for a gateway.

Operation description

  • This operation applies only to online gateways.

  • If the gateway uses the subscription billing method, this operation returns a BuyURL. After you complete the payment, the cache disk is automatically created.

  • If the gateway uses the pay-as-you-go billing method, this operation returns the ID of the task that creates the cache disk.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hcs-sgw:CreateGatewayCacheDisk

create

*All Resource

*

None

None

Request parameters

Parameter

Type

Required

Description

Example

GatewayId

string

Yes

The ID of the gateway.

gw-000eg44nmxbsfwbvq***

CacheDiskCategory

string

No

The type of the cache disk. Only Enhanced SSDs (ESSDs) are supported. Set the value to cloud_essd.

cloud_essd

CacheDiskSizeInGB

integer

Yes

The capacity of the cache disk in GB. The capacity must meet the following requirements:

  • For a basic gateway, the capacity must be in the range of 40 GB to 4,096 GB.

  • For a standard gateway, the capacity must be in the range of 40 GB to 8,192 GB.

  • For an enhanced or performance-optimized gateway, the capacity must be in the range of 40 GB to 32,768 GB.

  • If CacheDiskCategory is set to cloud_essd and PerformanceLevel is set to PL2, the minimum capacity is 461 GB.

  • If CacheDiskCategory is set to cloud_essd and PerformanceLevel is set to PL3, the minimum capacity is 1,261 GB.

100

PerformanceLevel

string

No

The performance level of the ESSD. This parameter is required if CacheDiskCategory is set to cloud_essd. Valid values:

  • PL1

  • PL2

  • PL3

PL1

Response elements

Element

Type

Description

Example

object

BuyURL

string

The purchase URL. This parameter is returned for subscription gateways.

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

string

The ID of the task that is used to create the cache disk. This parameter is returned for pay-as-you-go gateways.

t-0001xv7je357xv4st***

RequestId

string

The request ID.

8E69E1A1-9076-4C8C-8ADF-ACD253886E22

Message

string

The response message.

successful

Code

string

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

200

Success

boolean

Indicates whether the request was successful.

true

Examples

Success response

JSON format

{
  "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-0001xv7je357xv4st***",
  "RequestId": "8E69E1A1-9076-4C8C-8ADF-ACD253886E22",
  "Message": "successful",
  "Code": "200",
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

400

LocationCloudRequired

You must specify a cloud gateway. Try again later.

You must specify a cloud gateway. Try again later.

400

BadRequest

Invalid request. You must specify valid parameters in the request. 

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.

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.

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.

The expansion capacity exceeds the maximum cache disk limit. The maximum cache disk limit for Basic Gateway is 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.

The expansion capacity exceeds the maximum cache disk limit. The standard gateway cache disk limit is 8 TB.

400

CacheSizeLimit

The maximum size of cache disks for the gateway is 32 TB.

The maximum cache disk size of the gateway is 32 TB.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.