All Products
Search
Document Center

Virtual Private Cloud:UpdateTrafficMirrorSessionAttribute

Last Updated:Aug 28, 2026

Modifies the configuration of a traffic mirror session.

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

update

*TrafficMirrorSession

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

TrafficMirrorFilter

acs:vpc:{#regionId}:{#accountId}:trafficmirrorfilter/{#TrafficMirrorFilterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

TrafficMirrorSessionDescription

string

No

The new description of the traffic mirror session.

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

This is a new session.

TrafficMirrorSessionName

string

No

The new name of the traffic mirror session.

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

abc

ClientToken

string

No

The client token used to ensure the idempotence of the request.

You can use the client to generate the token, but it must be unique across requests. The token can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.

0c593ea1-3bea-11e9-b96b-88e9fe63****

DryRun

boolean

No

Whether to perform a dry run. Valid values:

  • true: performs a dry run without executing the actual request. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.

  • false: sends the request. If the request passes the check, a 2xx HTTP status code is returned and the operation is performed. This is the default value.

false

TrafficMirrorSessionId

string

Yes

The ID of the traffic mirror session.

tms-j6cla50buc44ap8tu****

TrafficMirrorTargetId

string

No

The ID of the traffic mirror destination.

eni-j6c2fp57q8rr47rp*****

TrafficMirrorTargetType

string

No

The new type of the traffic mirror destination. Valid values:

  • NetworkInterface: an elastic network interface (ENI)

  • SLB: an internal-facing Server Load Balancer (SLB) instance

NetworkInterface

TrafficMirrorFilterId

string

No

The ID of the traffic mirror filter.

tmf-j6cmls82xnc86vtpe****

VirtualNetworkId

integer

No

The VXLAN network identifier (VNI) used to distinguish different mirrored traffic. Valid values: 0 to 16777215.

You can use VNIs to identify mirrored traffic from different sessions at the traffic mirror destination. If you do not specify a VNI, the system randomly allocates one.

10

Priority

integer

No

The new 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 created in the same region by the same account.

2

PacketLength

integer

No

The maximum transmission unit (MTU).

Valid values: 64 to 9600. Default value: 1500.

1500

Enabled

boolean

No

Whether to enable the traffic mirror session. Valid values:

  • false (default)

  • true

false

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 Overview of traffic mirror.

cn-hongkong

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

64DCAF03-E2C7-479A-ACEA-38B79876B006

Examples

Success response

JSON format

{
  "RequestId": "64DCAF03-E2C7-479A-ACEA-38B79876B006"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IncorrectBusinessStatus.TrafficMirror The business status of traffic mirror is incorrect. Traffic mirroring is in an invalid state.
400 OptInRequired.TrafficMirror You need to subscribe to the traffic mirror service first. Traffic mirroring is disabled.
400 DuplicatedParam.Priority The specified priority conflicts with the existing priority. The specified priority is the same as an existing one.
400 ResourceNotFound.TrafficMirrorSession The specified resource of traffic mirror session is not found.
400 IncorrectStatus.TrafficMirrorSession The status of traffic mirror session is incorrect.
400 ResourceNotFound.TrafficMirrorFilter The specified resource of traffic mirror filter is not found. The specified filter does not exist.
400 IncorrectStatus.TrafficMirrorFilter The status of traffic mirror filter is incorrect. The filter is in an invalid state.
400 QuotaExceeded.FilterRelatedSession The quota of the number of traffic mirror sessions related to one filter is exceeded. The number of traffic mirror sessions associated with the filter has reached the upper limit.
400 ResourceNotFound.NetworkInterface The specified resource of network interface is not found. The specified ENI does not exist.
400 ResourceNotFound.EcsInstance The specified resource of ECS instance is not found.
400 ResourceNotFound.Slb The specified resource of SLB is not found.
400 OperationDenied.SlbNotInVpc The specified SLB is not in any VPC.
400 QuotaExceeded.NetworkInterfaceRelatedSession The quota of the number of traffic mirror sessions related to one network interface is exceeded. The number of traffic mirror sessions associated with an ENI has reached the upper limit.
400 QuotaExceeded.SlbRelatedSession The quota of the number of traffic mirror sessions related to one SLB is exceeded. The number of traffic mirror sessions associated with an SLB instance has reached the upper limit.
400 OperationDenied.EcsNotSupportTrafficMirror The ECS instance does not support traffic mirroring.
400 OperationDenied.DuplicateRole The network interface must not be the source and the target of traffic mirror sessions at the same time.
400 InvalidLoadBalancerId.NotFound The specified resource of load balancer is not found. The SLB instance does not exist.
400 OperationDenied.FreeNetworkInterface The network interface is not attached to any ECS instance. The ENI is not associated with an ECS instance.
400 OperationDenied.ClassicSLB The operation is not allowed because of ClassicSLB. The error message returned because you cannot perform the operation on a CLB instance.
400 QuotaExceeded.SourceNumPerTarget The maximum number of traffic mirror sources for a target is exceeded. The number of traffic mirror sources associated with the image exceeds the upper limit.
400 OperationFailed.NotSupportBizType The specified instance type does not support the operation. The specified instance type does not support the operation.
400 OperationDenied.UnsupportedTargetType Traffic mirror target must be SLB if traffic mirror sources contain nat gateway network interface. When a NAT gateway NIC exists in the traffic mirroring source, the traffic mirroring purpose must be SLB type.
400 OperationDenied.TargetTypeNotSupportBondEni Operation denied because of target type can not be Bond Network Interface. Operation denied because of target type can not be Bond Network Interface.
400 OperationDenied.TargetTypeNotSupportGatewayLoadBalancerEndpoint Operation denied because of target type can not be GatewayLoadBalancerEndpoint. Gateway-based load balancing endpoints are not supported as traffic mirrors mu d
400 OperationDenied.InvalidTargetBondEniType The traffic mirroring target does not support the entered bond ENI type. The traffic mirroring target does not support the entered bond ENI type.
400 OperationDenied.TargetTypeNotSupportTrafficMirrorFullPacket The traffic mirror session target type does not support the feature of mirroring source full packet. The traffic mirror session target type does not support the feature of mirroring source full packet
400 OperationDenied.TrafficMirrorSessionSourceFullPacketNotSupport The traffic mirror session does not support the feature of mirroring source full packet. Traffic mirror currently does not support source full packet mirroring. TrafficMirrorSourceTruncateMode can only be set to 0, which is the default mode.
500 OperationFailed.GetEniInfo The back-end service failed to query the NIC information. The back-end service failed to query the NIC information.
404 ResourceNotFound.GatewayLoadBalancerEndpoint GatewayLoadBalancerEndpoint instance not found. GatewayLoadBalancerEndpoint instance not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.