Modifies the configuration of a traffic mirror session.

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.

RegionId String Yes cn-hongkong

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

TrafficMirrorSessionId String Yes tms-j6cla50buc44ap8tu****

The new ID of the traffic mirror session.

TrafficMirrorSessionDescription String No This is a new session.

The new description of the traffic mirror session. The description must be 2 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 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

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 value, but you must make sure that it is unique among different requests. Client Token can contain only ASCII characters. It cannot exceed 64 characters in length.

DryRun Boolean No false

Specifies whether to precheck this request only. Valid values:

  • true: only checks the API request. If you select this option, the configuration of the traffic mirror session is not modified after the request passes the check. The system checks the required parameters, request syntax, and service limits. If the request fails the precheck, the corresponding error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false: sends the request. This is the default value. If the request passes the precheck, a 2XX HTTP status code is returned and the configuration of the traffic mirror session is modified.
TrafficMirrorTargetId String No eni-j6c2fp57q8rr47rp*****

The ID of the new traffic mirror destination.

TrafficMirrorTargetType String No NetworkInterface

The type of the new 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 new traffic mirroring filter.

VirtualNetworkId Integer No 10

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

You can specify VNIs for the traffic mirror destination to identify mirrored traffic from different sessions. 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 the same priority for traffic mirror sessions that are created in the same region with the same Alibaba Cloud account.

Enabled Boolean No false

Specifies whether to enable the traffic mirror session.

  • false (default): does not enable the traffic mirror session.
  • true: enables the traffic mirror session.

Response parameters

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

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateTrafficMirrorSessionAttribute
&RegionId=cn-hongkong
&TrafficMirrorSessionId=tms-j6cla50buc44ap8tu****
&<Common request parameters>

Sample success responses

XML format

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

JSON format

{
    "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. The error message returned because the mirrored traffic is in an invalid state.
400 OptInRequired.TrafficMirror You need to subscribe to the traffic mirror service first. The error message returned because traffic mirroring is disabled.
400 DuplicatedParam.Priority The specified priority conflicts with the existing priority. The error message returned because the specified priority is the same as an existing one.
400 ResourceNotFound.TrafficMirrorSession The specified resource of traffic mirror session is not found. The error message returned because the specified traffic mirror session does not exist.
400 IncorrectStatus.TrafficMirrorSession The status of traffic mirror session is incorrect. The error message returned because the traffic mirror session is in an invalid state.
400 ResourceNotFound.TrafficMirrorFilter The specified resource of traffic mirror filter is not found. The error message returned because the specified filter does not exist.
400 IncorrectStatus.TrafficMirrorFilter The status of traffic mirror filter is incorrect. The error message returned because 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 error message returned because 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 error message returned because the specified ENI does not exist.
400 ResourceNotFound.EcsInstance The specified resource of ECS instance is not found. The error message returned because the specified Elastic Compute Service (ECS) instance does not exist.
400 ResourceNotFound.Slb The specified resource of SLB is not found. The error message returned because the specified SLB instance does not exist.
400 OperationDenied.SlbNotInVpc The specified SLB is not in any VPC. The error message returned because 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 error message returned because 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 error message returned because 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 error message returned because 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. The error message returned because 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 error message returned because the specified SLB instance does not exist.
400 OperationDenied.FreeNetworkInterface The network interface is not attached to any ECS instance. The error message returned because the specified ENI is not associated with an ECS instance.

For a list of error codes, visit the API Error Center.