All Products
Search
Document Center

VPN Gateway:DescribeVpnConnectionLogs

Last Updated:Aug 07, 2026

Queries the log information of an IPsec-VPN connection by calling the DescribeVpnConnections operation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:DescribeVpnConnectionLogs

list

*VpnConnection

acs:vpc:{#regionId}:{#accountId}:vpnconnection/{#VpnConnectionId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the IPsec-VPN connection.

You can call the DescribeRegions operation to query region IDs.

eu-central-1

VpnConnectionId

string

Yes

The ID of the IPsec-VPN connection.

vco-m5evqnds4y459flt3****

From

integer

No

The start time of the log. Only UNIX timestamps in seconds are supported. For example, 1671003744 represents 2022-12-14 15:42:24.

Note

If you specify From, you must also specify To or MinutePeriod.

1671003744

To

integer

No

The end time of the log. Only UNIX timestamps in seconds are supported. For example, 1671004344 represents 2022-12-14 15:52:24.

Note

If you specify To, you must also specify From or MinutePeriod.

1671004344

MinutePeriod

integer

No

The log period. Valid values: 1 to 10. Unit: minutes.

Note

If you do not specify From or To, you must specify MinutePeriod.

10

PageNumber

integer

No

The page number. Default value: 1.

1

PageSize

integer

No

The number of entries per page for paging. Valid values: 1 to 50. Default value: 10.

10

TunnelId

string

No

The tunnel ID of the IPsec-VPN connection.

This parameter is supported only for IPsec-VPN connections in dual-tunnel mode.

tun-opsqc4d97wni27****

Response elements

Element

Type

Description

Example

object

The response parameters.

PageSize

integer

The number of entries per page for paging.

10

PageNumber

integer

The page number.

1

RequestId

string

The request ID.

CF161502-4959-5C3B-B499-09B87BA931D9

Count

integer

The number of log entries on the current page.

10

IsCompleted

boolean

Indicates whether the queried logs are accurate. Valid values:

  • true: Accurate.

  • false: Not accurate.

true

Data

object

Logs

array

The list of log entries.

string

A string array.

Each item in the array is a log entry.

"Logs": [ "2022-12-14 15:52:28 vco-m5evqnds4y459flt3**** [DEBUG]: isakmp_inf.c:1514:isakmp****", "2022-12-14 15:52:28 vco-m5evqnds4y459flt3**** [DEBUG]: oakley.c:2832:oak****", "2022-12-14 15:52:28 vco-m5evqnds4y459flt3**** [DEBUG]: oakley.c:2833:oak****" ]

Examples

Success response

JSON format

{
  "PageSize": 10,
  "PageNumber": 1,
  "RequestId": "CF161502-4959-5C3B-B499-09B87BA931D9",
  "Count": 10,
  "IsCompleted": true,
  "Data": {
    "Logs": [
      "\"Logs\": [ \"2022-12-14 15:52:28 vco-m5evqnds4y459flt3**** [DEBUG]: isakmp_inf.c:1514:isakmp****\", \"2022-12-14 15:52:28 vco-m5evqnds4y459flt3**** [DEBUG]: oakley.c:2832:oak****\", \"2022-12-14 15:52:28 vco-m5evqnds4y459flt3**** [DEBUG]: oakley.c:2833:oak****\" ]"
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 QueryVpnConnectionLog.NotFound the connection log of the vpn connection is not found. the connection log of the vpn connection is not found.
403 Forbbiden.SubUser User not authorized to operate on the specified resource as your account is created by another user.
403 Forbidden User not authorized to operate on the specified resource. You do not have the permissions to manage the specified resource. Apply for the permissions and try again.
404 InvalidVpnConnectionInstanceId.NotFound The specified vpn connection instance id does not exist. The specified vpn connection instance id does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.