Creating a Dedicated Gateway
Function
This API is used to create a dedicated gateway.
Debugging
You can use API Explorer to debug this API.
URI
POST /v2/{project_id}/apigw/instances
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see "Appendix" > "Obtaining a Project ID" in this document. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token, which can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
description |
No |
String |
Description about the gateway. |
|
maintain_begin |
No |
String |
Start time of the maintenance time window in the format "xx:00:00". The value of xx can be 02, 06, 10, 14, 18, or 22. During the maintenance time period, the O&M personnel can perform maintenance operations on the gateway. During maintenance, services can still be used, but occasionally there may be temporary service interruptions. Scheduled maintenance occurs infrequently (typically once every several months). |
|
maintain_end |
No |
String |
End time of the maintenance time window in the format "xx:00:00". There is a 4-hour difference between the start time and end time. During the maintenance time period, the O&M personnel can perform maintenance operations on the gateway. During maintenance, services can still be used, but occasionally there may be temporary service interruptions. Scheduled maintenance occurs infrequently (typically once every several months). |
|
instance_name |
Yes |
String |
Gateway name. Minimum: 3 Maximum: 64 |
|
instance_id |
No |
String |
Gateway ID, which will be automatically generated if you do not specify this parameter. |
|
spec_id |
Yes |
String |
Gateway edition.
Enumeration values:
|
|
vpc_id |
Yes |
String |
VPC ID. You can obtain it in either of the following ways:
|
|
subnet_id |
Yes |
String |
Subnet network ID. You can obtain it in either of the following ways:
|
|
security_group_id |
Yes |
String |
ID of the security group to which the gateway belongs. You can obtain it in either of the following ways:
|
|
eip_id |
No |
String |
EIP ID. This parameter is required if public access is enabled for the gateway. After you bind an EIP to the gateway, users can access APIs in the gateway from public networks using the EIP. To obtain an EIP ID, log in to the VPC console, and choose Elastic IP and Bandwidth > EIPs in the navigation pane. Click the name of the target EIP, and view the EIP ID on the displayed page. |
|
enterprise_project_id |
No |
String |
Enterprise project ID. This parameter is required if you are using an enterprise account. Methods:
|
|
available_zone_ids |
No |
Array of strings |
AZs. An AZ is a physical region where resources use independent power supply and networks. AZs are physically isolated but interconnected through an internal network. To enhance application availability, create gateways in different AZs. To obtain AZ information, call the API used to query AZs. |
|
bandwidth_size |
No |
Integer |
Outbound access bandwidth. This parameter is required if public outbound access is enabled for the gateway. After you configure the bandwidth for the gateway, users can access resources on public networks. Default: 5 |
|
ipv6_enable |
No |
Boolean |
Indicates whether public access with an IPv6 address is supported. Currently, IPv6 addresses are supported only in certain regions. |
Response Parameters
Status code: 202
|
Parameter |
Type |
Description |
|---|---|---|
|
instance_id |
String |
Gateway ID. |
|
message |
String |
Information about the gateway creation task. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Example Requests
{
"available_zone_ids" : [ "xx-xxx-7b", "xx-xxx-7a" ],
"bandwidth_size" : 5,
"description" : "test create instance",
"eip_id" : "41f961ab-2bdd-4ca7-9b59-cfc4fcef10c9",
"enterprise_project_id" : "0",
"instance_name" : "apig-demo",
"maintain_begin" : "22:00:00",
"maintain_end" : "02:00:00",
"security_group_id" : "36d0ec18-bd10-4da7-86f3-ad7a5ddc55d7",
"spec_id" : "PROFESSIONAL",
"subnet_id" : "a938121c-11c4-4c91-b983-bc9acd347bb5",
"vpc_id" : "0957108c-257c-4ce0-9e93-527d279ce763"
}
Example Responses
Status code: 202
Accepted
{
"instance_id" : "6a7d71827fd54572b1f31aa9548fcc81",
"message" : "JOB_ASSIGNED_FOR_PROVISIONING_0003I:The job JOB-bdb370eb6f4c4c73b61b95a9da38beb5 has been assigned to the instance 6a7d71827fd54572b1f31aa9548fcc81 for running provisioning."
}
Status code: 400
Bad Request
{
"error_code" : "APIC.7211",
"error_msg" : "Parameter value does not match the rules, parameter name[maintainBegin]"
}
Status code: 401
Unauthorized
{
"error_code" : "APIC.7102",
"error_msg" : "Incorrect token or token resolution failed"
}
Status code: 403
Forbidden
{
"error_code" : "APIC.7106",
"error_msg" : "No permissions to request for the method"
}
Status code: 404
Not Found
{
"error_code" : "APIC.7301",
"error_msg" : "Instance spec not found"
}
Status code: 500
Internal Server Error
{
"error_code" : "APIC.9000",
"error_msg" : "Failed to request internal service"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
202 |
Accepted |
|
400 |
Bad Request |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
404 |
Not Found |
|
500 |
Internal Server Error |
Error Codes
See Error Codes.
Last Article: Gateway Management
Next Article: Querying Details of a Dedicated Gateway
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.