All Products
Search
Document Center

Cloud Storage Gateway:CreateGatewayCacheDisk

Last Updated:Oct 11, 2024

Creates a cache disk for a gateway.

Usage notes

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

  • The operation creates a cache disk only for a gateway that is deployed on Alibaba Cloud.

  • If the billing method of the gateway is subscription, you need to click the URL that is returned in the response 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

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

CreateGatewayCacheDisk

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

GatewayId

String

Yes

gw-000eg44nmxbsfwbvq***

The gateway ID.

CacheDiskCategory

String

No

cloud_efficiency

The type of the cache disk. Valid values:

  • cloud_efficiency: ultra disk (default)

  • cloud_ssd: standard SSD

  • cloud_essd: ESSD

CacheDiskSizeInGB

Long

Yes

100

The capacity of the cache disk. Unit: GB. Take note of the following information:

  • The cache disk capacity for a Basic gateway ranges from 40 GB to 4,096 GB.

  • The cache disk capacity for a Standard gateway ranges from 40 GB to 8,192 GB.

  • The cache disk capacity for an Enhanced or Performance Optimized gateway ranges from 40 GB to 32,768 GB.

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

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

PerformanceLevel

String

No

PL1

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

  • PL1

  • PL2

  • PL3

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 disk buy page. This parameter is returned only if the gateway uses the subscription billing method.

TaskId

String

t-0001xv7je357xv4st***

The ID of the task that is used to create the cache disk. This parameter is returned only if the billing method of the gateway is pay-as-you-go.

RequestId

String

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

The request ID.

Message

String

successful

The description of the request result.

Code

String

200

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

Success

Boolean

true

Indicates whether the request was successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateGatewayCacheDisk
&GatewayId=gw-000eg44nmxbsfwbvq***
&CacheDiskCategory=cloud_efficiency
&CacheDiskSizeInGB=100
&PerformanceLevel=PL1
&<Common request parameters>

Sample success responses

XML format

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

<CreateGatewayCacheDiskResponse>
    <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-0001xv7je357xv4st***</TaskId>
    <RequestId>8E69E1A1-9076-4C8C-8ADF-ACD253886E22</RequestId>
    <Message>successful</Message>
    <Code>200</Code>
    <Success>true</Success>
</CreateGatewayCacheDiskResponse>

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

Error codes

HttpCode

Error code

Error message

Description

400

LocationCloudRequired

You must specify a cloud gateway. Try again later.

The gateway is not deployed on Alibaba Cloud.

400

BadRequest

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

The request is invalid. Check the request parameters and try again.

400

GatewayOperationNotAllowed

You cannot perform the operation when the gateway is in the current state.

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 type of the cache disk is invalid.

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 specified cache disk capacity exceeds the upper limit of 4 TB for a Basic gateway.

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 specified cache disk capacity exceeds the upper limit of 8 TB for a Standard gateway.

400

CacheSizeLimit

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

The maximum cache disk capacity for the gateway is 32 TB.

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