Modifies the configuration of an inbound or outbound rule for traffic mirroring.

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 a sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateTrafficMirrorFilterRuleAttribute

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

RegionId String Yes cn-hongkong

The ID of the region to which the mirrored traffic 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.

TrafficMirrorFilterRuleId String Yes tmr-j6c89rzmtd3hhdugq****

The ID of the inbound or outbound rule.

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

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. ClientToken supports only ASCII characters. It can contain up to 64 ASCII characters.

DryRun Boolean No false

Specifies whether to precheck this request. Valid values:

  • true: only checks the API request. The configuration of the inbound or outbound rule is not modified. The system prechecks the required parameters, request format, and service limits. If the request fails the precheck, the corresponding error code 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 inbound or outbound rule is modified.
Priority Integer No 1

The new priority of the inbound or outbound rule. A smaller value indicates a higher priority.

Protocol String No ICMP

The new transport layer protocol used by the traffic to be mirrored by the inbound or outbound rule. Valid values:

  • ALL: all protocols
  • ICMP: Internet Control Message Protocol (ICMP)
  • TCP: TCP
  • UDP: UDP
RuleAction String No accept

The new collection policy of the inbound or outbound rule. Valid values:

  • accept: collects network traffic.
  • drop: does not collect network traffic.
DestinationCidrBlock String No 10.0.0.0/24

The new destination CIDR block of network traffic, which is specified in the inbound or outbound rule.

SourceCidrBlock String No 0.0.0.0/0

The new source CIDR block of network traffic, which is specified in the inbound or outbound rule.

DestinationPortRange String No -1/-1

The new destination port range of network traffic, which is specified in the inbound or outbound rule.

Note When Protocol is set to ICMP, you cannot change the port range.
SourcePortRange String No 22/40

The source port range of network traffic, which is specified in the inbound or outbound rule.

Note When Protocol is set to ICMP, you cannot change the port range.

Response parameters

Parameter Type Example Description
RequestId String 02EB8585-D4DC-4E29-A0F4-7C588C82863C

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateTrafficMirrorFilterRuleAttribute
&RegionId=cn-hongkong
&TrafficMirrorFilterRuleId=tmr-j6c89rzmtd3hhdugq****
&<Common request parameters>

Sample success responses

XML format

<UpdateTrafficMirrorFilterRuleAttributeResponse>
      <RequestId>02EB8585-D4DC-4E29-A0F4-7C588C82863C</RequestId>
</UpdateTrafficMirrorFilterRuleAttributeResponse>

JSON format

{
    "RequestId": "02EB8585-D4DC-4E29-A0F4-7C588C82863C"
}

Error codes

HttpCode Error code Error message Description
400 ResourceNotFound.TrafficMirrorRule The specified resource of traffic mirror rule is not found. The error message returned because the specified filter does not exist.
400 IncorrectStatus.TrafficMirrorRule The status of traffic mirror rule is incorrect. The error message returned because the specified filter is in an invalid state.
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.

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