All Products
Search
Document Center

Virtual Private Cloud:ListTrafficMirrorSessions

Last Updated:Aug 28, 2026

Queries 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. Valid values: 1 to 100. Default value: 10.

10

NextToken

string

No

The pagination token for the next query. Valid values:

  • If no subsequent queries are needed, ignore this parameter.

  • If a subsequent query is needed, set this to the NextToken value returned from the previous call.

FFmyTO70tTpLG6I3FmYAXGKPd****

TrafficMirrorSourceId

string

No

The ID of the traffic mirror source. You can specify only an elastic network interface (ENI) as the mirror source.

eni-j6c8znm5l1yt4sox*****

TrafficMirrorTargetId

string

No

The ID of the traffic mirror destination. You can specify only an ENI or a Server Load Balancer (SLB) instance as a traffic mirror destination.

eni-j6c2fp57q8rr47rp****

TrafficMirrorFilterId

string

No

The ID of the traffic mirror filter.

tmf-j6cmls82xnc86vtpe****

VirtualNetworkId

integer

No

The VXLAN network identifier (VNI) used to distinguish mirrored traffic from different sessions. Valid values: 0 to 16777215. You can specify a custom VNI or let the system allocate one randomly. To use a system-allocated VNI, ignore 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. You cannot specify identical priorities for traffic mirror sessions that are created in the same region by using the same account.

1

Enabled

boolean

No

Whether to enable the traffic mirror session. Valid values:

  • false: The session is disabled.

  • true: The session is enabled.

false

TrafficMirrorSessionIds

array

No

The IDs of the traffic mirror sessions. You can specify up to 100 IDs.

tms-j6cla50buc44ap8tu****

string

No

The ID of the traffic mirror session. You can specify up to 100 IDs.

tms-j6cla50buc44ap8tu****

RegionId

string

Yes

The region ID of the traffic mirror session. Call the DescribeRegions operation to query available regions. For supported regions, see Overview of traffic mirror.

cn-hongkong

ResourceGroupId

string

No

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

rg-bp67acfmxazb4ph****

Tags

array<object>

No

The tags of the resource.

object

No

The tag of the resource.

Key

string

No

The tag key. You can specify up to 20 tag keys. The tag key cannot be an empty string.

The key can be up to 64 characters in length and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter but cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceDept

Value

string

No

The tag value. You can specify up to 20 tag values. The tag value can be an empty string.

The value can be up to 128 characters in length and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter but cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceJoshua

Response elements

Element

Type

Description

Example

object

NextToken

string

The pagination token for the next query. Valid values:

  • If NextToken is empty, no more results exist.

  • If NextToken is returned, use this value to retrieve the next page of results.

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 about the traffic mirror session.

array<object>

TrafficMirrorTargetId

string

The ID of the traffic mirror destination.

eni-j6c2fp57q8rr47rp****

TrafficMirrorSessionId

string

The 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 Server Load Balancer (SLB) instance

NetworkInterface

PacketLength

integer

The maximum transmission unit.

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

  • Created

  • Modifying

  • Deleting

Created

Enabled

boolean

Whether the traffic mirror session is enabled.

  • false

  • true

false

TrafficMirrorSessionBusinessStatus

string

The status of the traffic mirror session.

  • Normal

  • FinancialLocked

Normal

VirtualNetworkId

integer

The VNI that distinguishes mirrored traffic from different sessions.

10

TrafficMirrorFilterId

string

The ID of the filter.

tmf-j6cmls82xnc86vtpe****

TrafficMirrorSessionName

string

The name of the traffic mirror session.

abc

TrafficMirrorSourceIds

array

The ID of the traffic mirror source.

string

The ID of the traffic mirror source.

eni-j6c8znm5l1yt4sox****

ResourceGroupId

string

The ID of the resource group to which the traffic mirror session belongs.

rg-bp67acfmxazb4ph****

Tags

array<object>

The tag list.

object

Key

string

The tag key.

FinanceDept

Value

string

The tag value.

FinanceJoshua

CreationTime

string

The time when the session was created.

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.