Function
This API is used to create a customer gateway to which a VPN gateway connects.
URI
POST /v5/{project_id}/customer-gateways
Table 1 Parameter descriptionParameter
|
Type
|
Mandatory
|
Description
|
project_id
|
String
|
Yes
|
Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID.
|
Request
- Request parameters
Table 2 Request parametersParameter
|
Type
|
Mandatory
|
Description
|
customer_gateway
|
CreateCgwRequestBodyContent object
|
Yes
|
Specifies the customer gateway object.
|
Table 3 CreateCgwRequestBodyContentParameter
|
Type
|
Mandatory
|
Description
|
name
|
String
|
No
|
- Specifies the name of a customer gateway. If this parameter is not specified, a name in the format of cgw-**** is automatically generated, for example, cgw-21a3.
- The value is a string of 1 to 64 characters, which can contain digits, letters, underscores (_), hyphens (-), and periods (.).
|
id_type
|
String
|
No
|
- Specifies the identifier type of a customer gateway.
- Value range:
- ip
- fqdn (currently not supported)
- The default value is ip.
|
id_value
|
String
|
Yes
|
- Specifies the identifier of a customer gateway.
- The value is a string of 1 to 128 characters. When id_type is set to ip, the value is an IPv4 address in dotted decimal notation, for example, 192.168.45.7. When id_type is set to fqdn, the value is a string of characters that can contain uppercase letters, lowercase letters, digits, and special characters. Spaces and the following special characters are not supported: & < > [ ] \ ?.
|
bgp_asn
|
Long
|
No
|
- Specifies the BGP AS number of the customer gateway.
- The value ranges from 1 to 4294967295.
- Set this parameter only when id_type is set to ip.
|
tags
|
Array of VpnResourceTag object
|
No
|
- Specifies a tag list.
- A maximum of 20 tags can be specified.
|
Table 4 VpnResourceTagParameter
|
Type
|
Mandatory
|
Description
|
key
|
String
|
Yes
|
- 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
|
Yes
|
- 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 request
POST https://{Endpoint}/v5/{project_id}/vpn/customer-gateways
{
"customer_gateway": {
"name": "cgw-2abf",
"id_type": "ip",
"id_value": "10.***.***.21",
"bgp_asn": 65000,
}
}
Response
- Response parameters
Returned status code 201: successful creation
Table 5 Parameters in the response bodyParameter
|
Type
|
Description
|
customer_gateway
|
ResponseCustomerGateway object
|
Specifies the customer gateway object.
|
request_id
|
String
|
Specifies a request ID.
|
Table 6 ResponseCustomerGatewayParameter
|
Type
|
Description
|
id
|
String
|
- Specifies a customer gateway ID.
- The value is a UUID containing 36 characters.
|
name
|
String
|
- Specifies a customer gateway name. If no customer gateway name is specified, the system automatically generates one.
- The value is a string of 1 to 64 characters, which can contain digits, letters, underscores (_), and hyphens (-).
|
id_type
|
String
|
- Specifies the identifier type of a customer gateway.
- Value range:
- ip
- fqdn (currently not supported)
|
id_value
|
String
|
Specifies the identifier of a customer gateway.
|
bgp_asn
|
Long
|
Specifies the BGP AS number of the customer gateway. This parameter is available only when id_type is set to ip.
|
created_at
|
String
|
- Specifies the time when the customer gateway is created.
- The UTC time format is yyyy-MM-ddTHH:mm:ss.SSS+02:00.
|
updated_at
|
String
|
- Specifies the last update time.
- The UTC time format is yyyy-MM-ddTHH:mm:ss.SSS+02:00.
|
tags
|
Array of VpnResourceTag objects
|
Specifies a tag list.
|
Table 7 VpnResourceTagParameter
|
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 response
{
"customer_gateway": {
"id": "03c0aa3d-demo-a8df-va86-9d82473765d4",
"name": "cgw-2abf",
"id_type": "ip",
"id_value": "10.***.***.21",
"bgp_asn": 65000,
"created_at": "2024-06-25T13:19:37.335+02:00",
"updated_at": "2024-06-25T13:19:37.335+02:00"
},
"request_id": "7e0383bf-a7fb-461b-a926-baa8a795bf1a"
}