Querying the VPN Gateway List
Function
This API is used to query the VPN gateway list.
Calling Method
For details, see Calling APIs.
URI
GET /v5/{project_id}/vpn-gateways
|
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
|
project_id |
String |
Yes |
Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID. |
|
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
|
enterprise_project_id |
Array |
No |
Specifies an enterprise project ID. |
Request
Response
- Response parameters
Returned status code 200: successful query
Table 3 Parameters in the response body Parameter
Type
Description
vpn_gateways
Array of ResponseVpnGateway objects
Specifies gateway information.
request_id
String
Specifies a request ID.
Table 4 ResponseVpnGateway Parameter
Type
Description
id
String
- Specifies a VPN gateway ID.
- The value is a UUID containing 36 characters.
name
String
- Specifies the name of a VPN gateway.
- The value is a string of 1 to 64 characters, which can contain digits, letters, underscores (_), hyphens (-), and periods (.).
network_type
String
status
String
attachment_type
String
ip_version
String
- Specifies the IP protocol version of the VPN gateway.
- The value is ipv4.
er_id
String
Specifies the ID of the enterprise router instance to which the VPN gateway connects. This parameter is available only when attachment_type is set to er.
er_attachment_id
String
Specifies the ID of the enterprise router attachment associated with the VPN gateway.
vpc_id
String
Specifies the ID of the service VPC associated with the VPN gateway. This parameter is returned only when attachment_type is set to vpc.
local_subnets
Array of String
Specifies an IPv4 local subnet. This subnet is a cloud-side subnet that needs to communicate with an on-premises network through a VPN. An example subnet is 192.168.52.0/24. This parameter is returned only when attachment_type is set to vpc and ip_version is set to ipv4.
connect_subnet
String
Specifies the ID of the VPC subnet used by the VPN gateway.
bgp_asn
Long
Specifies the BGP AS number of the VPN gateway.
flavor
String
availability_zone_ids
Array of String
Specifies the AZ where the VPN gateway is deployed. This parameter is available when an AZ is specified. If no AZ is specified, this parameter is available only when the VPN gateway is in ACTIVE state.
public_border_group
String
Specifies a public border group.
connection_number
Integer
Specifies the maximum number of VPN connections supported for the VPN gateway.
enterprise_project_id
String
eip1
ResponseEip object
Specifies the first EIP used by the VPN gateway. This parameter is available when the VPN gateway is in ACTIVE state.
eip2
ResponseEip object
Specifies the second EIP used by the VPN gateway. This parameter is available when the VPN gateway is in ACTIVE state.
created_at
String
- Specifies the time when the VPN gateway is created. This parameter is available when the VPN gateway is in ACTIVE state.
- The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.
applied_at
String
- Specifies the time when the VPN gateway takes effect. This parameter is available when the VPN gateway is in ACTIVE state.
- The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.
updated_at
String
- Specifies the last update time. This parameter is available when the VPN gateway is in ACTIVE state.
- The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.
access_vpc_id
String
- Specifies the ID of the access VPC used by the VPN gateway.
- The value is a UUID containing 36 characters.
access_subnet_id
String
- Specifies the ID of the subnet in the access VPC used by the VPN gateway.
- The value is a UUID containing 36 characters.
access_private_ip_1
String
Specifies a private IP address used by the VPN gateway to connect to a customer gateway when the network type is private network. This address is the first private IP address of the VPN gateway in active-active mode or the active private IP address of the VPN gateway in the active/standby mode.
An example is 192.168.52.9. This parameter is available only when network_type is set to private.
access_private_ip_2
String
Specifies a private IP address used by the VPN gateway to connect to a customer gateway when the network type is private network. This address is the second private IP address of the VPN gateway in active-active mode or the standby private IP address of the VPN gateway in the active/standby mode.
An example is 192.168.52.9. This parameter is available only when network_type is set to private.
ha_mode
String
- Specifies the HA mode of the gateway. The value can be active-active or active-standby.
- Value range: active-active, active-standby
- Default value: active-active
supported_flavors
Array of String
Specifies the specification to which the gateway can be upgraded.
supported_features
Array of String
Specifies the features supported by the gateway.
tags
Array of VpnResourceTag objects
Specifies a tag list.
Table 5 ResponseEip Parameter
Type
Description
id
String
- Specifies an EIP ID.
- The value is a UUID containing 36 characters. If the default enterprise project is used, 0 is returned.
ip_version
Integer
- Specifies the EIP version.
- The value can only be 4, indicating IPv4 address.
type
String
- Specifies the EIP type.
- The value can be 5_bgp (dynamic BGP).
For the value range, see the type field in "Assigning an EIP" in the Elastic IP API Reference.
ip_address
String
- Specifies an EIP, that is, a public IPv4 address.
- The value is an IPv4 address, for example, 88.***.***.11.
charge_mode
String
bandwidth_id
String
- Specifies the bandwidth ID of an EIP.
- The value is a UUID containing 36 characters.
bandwidth_size
Integer
- Specifies the bandwidth (Mbit/s) of an EIP. The maximum EIP bandwidth varies according to regions and depends on the EIP service. You can submit a service ticket to increase the maximum EIP bandwidth under your account.
- The value ranges from 1 to 1000. For details, see the EIP documentation.
bandwidth_name
String
- Specifies the bandwidth name of an EIP.
- The value is a string of 1 to 64 characters, which can contain digits, letters, underscores (_), hyphens (-), and periods (.).
share_type
String
Table 6 VpnResourceTag Parameter
Type
Description
key
String
- Specifies a tag key.
- The value is a string of 1 to 128 characters that can contain digits, letters, Spanish characters, Portuguese characters, spaces, and special characters (_ . : = + - @).
value
String
- Specifies a tag value.
- The value is a string of 0 to 255 characters that can contain digits, letters, Spanish characters, Portuguese characters, spaces, and special characters (_ . : = + - @).
- Example responses
- Response to the request for querying all VPN gateways
{ "vpn_gateways": [{ "id": "8e1d0686-demo-a8df-va86-91f32fa1dfc8", "name": "vpngw-1af3", "network_type": "public", "status": "ACTIVE", "attachment_type": "vpc", "ip_version": "ipv4", "vpc_id": "91a74241-demo-a8df-va86-9b5f98c66c8c", "local_subnets": ["192.168.15.0/24"], "connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114", "bgp_asn": 64512, "flavor": "Professional1", "availability_zone_ids": ["az1", "az2"], "connection_number": 200, "used_connection_number": 0, "used_connection_group": 0, "enterprise_project_id": "0", "eip1": { "id": "8ff5d6b5-demo-a8df-va86-b9d598033153", "ip_version": 4, "type": "5_bgp", "ip_address": "88.***.***.111", "charge_mode": "bandwidth", "bandwidth_id": "aa62f8f2-demo-a8df-va86-b05b2b999715", "bandwidth_size": 300, "bandwidth_name": "vpngw-bandwidth-13a3" }, "eip2": { "id": "08e7e927-demo-a8df-va86-26a6394021eb", "ip_version": 4, "type": "5_bgp", "ip_address": "88.***.***.199", "charge_mode": "bandwidth", "bandwidth_id": "887d61f7-demo-a8df-va86-38ee8232e27c", "bandwidth_size": 300, "bandwidth_name": "vpngw-bandwidth-1afb" }, "created_at": "2025-06-28T02:36:16.834Z", "updated_at": "2025-06-28T02:36:16.834Z", "access_vpc_id": "91a74241-demo-a8df-va86-9b5f98c66c8c", "access_subnet_id": "f5741286-demo-a8df-va86-2c82bd9ee114", "ha_mode": "active-active" }, { "id": "66ddeacb-demo-a8df-va86-9a414b5bd7d5", "name": "vpngw-2be4", "network_type": "public", "status": "ACTIVE", "attachment_type": "er", "ip_version": "ipv4", "er_id": "c62fad0d-demo-a8df-va86-e06c4c351b9f", "bgp_asn": 64512, "flavor": "Professional1", "availability_zone_ids": ["az1", "az2"], "connection_number": 200, "used_connection_number": 0, "used_connection_group": 0, "enterprise_project_id": "0", "eip1": { "id": "0f6d1415-demo-a8df-va86-edb2ee97c9cc", "ip_version": 4, "type": "5_bgp", "ip_address": "88.***.***.251", "charge_mode": "bandwidth", "bandwidth_id": "e93767cc-demo-a8df-va86-bac2987f90a4", "bandwidth_size": 300, "bandwidth_name": "vpngw-bandwidth-10c3" }, "eip2": { "id": "7b46b62f-demo-a8df-va86-6b8e44312416", "ip_version": 4, "type": "5_bgp", "ip_address": "88.***.***.102", "charge_mode": "bandwidth", "bandwidth_id": "bde3557e-demo-a8df-va86-629a3754ae07", "bandwidth_size": 300, "bandwidth_name": "vpngw-bandwidth-18bd", }, "created_at": "2025-06-28T02:22:27.24Z", "updated_at": "2025-06-28T02:22:27.24Z", "access_vpc_id": "0cf79a3f-demo-a8df-va86-d7ace626b0fa", "access_subnet_id": "f5741286-demo-a8df-va86-2c82bd9ee114", "ha_mode": "active-active" },{ "id":"66ddeacb-demo-a8df-va86-9a414b5bd7d5", "name":"vpngw-5bd6", "network_type":"public", "status":"ACTIVE", "attachment_type":"vpc", "ip_version": "ipv4", "vpc_id":"c62fad0d-demo-a8df-va86-e06c4c351b9f", "local_subnets":[ "192.168.0.0/24" ], "connection_number":200, "used_connection_number":0, "used_connection_group":0, "enterprise_project_id":"0", "ha_mode":"active-standby", "eip1":{ "id":"0f6d1415-demo-a8df-va86-edb2ee97c9cc", "ip_version":4, "type":"5_bgp", "ip_address":"88.***.***.251", "charge_mode":"bandwidth", "bandwidth_id":"e93767cc-demo-a8df-va86-bac2987f90a4", "bandwidth_size":300, "bandwidth_name":"vpngw-bandwidth-10c3" }, "eip2":{ "id":"7b46b62f-demo-a8df-va86-6b8e44312416", "ip_version":4, "type":"5_bgp", "ip_address":"88.***.***.102", "charge_mode":"bandwidth", "bandwidth_id":"bde3557e-demo-a8df-va86-629a3754ae07", "bandwidth_size":300, "bandwidth_name":"vpngw-bandwidth-18bd" }, "policy_template":{ "ike_policy":{ "encryption_algorithm":"aes-128", "dh_group":"group20", "authentication_algorithm":"sha2-256", "lifetime_seconds":86400 }, "ipsec_policy":{ "authentication_algorithm":"sha2-256", "encryption_algorithm":"aes-128", "pfs":"group20", "lifetime_seconds":3600 } }, "created_at":"2025-06-28T02:22:27.24Z", "updated_at":"2025-06-28T02:22:27.24Z", "access_vpc_id":"4d03fe2d--demo-a8df-va86-6def96440f2b", "access_subnet_id":"fd75bf7b--demo-a8df-va86-e-db13f03e299a" }], "request_id": "de1b6caf-d024-4dac-850e-645af40c84f3" } - Response to the request for querying VPN gateways based on a specified enterprise project ID
{ "vpn_gateways": [{ "id": "8e1d0686-demo-a8df-va86-91f32fa1dfc8", "name": "vpngw-1af3", "network_type": "public", "status": "ACTIVE", "attachment_type": "vpc", "ip_version": "ipv4", "vpc_id": "91a74241-demo-a8df-va86-9b5f98c66c8c", "local_subnets": ["192.168.15.0/24"], "connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114", "bgp_asn": 64512, "flavor": "Professional1", "availability_zone_ids": ["az1", "az2"], "connection_number": 200, "used_connection_number": 0, "used_connection_group": 0, "enterprise_project_id": "7354dda9-demo-a8df-va86-a6b08fb92043", "eip1": { "id": "8ff5d6b5-demo-a8df-va86-b9d598033153", "ip_version": 4, "type": "5_bgp", "ip_address": "88.***.***.111", "charge_mode": "bandwidth", "bandwidth_id": "aa62f8f2-demo-a8df-va86-b05b2b999715", "bandwidth_size": 300, "bandwidth_name": "vpngw-bandwidth-13a3" }, "eip2": { "id": "08e7e927-demo-a8df-va86-26a6394021eb", "ip_version": 4, "type": "5_bgp", "ip_address": "88.***.***.199", "charge_mode": "bandwidth", "bandwidth_id": "887d61f7-demo-a8df-va86-38ee8232e27c", "bandwidth_size": 300, "bandwidth_name": "vpngw-bandwidth-1afb" }, "created_at": "2025-06-28T02:36:16.834Z", "updated_at": "2025-06-28T02:36:16.834Z", "access_vpc_id": "91a74241-demo-a8df-va86-9b5f98c66c8c", "access_subnet_id": "f5741286-demo-a8df-va86-2c82bd9ee114", "ha_mode": "active-active" }, { "id": "66ddeacb-demo-a8df-va86-9a414b5bd7d5", "name": "vpngw-2be4", "network_type": "private", "status": "ACTIVE", "attachment_type": "er", "ip_version": "ipv4", "er_id": "c62fad0d-demo-a8df-va86-e06c4c351b9f", "bgp_asn": 64512, "flavor": "Professional1", "availability_zone_ids": ["az1", "az2"], "connection_number": 200, "used_connection_number": 0, "used_connection_group": 0, "enterprise_project_id": "7354dda9-demo-a8df-va86-a6b08fb92043", "access_private_ip_1": "192.168.4.7", "access_private_ip_2": "192.168.4.99", "created_at": "2025-06-28T02:22:27.24Z", "updated_at": "2025-06-28T02:22:27.24Z", "access_vpc_id": "0cf79a3f-demo-a8df-va86-d7ace626b0fa", "access_subnet_id": "f5741286-demo-a8df-va86-2c82bd9ee114", "ha_mode": "active-active" },{ "id":"66ddeacb-demo-a8df-va86-9a414b5bd7d5", "name":"vpngw-5bd6", "network_type":"public", "status":"ACTIVE", "attachment_type":"vpc", "ip_version": "ipv4", "vpc_id":"c62fad0d-demo-a8df-va86-e06c4c351b9f", "local_subnets":[ "192.168.0.0/24" ], "connect_subnet":"fd75bf7b--demo-a8df-va86-db13f03e299a", "bgp_asn":64512, "availability_zone_ids":[ ], "connection_number":200, "used_connection_number":0, "used_connection_group":0, "enterprise_project_id":"0", "ha_mode":"active-standby", "eip1":{ "id":"0f6d1415-demo-a8df-va86-edb2ee97c9cc", "ip_version":4, "type":"5_bgp", "ip_address":"88.***.***.251", "charge_mode":"bandwidth", "bandwidth_id":"e93767cc-demo-a8df-va86-bac2987f90a4", "bandwidth_size":300, "bandwidth_name":"vpngw-bandwidth-10c3" }, "eip2":{ "id":"7b46b62f-demo-a8df-va86-6b8e44312416", "ip_version":4, "type":"5_bgp", "ip_address":"88.***.***.102", "charge_mode":"bandwidth", "bandwidth_id":"bde3557e-demo-a8df-va86-629a3754ae07", "bandwidth_size":300, "bandwidth_name":"vpngw-bandwidth-18bd" }, "policy_template":{ "ike_policy":{ "encryption_algorithm":"aes-128", "dh_group":"group20", "authentication_algorithm":"sha2-256", "lifetime_seconds":86400 }, "ipsec_policy":{ "authentication_algorithm":"sha2-256", "encryption_algorithm":"aes-128", "pfs":"group20", "lifetime_seconds":3600 } }, "created_at":"2025-06-28T02:22:27.24Z", "updated_at":"2025-06-28T02:22:27.24Z", "access_vpc_id":"4d03fe2d--demo-a8df-va86-6def96440f2b", "access_subnet_id":"fd75bf7b--demo-a8df-va86-e-db13f03e299a" }], "request_id": "bfa819a1-e824-4799-8e72-21a35dad97c9" }
- Response to the request for querying all VPN gateways
Status Codes
For details, see Status Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot