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
Precautions
The AddTraficMatchRuleToTrafficMarkingPolicy operation is deprecated and will be retired soon. To add a traffic classification rule to a traffic marking policy, use the AddTrafficMatchRuleToTrafficMarkingPolicy operation. This API document is no longer maintained.
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 generate a parameter value on your client to ensure that the value is unique across different requests. The ClientToken parameter supports only ASCII characters. Note
If you do not specify this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId of each API request may be different. |
123e4567-e89b-12d3-a456-426**** |
| DryRun |
boolean |
No |
Specifies whether to only precheck the request. Valid values:
|
false |
| TrafficMarkingPolicyId |
string |
Yes |
The ID of the traffic marking policy. |
tm-u9nxup5kww5po8**** |
| TrafficMatchRules |
array<object> |
No |
The list of traffic classification rules. You can add up to 50 traffic classification rules at a time. |
|
|
object |
No |
The information about the traffic classification rule. |
||
| MatchDscp |
integer |
No |
The Differentiated Services Code Point (DSCP) value of the traffic packet. Valid values: 0 to 63. The traffic classification rule matches traffic that contains the specified DSCP value. If you do not specify this parameter, the traffic classification rule matches traffic with any DSCP value. Note
The DSCP value refers to the DSCP value carried by the traffic packet before it enters the inter-region connection. You can add up to 50 traffic classification rules at a time. |
5 |
| DstCidr |
string |
No |
The destination CIDR block of the traffic packet. The traffic classification rule matches traffic whose destination IP address falls within the destination CIDR block. If you do not specify this parameter, the traffic classification rule matches traffic with any destination IP address. You can add up to 50 traffic classification rules at a time. |
10.10.10.0/24 |
| TrafficMatchRuleDescription |
string |
No |
The description of the traffic classification rule. You can add up to 50 traffic classification rules at a time. |
desctest |
| Protocol |
string |
No |
The protocol type of the traffic packet. The traffic classification rule supports matching traffic of various protocol types, such as HTTP, HTTPS, TCP, UDP, SSH, and Telnet. For more protocol types, log on to the Cloud Enterprise Network (CEN) console. You can add up to 50 traffic classification rules at a time. |
HTTP |
| DstPortRange |
array |
No |
The destination port of the traffic packet. Valid values: -1 and 1 to 65535. The traffic classification rule matches traffic whose destination port number falls within the destination port range. If you do not specify this parameter, the traffic classification rule matches traffic with any destination port number. You can enter up to two port numbers for this parameter. The input format is described as follows:
You can add up to 50 traffic classification rules at a time. |
|
|
integer |
No |
The destination port of the traffic packet. Valid values: -1 and 1 to 65535. The traffic classification rule matches traffic whose destination port number falls within the destination port range. If you do not specify this parameter, the traffic classification rule matches traffic with any destination port number. You can enter up to two port numbers for this parameter. The input format is described as follows:
You can add up to 50 traffic classification rules at a time. |
80 |
|
| SrcCidr |
string |
No |
The source CIDR block of the traffic packet. The traffic classification rule matches traffic whose source IP address falls within the source CIDR block. If you do not specify this parameter, the traffic classification rule matches traffic with any source IP address. You can add up to 50 traffic classification rules at a time. |
192.168.10.0/24 |
| SrcPortRange |
array |
No |
The source port of the traffic packet. Valid values: -1 and 1 to 65535. The traffic classification rule matches traffic whose source port number falls within the source port range. If you do not specify this parameter, the traffic classification rule matches traffic with any source port number. You can enter up to two port numbers for this parameter. The input format is described as follows:
You can add up to 50 traffic classification rules at a time. |
|
|
integer |
No |
The source port of the traffic packet. Valid values: -1 and 1 to 65535. The traffic classification rule matches traffic whose source port number falls within the source port range. If you do not specify this parameter, the traffic classification rule matches traffic with any source port number. You can enter up to two port numbers for this parameter. The input format is described as follows:
You can add up to 50 traffic classification rules at a time. |
200 |
|
| TrafficMatchRuleName |
string |
No |
The name of the traffic classification rule. You can add up to 50 traffic classification rules at a time. |
nametest |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| RequestId |
string |
The request ID. |
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.