Adds a traffic classification rule to a traffic marking policy.
This API has been deprecated. We recommend migrating to Cbn(2017-09-12) - AddTrafficMatchRuleToTrafficMarkingPolicy for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.
Operation description
Usage notes
The AddTraficMatchRuleToTrafficMarkingPolicy operation is deprecated and will be discontinued soon. If you need to add a traffic classification rule to a traffic marking policy, call the AddTrafficMatchRuleToTrafficMarkingPolicy operation.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cen:AddTraficMatchRuleToTrafficMarkingPolicy |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
|
ClientToken |
string |
No |
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 token can contain only ASCII characters. Note
If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId may be different for each request. |
123e4567-e89b-12d3-a456-426**** |
|
DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
|
false |
|
TrafficMarkingPolicyId |
string |
Yes |
The ID of the traffic marking policy. |
tm-u9nxup5kww5po8**** |
|
TrafficMatchRules |
array |
No |
The information about the traffic classification rule. You can specify at most 50 traffic classification rules. |
|
|
object |
No |
The description of the traffic classification rule. |
||
|
MatchDscp |
integer |
No |
The differentiated services code point (DSCP) value that is used to match packets. Valid values: 0 to 63. The traffic classification rule matches the packets that contain the specified DSCP value. If you do not set this parameter, packets are considered a match regardless of the DSCP value. Note
The DSCP value that you specify for this parameter is the DSCP value that packets carry before they are transmitted over the inter-region connection. You can specify at most 50 traffic classification rules. |
5 |
|
DstCidr |
string |
No |
The destination CIDR block that is used to match packets. The traffic classification rule matches the packets whose destination IP addresses fall within the specified destination CIDR block. If you do not set this parameter, packets are considered a match regardless of the DSCP value. You can specify at most 50 traffic classification rules. |
10.10.10.0/24 |
|
TrafficMatchRuleDescription |
string |
No |
The description of the traffic classification rule. The description must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The description must start with a letter. You can specify at most 50 traffic classification rules. |
desctest |
|
Protocol |
string |
No |
The protocol that is used to match packets. Valid values: HTTP, HTTPS, TCP, UDP, SSH, and Telnet. For more information, log on to the Cloud Enterprise Network (CEN) console. You can specify at most 50 traffic classification rules. |
HTTP |
|
DstPortRange |
array |
No |
The destination port range that is used to match packets. Valid values: -1 and 1 to 65535. The traffic classification rule matches the packets whose destination ports fall within the destination port range. If you do not set this parameter, packets are considered a match regardless of the DSCP value. You can specify at most two ports. Take note of the following rules:
You can specify at most 50 traffic classification rules. |
|
|
integer |
No |
The destination port range that is used to match packets. Valid values: -1 and 1 to 65535. The traffic classification rule matches the packets whose destination ports fall within the destination port range. If you do not set this parameter, packets are considered a match regardless of the DSCP value. You can specify at most two ports. Take note of the following rules:
You can specify at most 50 traffic classification rules. |
80 |
|
|
SrcCidr |
string |
No |
The source CIDR block that is used to match packets. The traffic classification rule matches the packets whose source IP addresses fall within the specified source CIDR block. If you do not set this parameter, packets are considered a match regardless of the source IP address. You can specify at most 50 traffic classification rules. |
192.168.10.0/24 |
|
SrcPortRange |
array |
No |
The source port range that is used to match packets. Valid values: -1 and 1 to 65535. The traffic classification rule matches the packets whose source ports fall within the source port range. If you do not set this parameter, packets are considered a match regardless of the source port. You can specify at most two ports. Take note of the following rules:
You can specify at most 50 traffic classification rules. |
|
|
integer |
No |
The source port range that is used to match packets. Valid values: -1 and 1 to 65535. The traffic classification rule matches the packets whose source ports fall within the source port range. If you do not set this parameter, packets are considered a match regardless of the source port. You can specify at most two ports. Take note of the following rules:
You can specify at most 50 traffic classification rules. |
200 |
|
|
TrafficMatchRuleName |
string |
No |
The name of the traffic classification rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter. You can specify at most 50 traffic classification rules. |
nametest |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
The response. |
||
| RequestId |
string |
The ID of the request. |
0876E54E-3E36-5C31-89F0-9EE8A9266F9A |
Examples
Success response
JSON format
{
"RequestId": "0876E54E-3E36-5C31-89F0-9EE8A9266F9A"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidTrafficMarkingPolicyId.NotFound | Operation is failed because traffic marking policy id is not found. | The error message returned because the specified traffic marking policy ID (TrafficMarkingPolicyId) does not exist. |
| 400 | InstanceExist.TrafficMatchRules | The instance already exists. | The error message returned because the specified traffic match rules (TrafficMatchRules) already exist. |
| 400 | Duplicated.TrafficMatchRules | The parameter TrafficMatchRules are duplicated. | The error message returned because the traffic match rules (TrafficMatchRules) are duplicate. |
| 400 | IllegalParam.SrcCidr | SrcCidr is illegal. | The error message returned because the specified source CIDR block is invalid. |
| 400 | IncorrectStatus.TrafficMarkingPolicy | The status of TrafficMarkingPolicy is incorrect. | The error message returned because the status of the traffic marking policy does not support this operation. Try again later. |
| 400 | IllegalParam.DstCidr | DstCidr is illegal. | The error message returned because the specified destination CIDR block (DstCidr) is invalid. |
| 400 | IllegalParam.Protocol | Protocol is illegal. | The error message returned because the specified protocol is invalid. |
| 400 | InvalidParameter | Invalid parameter. | The error message returned because the parameter is set to an invalid value. |
| 400 | Unauthorized | The AccessKeyId is unauthorized. | The error message returned because you do not have the permissions to perform this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.