Creates a subscription or pay-as-you-go 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).
You have created an Alibaba Cloud account.
You have activated CSG.
If you want to create a gateway that is deployed on Alibaba Cloud, make sure that you have created a virtual private cloud (VPC) and vSwitch in the region of the gateway.
If you want to create a gateway that is deployed on Alibaba Cloud, make sure that you have an Elastic Compute Service (ECS) instance in the VPC.
Make sure that you have a gateway cluster in the region where you want to create the gateway. If you do not have one, you can call the CreateStorageBundle operation to create one.
If you create a subscription gateway, you must pay for the subscription on the page indicated by the URL in the response to complete the gateway creation.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | CreateGateway | The operation that you want to perform. Set the value to CreateGateway. |
StorageBundleId | String | Yes | sb-0001b2otnkdxrigeq*** | The ID of the gateway cluster. |
Name | String | Yes | alex*** | The name of the gateway. The name must be 1 to 60 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. |
Description | String | No | Test | The description of the gateway. The description must be 0 to 255 characters in length. |
Type | String | Yes | File | The type of the gateway. Valid values:
|
Location | String | Yes | Cloud | The location of the gateway. Valid values:
|
GatewayClass | String | No | Basic | The specifications of the gateway. The parameter affects the billing of the gateway. For more information, see Billing. If you set the Location parameter to On_Premise, ignore this parameter. If you set the Location parameter to Cloud, you can set this parameter to one of the following valid values:
|
VSwitchId | String | No | vsw-bp1krhkglx3nahkb9s*** | The ID of the vSwitch. If you set the Location parameter to On_Premise, ignore this parameter.
|
PostPaid | Boolean | No | true | Specifies whether the billing method of the gateway is pay-as-you-go. The parameter affects the billing of the gateway. For more information, see Billing. Valid values:
Default value: false. |
ReleaseAfterExpiration | Boolean | No | true | Specifies whether to release the gateway after the subscription expires. Valid values:
|
PublicNetworkBandwidth | Integer | No | 5 | The public bandwidth of the gateway. Unit: Mbit/s. The public bandwidth ranges from 5 Mbit/s to 200 Mbit/s. The parameter affects the billing of the gateway. For more information, see Billing. Note
|
ResourceRegionId | String | No | cn-hangzhou | The ID of the region in which the resources are located. |
UntrustedEnvInstanceType | String | No | ecs.g6.large | The actual specification of the gateway in the CloudBox environment. |
UntrustedEnvId | String | No | cb-2vcdsa32432*** | The ID of the CloudBox instance. |
SecondaryVSwitchId | String | No | vsw-bp1krhkglx3nahcx9s*** | The parameter is discontinued. |
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}®ionId=cn-hangzhou#/buy | The URL of the CSG buy page. |
RequestId | String | 8E69E1A1-9076-4C8C-8ADF-ACD253886E22 | The request ID. |
Message | String | successful | The description of the request result. |
GatewayId | String | gw-0001xv7je357zm9u6*** | The gateway ID. |
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=CreateGateway
&Location=Cloud
&Name=alex***
&StorageBundleId=sb-0001b2otnkdxrigeq***
&Type=File
&VSwitchId=vsw-bp1krhkglx3nahkb9s***
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateGatewayResponse>
<Message>successful</Message>
<RequestId>8E69E1A1-9076-4C8C-8ADF-ACD253886E22</RequestId>
<GatewayId>gw-0001xv7je357zm9u6m0u</GatewayId>
<BuyURL>https://common-buy.aliyun.com/?commodityCode=hcs_sgw_csg_pre&request=%7B%22gateway_id%22:%22gw-0007va9bnidei3s8a09e%22,%22directBuy%22:%22false%22,%22gateway_class%22:%22standard%22,%22cache_cloud_efficiency_size%22:0%7D®ionId=cn-hangzhou#/buy</BuyURL>
<Code>200</Code>
<Success>true</Success>
</CreateGatewayResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Message" : "successful",
"RequestId" : "8E69E1A1-9076-4C8C-8ADF-ACD253886E22",
"GatewayId" : "gw-0001xv7je357zm9u6m0u",
"BuyURL" : "https://common-buy.aliyun.com/?commodityCode=hcs_sgw_csg_pre&request=%7B%22gateway_id%22:%22gw-0007va9bnidei3s8a09e%22,%22directBuy%22:%22false%22,%22gateway_class%22:%22standard%22,%22cache_cloud_efficiency_size%22:0%7D®ionId=cn-hangzhou#/buy",
"Code" : "200",
"Success" : true
}
Error codes
HttpCode | Error code | Error message | Description |
400 | EmptyGatewayName | You must enter a valid name for the gateway. | No gateway name is specified. |
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 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 (-). It 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 description exceeds the upper limit of 255 characters. |
400 | EmptyStorageBundleId | You must enter a valid ID for the gateway cluster. | No gateway cluster ID is specified. |
400 | InvalidGatewayClass | The specified specification of the gateway is invalid. | The specified gateway specification is invalid. |
400 | InvalidGatewayType | The specified type of the gateway is invalid. | The specified gateway type is invalid. |
400 | InvalidVSwitchId | The specified VSwitch ID does not exist. | The specified vSwitch 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. | No cloud resources are unavailable. Select another gateway specification or a vSwitch in another zone. |
400 | DuplicateGatewayName | The specified name of the gateway already exists. You must specify a valid name. | The specified gateway name already exists. Specify a different gateway name. |
400 | InvalidGatewayBandwidth | The specified public network bandwidth for the gateway is invalid. The bandwidth ranges from 6 to 200 Mbit/s. | The public bandwidth is invalid. The public bandwidth of a gateway ranges from 6 to 200 Mbit/s. |
400 | GatewayBandwidthNotSupported | You cannot decrease the public network bandwidth of a On Premise Gateway. | You cannot configure the public bandwidth for an on-premises gateway. |
400 | InvalidGatewayLocation | The specified location of the gateway is invalid. | The location of the gateway is invalid. |
404 | StorageBundleNotExist | The name you specified for the gateway cluster does not exist. You must specify a valid parameter. | The specified gateway cluster does not exist. |
For a list of error codes, see Service error codes.