Updated on 2026-06-11 GMT+08:00

Querying VPN Connection Logs

Function

This API is used to query logs of a VPN connection with a specified connection ID.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

vpn:vpnConnections:getLog

read

vpnGateways

  • g:EnterpriseProjectId
  • g:ResourceTag/<tag-key>

-

-

customerGateways

g:ResourceTag/<tag-key>

vpnConnections

  • g:EnterpriseProjectId
  • g:ResourceTag/<tag-key>

URI

GET /v5/{project_id}/vpn-connection/{vpn_connection_id}/log

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.

vpn_connection_id

String

Yes

Specifies a VPN connection ID.

Request

  • Request parameters

    None

  • Example request
    GET https://{Endpoint}/v5/{project_id}/vpn-connection/{vpn_connection_id}/log

Response

  • Response parameters

    Returned status code 200: successful operation

    Table 2 Parameters in the response body

    Parameter

    Type

    Description

    logs

    Array of Log objects

    Specifies the log object.

    request_id

    String

    Specifies a request ID.

    Table 3 Log

    Parameter

    Type

    Description

    time

    Integer

    • Specifies the timestamp.

    raw_message

    String

    • Specifies log information.
  • Example response
    {
        "logs": [
            {
                "time": 1735024112,
                "raw_message": "2024-12-24T07:08:32.730275+00:00 host-xx-xx-xx-xx ipsec_ike[30085]: [xx.xx.xx.xx] IPSec tunnel negotiation fails. (IfIndex=[207], PolicyName=[], SeqNum=[0], PeerAddress=[xx.xx.xx.xx], PeerPort=[500], Reason=[version mismatch])"
            }
        ],
        "request_id": "f15d2c621593f2018c23eb1d49e3605e"
    }

Status Codes

For details, see Status Codes.