Modifies the configuration of a traffic mirror session.

Usage notes

  • UpdateTrafficMirrorSessionAttribute is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the ListTrafficMirrorSessions operation to query the status of the task.
    • If the traffic mirror session is in the Modifying state, the configuration of the traffic mirror session is being modified.
    • If the traffic mirror session is in the Created state, the configuration of the traffic mirror session is modified.
  • You cannot repeatedly call the UpdateTrafficMirrorSessionAttribute operation within a specific period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateTrafficMirrorSessionAttribute

The operation that you want to perform. Set the value to UpdateTrafficMirrorSessionAttribute.

TrafficMirrorSessionDescription String No This is a new session.

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://.

TrafficMirrorSessionName String No abc

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://.

ClientToken String No 0c593ea1-3bea-11e9-b96b-88e9fe63****

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

You can use the client to generate the token, but you must make sure that the token is unique among different 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.
DryRun Boolean No false

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run, without performing 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.
TrafficMirrorSessionId String Yes tms-j6cla50buc44ap8tu****

The ID of the traffic mirror session.

TrafficMirrorTargetId String No eni-j6c2fp57q8rr47rp*****

The ID of the traffic mirror destination.

TrafficMirrorTargetType String No NetworkInterface

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
TrafficMirrorFilterId String No tmf-j6cmls82xnc86vtpe****

The ID of the traffic mirror filter.

VirtualNetworkId Integer No 10

The VXLAN network identifier (VNI) that is 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 a VNI. If you want the system to randomly allocate a VNI, ignore this parameter.

Priority Integer No 2

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 that are created in the same region by using the same account.

PacketLength Integer No 1500

The maximum transmission unit (MTU).

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

Enabled Boolean No false

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

  • false (default)
  • true
RegionId String Yes cn-hongkong

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 mirroring.

Response parameters

Parameter Type Example Description
RequestId String 64DCAF03-E2C7-479A-ACEA-38B79876B006

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateTrafficMirrorSessionAttribute
&TrafficMirrorSessionDescription=This is a new session.
&TrafficMirrorSessionName=abc
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe63****
&DryRun=false
&TrafficMirrorSessionId=tms-j6cla50buc44ap8tu****
&TrafficMirrorTargetId=eni-j6c2fp57q8rr47rp*****
&TrafficMirrorTargetType=NetworkInterface
&TrafficMirrorFilterId=tmf-j6cmls82xnc86vtpe****
&VirtualNetworkId=10
&Priority=2
&PacketLength=1500
&Enabled=false
&RegionId=cn-hongkong
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateTrafficMirrorSessionAttributeResponse>
    <RequestId>64DCAF03-E2C7-479A-ACEA-38B79876B006</RequestId>
</UpdateTrafficMirrorSessionAttributeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HttpCode 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. The specified traffic mirror session does not exist.
400 IncorrectStatus.TrafficMirrorSession The status of traffic mirror session is incorrect. The traffic mirror session is in an invalid state.
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. The specified Elastic Compute Service (ECS) instance does not exist.
400 ResourceNotFound.Slb The specified resource of SLB is not found. The specified SLB instance does not exist.
400 OperationDenied.SlbNotInVpc The specified SLB is not in any VPC. The specified SLB instance does not belong to a virtual private cloud (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. 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. An ENI cannot be specified as both the source and destination of a traffic mirror session.
400 InvalidLoadBalancerId.NotFound The specified resource of load balancer is not found. The specified SLB instance does not exist.
400 OperationDenied.FreeNetworkInterface The network interface is not attached to any ECS instance. The specified ENI is not associated with an ECS instance.
400 OperationDenied.ClassicSLB The operation is not allowed because of ClassicSLB. You cannot perform the operation on a CLB instance.

For a list of error codes, see Service error codes.