Updated on 2024-01-26 GMT+08:00

Creating a VPN Connection Monitor

Function

This API is used to create a VPN connection monitor to perform health check between gateways. After a VPN connection monitor is created, the VPN gateway sends probe packets to the customer gateway to collect statistics about the round-trip delay and packet loss rate, thereby monitoring quality of VPN connections between the gateways.

Calling Method

For details, see Calling APIs.

URI

POST /v5/{project_id}/connection-monitors

Table 1 Parameter description

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.

Request

  • Request parameters
    Table 2 Request parameters

    Parameter

    Type

    Mandatory

    Description

    connection_monitor

    CreateConnectionMonitorRequestBodyContent object

    Yes

    Specifies the connection_monitor object.

    Table 3 CreateConnectionMonitorRequestBodyContent

    Parameter

    Type

    Mandatory

    Description

    vpn_connection_id

    String

    Yes

    Specifies the ID of the VPN connection to be monitored.

    You can obtain VPN connection IDs by querying the VPN connection list.

  • Example request
    POST https://{Endpoint}/v5/{project_id}/connection-monitors
    
    {
        "connection_monitor": {
            "vpn_connection_id": "cae286f2-****-****-****-e22416ca1220"
        }
    }

Response

  • Response parameters

    Returned status code 201: successful operation

    Table 4 Parameters in the response body

    Parameter

    Type

    Description

    connection_monitor

    ConnectionMonitorInfo object

    Specifies the connection_monitor object.

    request_id

    String

    Specifies a request ID.

    Table 5 ConnectionMonitorInfo

    Parameter

    Type

    Description

    id

    String

    • Specifies the ID of a VPN connection monitor.
    • The value is a UUID containing 36 characters.

    vpn_connection_id

    String

    • Specifies the ID of the VPN connection to be monitored.
    • The value is a UUID containing 36 characters.

    type

    String

    • Specifies the type of objects to be monitored.
    • The value can only be gateway.

    source_ip

    String

    Specifies the source address to be monitored.

    destination_ip

    String

    Specifies the destination address to be monitored.

    proto_type

    String

    • Specifies the protocol used by NQA.
    • The value can only be icmp.
  • Example response
    {
        "connection_monitor":{
            "id":"76f64229-****-****-****-3907e2815b6d",
            "vpn_connection_id":"cae286f2-****-****-****-e22416ca1220",
            "type":"gateway",
            "source_ip":"88.***.***.60",
            "destination_ip":"88.***.***.32",
            "proto_type":"icmp"
        },
        "request_id": "bd37d16d-387c-41ab-a180-01b649f73590"
    }

Status Codes

For details, see Status Codes.