All Products
Search
Document Center

Virtual Private Cloud:ListTrafficMirrorSessions

Last Updated:Oct 19, 2026

Queries the details of traffic mirror sessions.

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:ListTrafficMirrorSessions

list

*TrafficMirrorSession

acs:vpc:{#regionId}:{#accountId}:trafficmirrorsession/*

None None

Request parameters

Parameter

Type

Required

Description

Example

TrafficMirrorSessionName

string

No

The name of the traffic mirror session.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

abc

MaxResults

integer

No

The maximum number of entries to return for a single request. Valid values: 1 to 100. Default value: 10.

10

NextToken

string

No

The token for the next query. Valid values:

  • For the first query and when no next query is required, you do not need to specify this parameter.

  • If a next query is required, set the value to the NextToken value returned from the previous API call.

FFmyTO70tTpLG6I3FmYAXGKPd****

TrafficMirrorSourceId

string

No

The instance ID of the traffic mirror source. Currently, only elastic network interfaces (ENIs) are supported as traffic mirror sources.

eni-j6c8znm5l1yt4sox*****

TrafficMirrorTargetId

string

No

The instance ID of the traffic mirror destination. Currently, elastic network interfaces (ENIs) and internal-facing SLB instances are supported as traffic mirror destinations.

eni-j6c2fp57q8rr47rp****

TrafficMirrorFilterId

string

No

The instance ID of the traffic mirror filter.

tmf-j6cmls82xnc86vtpe****

VirtualNetworkId

integer

No

The virtual network identifier (VNI) that is used to distinguish different mirrored traffic. Valid values: 0 to 16777215. You can use the VNI to distinguish mirrored traffic of different sessions at the traffic mirror destination. You can specify a custom VNI or let the system randomly allocate one. To let the system randomly allocate a VNI, do not specify this parameter.

10

Priority

integer

No

The priority of the traffic mirror session. Valid values: 1 to 32766.

A smaller value indicates a higher priority. The priorities of traffic mirror sessions created by the same Alibaba Cloud account in the same region must be unique.

1

Enabled

boolean

No

Specifies whether to enable the traffic mirror session. Valid values:

  • false (default): disables the traffic mirror session.

  • true: enables the traffic mirror session.

false

TrafficMirrorSessionIds

array

No

The instance IDs of the traffic mirror sessions. The maximum value of N is 100, which means you can query up to 100 traffic mirror sessions at a time.

tms-j6cla50buc44ap8tu****

string

No

The instance IDs of the traffic mirror sessions. The maximum value of N is 100, which means you can query up to 100 traffic mirror sessions at a time.

tms-j6cla50buc44ap8tu****

RegionId

string

Yes

The region ID of the traffic mirror session. You can call the DescribeRegions operation to query the most recent region list. For more information about the regions that support traffic mirroring, see Traffic mirroring overview.

cn-hongkong

ResourceGroupId

string

No

The ID of the resource group to which the traffic mirroring belongs.

rg-bp67acfmxazb4ph****

Tags

array<object>

No

The list of tags.

object

No

The list of tags.

Key

string

No

The tag key of the resource. You can specify up to 20 tag keys. If you specify this parameter, you cannot enter an empty string.

A tag key can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceDept

Value

string

No

The tag value of the resource. You can specify up to 20 tag values. If you specify this parameter, you can enter an empty string.

A tag value can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceJoshua

Response elements

Element

Type

Description

Example

object

The token for the next query. Valid values:

  • If NextToken is empty, no next query is available.

  • If NextToken returns a value, the value is the token used to start the next query.

NextToken

string

The token for the next query. Valid values:

  • If NextToken is empty, no next query is available.

  • If NextToken returns a value, the value is the token used to start the next query.

FFmyTO70tTpLG6I3FmYAXGKPd****

RequestId

string

The ID of the request.

739CA01C-92EB-4C69-BCC0-280149C6F41E

TotalCount

string

The total number of entries returned.

1

TrafficMirrorSessions

array<object>

The details of the traffic mirror sessions.

array<object>

The details of the traffic mirror sessions.

TrafficMirrorTargetId

string

The instance ID of the traffic mirror destination.

eni-j6c2fp57q8rr47rp****

TrafficMirrorSessionId

string

The instance ID of the traffic mirror session.

tms-j6cla50buc44ap8tu****

Priority

integer

The priority of the traffic mirror session.

A smaller value indicates a higher priority.

1

TrafficMirrorTargetType

string

The type of the traffic mirror destination. Valid values:

  • NetworkInterface: an elastic network interface (ENI).

  • SLB: an internal-facing SLB instance.

NetworkInterface

PacketLength

integer

The length of the original mirrored packet, excluding the length of the VXLAN packet. Default value: 1500. Valid values: 64 to 8500. Unit: bytes.

  • The value of this parameter affects the length of the packet received by the traffic mirror destination. For more information, see the "Mirrored packet length and MTU limits" section in Traffic mirroring overview.

  • This parameter is available only in specific regions. For more information, see the description of the mirrored packet length parameter in Create and manage traffic mirroring.

1500

TrafficMirrorSessionDescription

string

The description of the traffic mirror session.

This is a session.

TrafficMirrorSessionStatus

string

The status of the traffic mirror session. Valid values:

  • Creating: The traffic mirror session is being created.

  • Created: The traffic mirror session is created.

  • Modifying: The traffic mirror session is being modified.

  • Deleting: The traffic mirror session is being deleted.

Created

Enabled

boolean

Specifies whether the traffic mirror session is enabled. Valid values:

  • false (default): The traffic mirror session is disabled.

  • true: The traffic mirror session is enabled.

false

TrafficMirrorSessionBusinessStatus

string

The business status of the traffic mirror session. Valid values:

  • Normal: The traffic mirror session is working as expected.

  • FinancialLocked: locked due to overdue payment.

Normal

VirtualNetworkId

integer

The VNI that is used to distinguish different mirrored traffic.

10

TrafficMirrorFilterId

string

The instance ID of the traffic mirror filter.

tmf-j6cmls82xnc86vtpe****

TrafficMirrorSessionName

string

The name of the traffic mirror session.

abc

TrafficMirrorSourceIds

array

The instance IDs of the traffic mirror sources.

string

The instance IDs of the traffic mirror sources.

eni-j6c8znm5l1yt4sox****

ResourceGroupId

string

The ID of the resource group to which the traffic mirroring belongs.

rg-bp67acfmxazb4ph****

Tags

array<object>

The list of tags.

object

The list of tags.

Key

string

The tag key.

FinanceDept

Value

string

The tag value.

FinanceJoshua

CreationTime

string

The creation time of the traffic mirror session. The time is specified in the ISO 8601 standard in UTC. The example is accurate to the minute in the YYYY-MM-DDThh:mmZ format.

2023-09-05T15:26Z

Examples

Success response

JSON format

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "739CA01C-92EB-4C69-BCC0-280149C6F41E",
  "TotalCount": "1",
  "TrafficMirrorSessions": [
    {
      "TrafficMirrorTargetId": "eni-j6c2fp57q8rr47rp****",
      "TrafficMirrorSessionId": "tms-j6cla50buc44ap8tu****",
      "Priority": 1,
      "TrafficMirrorTargetType": "NetworkInterface",
      "PacketLength": 1500,
      "TrafficMirrorSessionDescription": "This is a session.",
      "TrafficMirrorSessionStatus": "Created",
      "Enabled": false,
      "TrafficMirrorSessionBusinessStatus": "Normal",
      "VirtualNetworkId": 10,
      "TrafficMirrorFilterId": "tmf-j6cmls82xnc86vtpe****",
      "TrafficMirrorSessionName": "abc",
      "TrafficMirrorSourceIds": [
        "eni-j6c8znm5l1yt4sox****"
      ],
      "ResourceGroupId": "rg-bp67acfmxazb4ph****",
      "Tags": [
        {
          "Key": "FinanceDept",
          "Value": "FinanceJoshua"
        }
      ],
      "CreationTime": "2023-09-05T15:26Z"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.NextToken The specified NextToken is invalid. The specified NextToken is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.