Creates a subscription or pay-as-you-go gateway.
Operation description
Operation description
When you invoke this operation, take note of the following items:
-
- Make sure that you fully understand the billing methods and pricing of Cloud Storage Gateway before you invoke this operation.
-
You have registered an Alibaba Cloud account and completed real-name verification.
-
You have activated Cloud Storage Gateway.
-
You have an active VPC and vSwitch in the region where you want to create a cloud gateway.
-
You have an active Elastic Computing Service in the region where you want to create a cloud gateway, and the server belongs to the VPC that you created.
-
Before you create a gateway, make sure that you have created a gateway cluster. If you have not created a gateway cluster, you can invoke the CreateStorageBundle operation to create one.
-
If the billing method of your gateway is subscription, you must use the purchase URL returned in the response to purchase the gateway after you invoke this operation.
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. This parameter is required if you do not specify the ResourceRegionId parameter. |
sb-0001b2otnkdxrigeq*** |
| Name |
string |
Yes |
The name of the gateway. The name must be 1 to 60 characters in length, start with a letter or a Chinese character, and can contain letters, Chinese characters, digits, underscores (_), hyphens (-), and periods (.). |
alex*** |
| Description |
string |
No |
The description of the gateway. The description must be 0 to 255 characters in length. |
For testing |
| Category |
string |
No |
The category of the gateway. Default value: |
Aliyun |
| 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 specifications of the gateway. This parameter affects billing. For more information, see Billable items and billing methods. If your gateway is deployed in an on-premises data center, you can ignore this parameter. If your gateway is deployed on Alibaba Cloud, valid values are:
|
Basic |
| VSwitchId |
string |
No |
The ID of the vSwitch. If your gateway is deployed in an on-premises data center, you can ignore this parameter.
|
vsw-bp1krhkglx3nahkb9s*** |
| PostPaid |
boolean |
No |
The billing method of the gateway. This parameter affects billing. 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 upon expiration when the billing method is upfront. Valid values:
|
true |
| PublicNetworkBandwidth |
integer |
No |
The Internet bandwidth for data transmission. Unit: Mbit/s. Valid values: 5 to 200. This parameter affects billing. For more information, see Billable items and billing methods. Note
|
5 |
| ResourceRegionId |
string |
No |
The ID of the resource region. |
cn-hangzhou |
| UntrustedEnvInstanceType |
string |
No |
The actual specifications of the gateway in an untrusted (CloudBox) scenario. |
ecs.g6.large |
| UntrustedEnvId |
string |
No |
Instance ID of the untrusted (CloudBox) instance. |
cb-2vcdsa32432*** |
| SecondaryVSwitchId |
string |
No |
The ID of the vSwitch for the secondary node of the high-availability gateway. |
vsw-bp1krhkglx3nahcx9s*** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| BuyURL |
string |
The purchase URL. |
https://common-buy-intl.alibabacloud.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 ID of the gateway. |
gw-0001xv7je357zm9u6*** |
| Code |
string |
The HTTP status code. A status code of 200 indicates that the request is successful. |
200 |
| Success |
boolean |
Indicates whether the request is successful. |
true |
Examples
Success response
JSON format
{
"BuyURL": "https://common-buy-intl.alibabacloud.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.