Creates a subscription or pay-as-you-go gateway.
Operation description
Description
Before you call this operation, make sure that the following requirements are met:
-
You understand the billing methods and pricing of Cloud Storage Gateway.
-
You have registered an Alibaba Cloud account and completed real-name verification.
-
You have activated the Cloud Storage Gateway service.
-
A virtual private cloud (VPC) and a vSwitch are available in the region where you want to create the cloud gateway.
-
An Elastic Compute Service (ECS) instance is available in the region where you want to create the cloud gateway. The ECS instance is assigned to the VPC.
-
A gateway cluster is available. If a gateway cluster is not available, you can call the CreateStorageBundle operation to create one.
-
If the gateway uses the subscription billing method, you must use the purchase URL returned by this operation to complete the purchase after the gateway is created.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hcs-sgw:CreateGateway |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StorageBundleId |
string |
No |
The ID of the gateway cluster. You must specify this parameter if you do not specify ResourceRegionId. |
sb-0001b2otnkdxrigeq*** |
| Name |
string |
Yes |
The name of the gateway. The name must be 60 characters in length. The name must start with a letter or a Chinese character. The name can contain letters, Chinese characters, digits, underscores (_), hyphens (-), and periods (.). |
alex*** |
| Description |
string |
No |
The description of the gateway. The description can be 0 to 255 characters in length. |
|
| Category |
string |
No |
The category of the gateway. The default value is |
|
| Type |
string |
Yes |
The type of the gateway. Valid values:
|
File |
| Location |
string |
Yes |
The location of the gateway. Valid values:
|
Cloud |
| GatewayClass |
string |
No |
The gateway class. This parameter is related to fees. For more information, see Billable items and billing methods. If your gateway is deployed in a data center, which is an on-premises gateway, you can ignore this parameter. If your gateway is deployed on Alibaba Cloud, which is a cloud gateway, valid values are:
|
Basic |
| VSwitchId |
string |
No |
The ID of the virtual switch. If your gateway is deployed in a data center, you can ignore this parameter.
|
vsw-bp1krhkglx3nahkb9s*** |
| PostPaid |
boolean |
No |
The billing method of the gateway. This parameter is related to fees. For more information, see Billable items and billing methods. Valid values:
Default value: false (subscription). |
true |
| ReleaseAfterExpiration |
boolean |
No |
Specifies whether to release the gateway when the subscription expires. Valid values: true: The gateway is automatically released. false: The billing method of the gateway is automatically changed to pay-as-you-go after the subscription expires. |
true |
| PublicNetworkBandwidth |
integer |
No |
The public bandwidth for data transmission. Unit: Mbit/s. Valid values: 5 to 200. This parameter is related to fees. For more information, see Billable items and billing methods. Note
|
50 |
| ResourceRegionId |
string |
No |
The ID of the resource region. |
cn-hangzhou |
| UntrustedEnvInstanceType |
string |
No |
The actual gateway class in an untrusted environment (CloudBox). |
|
| UntrustedEnvId |
string |
No |
The ID of the instance in an untrusted environment (CloudBox). |
|
| SecondaryVSwitchId |
string |
No |
The ID of the vSwitch for the secondary node of the high-availability (HA) gateway. |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
|||
| BuyURL |
string |
The purchase URL. |
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 |
| RequestId |
string |
The request ID. |
8E69E1A1-9076-4C8C-8ADF-ACD253886E22 |
| Message |
string |
The description of the request result. |
successful |
| GatewayId |
string |
The gateway ID. |
gw-0001xv7je357zm9u6*** |
| 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}®ionId=cn-hangzhou#/buy",
"RequestId": "8E69E1A1-9076-4C8C-8ADF-ACD253886E22",
"Message": "successful",
"GatewayId": "gw-0001xv7je357zm9u6***",
"Code": "200",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | EmptyGatewayName | You must enter a valid name for the gateway. | You must enter a valid name for the gateway. |
| 400 | InvalidGatewayName | The specified name of the gateway is invalid. The name must be 1 to 60 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter. | The specified name of the gateway is invalid. The name must be 1 to 60 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter. |
| 400 | DescriptionOverLimit | The length of the specified gateway description exceeds the maximum limit. The description cannot exceed 255 characters. | The length of the specified gateway description exceeds the maximum limit. The description cannot exceed 255 characters. |
| 400 | EmptyStorageBundleId | You must enter a valid ID for the gateway cluster. | You must enter a valid ID for the gateway cluster. |
| 400 | InvalidGatewayClass | The specified specification of the gateway is invalid. | The specified specification of the gateway is invalid. |
| 400 | InvalidGatewayType | The specified type of the gateway is invalid. | The specified type of the gateway is invalid. |
| 400 | InvalidVSwitchId | The specified VSwitch ID does not exist. | The specified VSwitch ID does not exist. |
| 400 | NoAvailableOnlineResource | There are no cloud gateways available. We recommend that you select a different specification or VSwitch that resides in another zone. | There are no cloud gateways available. We recommend that you select a different specification or VSwitch that resides in another zone. |
| 400 | DuplicateGatewayName | The specified name of the gateway already exists. You must specify a valid name. | The specified name of the gateway already exists. You must specify a valid name. |
| 400 | InvalidGatewayBandwidth | The specified public network bandwidth for the gateway is invalid. The bandwidth ranges from 6 to 200 Mbit/s. | The specified public network bandwidth for the gateway is invalid. The bandwidth ranges from 6 to 200 Mbit/s. |
| 400 | GatewayBandwidthNotSupported | You cannot decrease the public network bandwidth of a On Premise Gateway. | You cannot decrease the public network bandwidth of a On Premise Gateway. |
| 400 | InvalidGatewayLocation | The specified location of the gateway is invalid. | The specified location of the gateway is invalid. |
| 400 | ServiceReleased | Service is released, please open service again. | Service is released, please open service again. |
| 404 | StorageBundleNotExist | The name you specified for the gateway cluster does not exist. You must specify a valid parameter. | The name you specified for the gateway cluster does not exist. You must specify a valid parameter. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.