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

Usage notes

  • The UpdateTrafficMirrorFilterRuleAttribute operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the ListTrafficMirrorFilters operation to query the status of an inbound or outbound rule:
    • If the rule is in the Modifying state, the rule is being modified.
    • If the rule is in the Created state, the rule is modified.
  • You cannot repeatedly call the UpdateTrafficMirrorFilterRuleAttribute operation to modify an inbound or outbound rule within the specified 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 UpdateTrafficMirrorFilterRuleAttribute

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

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. The client token can contain only ASCII characters.

Note If you do not set this parameter, the system uses RequestId as ClientToken. RequestId may be different for each API request.
DryRun Boolean No false

Specifies whether to check the request without performing the operation. Valid values:

  • true: only checks the API request. The configuration of the inbound or outbound rule is not modified. The system checks the required parameters, request syntax, and limits. If the request fails to pass the check, an 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 check, 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 protocol that is 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: User Datagram Protocol (UDP)
RuleAction String No accept

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

  • accept: accepts network traffic.
  • drop: drops network traffic.
DestinationCidrBlock String No 10.0.0.0/24

The new destination CIDR block of the inbound or outbound traffic.

SourceCidrBlock String No 0.0.0.0/0

The new source CIDR block of the inbound or outbound traffic.

DestinationPortRange String No -1/-1

The new destination port range of the inbound or outbound traffic.

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

The new source port range of the inbound or outbound traffic.

Note If you set Protocol to ICMP, you cannot change the port range.
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.

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
&TrafficMirrorFilterRuleId=tmr-j6c89rzmtd3hhdugq****
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe637760
&DryRun=false
&Priority=1
&Protocol=ICMP
&RuleAction=accept
&DestinationCidrBlock=10.0.0.0/24
&SourceCidrBlock=0.0.0.0/0
&DestinationPortRange=-1/-1
&SourcePortRange=22/40
&RegionId=cn-hongkong
&Common request parameters

Sample responses

XML format

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

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

JSON format

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

{
  "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.