All Products
Search
Document Center

Cloud Enterprise Network:UpdateTrafficMarkingPolicyAttribute

Last Updated:Jul 19, 2024

Modifies the name, description, and traffic classification rules of a traffic marking policy.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ClientTokenstringNo

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 and cannot exceed 64 characters in length.

123e4567-e89b-12d3-a456-426****
DryRunbooleanNo

Specifies whether to perform a dry run. Valid values:

  • true: preforms a dry run. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and sends the request.
false
TrafficMarkingPolicyIdstringYes

The ID of the traffic marking policy.

tm-u9nxup5kww5po8****
TrafficMarkingPolicyNamestringNo

The new name of the traffic marking policy.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.

nametest
TrafficMarkingPolicyDescriptionstringNo

The new description of the traffic marking policy.

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.

desctest
AddTrafficMatchRulesarray<object>No

The traffic classification rules to be added to the traffic marking policy.

You can add at most 50 traffic classification rules in each call.

objectNo

The traffic classification rules to be added to the traffic marking policy.

MatchDscpintegerNo

The Differentiated Service Code Point (DSCP) value that is used to match packets. Valid values: 0 to 63.

Requests that carry the specified DSCP value are considered a match. If you do not specify a DSCP value, 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 create up to 50 traffic classification rules in each call. You can specify a DSCP value for each traffic classification rule.

1
DstCidrstringNo

The destination CIDR block that is used to match packets.

Packets whose destination IP addresses fall into the specified destination CIDR block meet the traffic classification rule. If you do not specify a destination CIDR block, all packets meet the traffic classification rule.

You can create up to 50 traffic classification rules in each call. You can specify a destination CIDR block for each traffic classification rule.

172.30.0.0/24
TrafficMatchRuleDescriptionstringNo

The description of the traffic classification rule.

You can create up to 50 traffic classification rules in each call. You can specify a description for each traffic classification rule.

This parameter is optional. If you enter a description, it must be 1 to 256 characters in length and cannot start with http:// or https://.

test1
ProtocolstringNo

The protocol that is used to match packets.

Traffic classification rules support the following protocols: HTTP, HTTPS, TCP, UDP, SSH, and Telnet. For more information, log on to the CEN console.

Some protocols use a fixed port. Click to view the protocols and ports.

  • If the protocol is ICMP, set the destination port to -1.
  • If the protocol is GRE, set the destination port to -1.
  • If the protocol is SSH, set the destination port to 22.
  • If the protocol is Telnet, set the destination port to 23.
  • If the protocol is HTTP, set the destination port to 80.
  • If the protocol is HTTPS, set the destination port to 443.
  • If the protocol is MS SQL, set the destination port to 1443.
  • If the protocol is Oracle, set the destination port to 1521.
  • If the protocol is Mysql, set the destination port to 3306.
  • If the protocol is RDP, set the destination port to 3389.
  • If the protocol is Postgre SQL, set the destination port to 5432.
  • If the protocol is Redis, the destination port must be 6379.

You can create up to 50 traffic classification rules in each call. You can specify a protocol for each traffic classification rule.

UDP
DstPortRangearrayNo

The destination port range that is used to match packets. Valid values: -1 and 1 to 65535.

Packets whose destination ports fall within the specified destination port range are considered a match. If you do not specify a destination port range, packets are considered a match regardless of the destination port.

You can enter up to two port numbers. Take note of the following rules:

  • If you enter only one port number, such as 1, packets whose destination port is 1 match the traffic classification rule. A value of -1 specifies all destination ports.
  • If you enter two port numbers, such as 1 and 200, packets whose destination ports fall into 1 and 200 are considered a match.
  • If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, all packets meet the traffic classification rule.

You can create up to 50 traffic classification rules in each call. You can specify a destination port range for each traffic classification rule.

integerNo

The destination port range that is used to match packets. Valid values: -1 and 1 to 65535.

Packets whose destination ports fall within the specified destination port range are considered a match. If you do not specify a destination port range, packets are considered a match regardless of the destination port.

You can enter up to two port numbers. Take note of the following rules:

  • If you enter only one port number, such as 1, packets whose destination port is 1 match the traffic classification rule.
  • If you enter two port numbers, such as 1 and 200, packets whose destination ports fall into 1 and 200 are considered a match.
  • If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, all packets meet the traffic classification rule.

You can create up to 50 traffic classification rules in each call. You can specify a destination port range for each traffic classification rule.

77
SrcCidrstringNo

The source CIDR block that is used to match packets.

Packets whose source IP addresses fall into the specified source CIDR block meet the traffic classification rule. If you do not specify a source CIDR block, all packets meet the traffic classification rule.

You can create up to 50 traffic classification rules in each call. You can specify a source CIDR block for each traffic classification rule.

10.128.32.0/19
SrcPortRangearrayNo

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 specify this parameter, packets are considered a match regardless of the source port.

You can enter up to two port numbers. Take note of the following rules:

  • If you enter only one port number, such as 1, packets whose source port is 1 are considered a match. A value of -1 specifies all source ports.
  • If you enter two port numbers, such as 1 and 200, packets whose source ports fall into 1 and 200 are considered a match.
  • If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, all packets meet the traffic classification rule.

You can create up to 50 traffic classification rules in each call. You can specify a source port range for each traffic classification rule.

integerNo

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 specify this parameter, packets are considered a match regardless of the source port.

You can enter up to two port numbers. Take note of the following rules:

  • If you enter only one port number, such as 1, packets whose source port is 1 are considered a match.
  • If you enter two port numbers, such as 1 and 200, packets whose source ports fall into 1 and 200 are considered a match.
  • If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, all packets meet the traffic classification rule.

You can create up to 50 traffic classification rules in each call. You can specify a source port range for each traffic classification rule.

22
TrafficMatchRuleNamestringNo

The name of the traffic classification rule.

You can create up to 50 traffic classification rules in each call. You can specify a name for each traffic classification rule.

The name can be empty or 1 to 128 characters in length, and cannot start with http:// or https://.

Guangzhou Testing
DeleteTrafficMatchRulesarray<object>No

The traffic classification rules to be deleted from the traffic marking policy.

Note Specify detailed information about the traffic classification rule, such as the source CIDR block, destination CIDR block, source port, destination port, and DSCP value. If you do not specify sufficient information, the system may fail to match the traffic classification rule that you want to delete.
objectNo

The traffic classification rules to be deleted from the traffic marking policy.

MatchDscpintegerNo

The DSCP value that is used to match packets.

3
DstCidrstringNo

The destination CIDR block that is used to match packets.

192.168.200.3/32
TrafficMatchRuleDescriptionstringNo

The description of the traffic classification rule.

This parameter is optional. If you enter a description, it must be 1 to 256 characters in length, and cannot start with http:// or https://.

Hangzhou-to-Qingdao CAT
ProtocolstringNo

The protocol that is used to match packets.

You can call the ListTrafficMarkingPolicies operation to query the details about a traffic classification rule.

TCP
DstPortRangearrayNo

The destination port range that is used to match packets.

integerNo

The destination port range that is used to match packets.

-1
SrcCidrstringNo

The source CIDR block that is used to match packets.

10.72.0.0/16
SrcPortRangearrayNo

The source port range that is used to match packets.

integerNo

The source port range that is used to match packets.

23
TrafficMatchRuleNamestringNo

The name of the traffic classification rule.

The name can be empty or 1 to 128 characters in length, and cannot start with http:// or https://.

test

Response parameters

ParameterTypeDescriptionExample
object

The response.

RequestIdstring

The ID of the request.

60BB11B2-7BF4-54DC-BCC9-F706E1EB02AC

Examples

Sample success responses

JSONformat

{
  "RequestId": "60BB11B2-7BF4-54DC-BCC9-F706E1EB02AC"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidTrafficMarkingPolicyId.NotFoundTrafficMarkingPolicyId is not found.The error message returned because the specified traffic marking policy ID (TrafficMarkingPolicyId) does not exist.
400IncorrectStatus.TrafficMarkingPolicyThe 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.
400Duplicated.AddTrafficMatchRulesThe parameter AddTrafficMatchRules are duplicated. -
400Duplicated.DeleteTrafficMatchRuleseThe parameter DeleteTrafficMatchRules are duplicated. -
400InstanceExist.AddTrafficMatchRulesThe instance already exists.The error message returned because the specified instance already exists.
400Duplicated.AddTrafficMatchRulesAndDeleteTrafficMatchRulesThe same rule in AddTrafficMatchRules and DeleteTrafficMatchRules is not supported..The error message returned because the AddTrafficMatchRules and DeleteTrafficMatchRules cannot specify the same route. Delete duplicate routes and try again.
400IllegalParam.DstPortRangeThe specified DstPortRange is illegal.The specified DstPortRange is illegal.
400IllegalParam.SrcPortRangeThe specified SrcPortRange is illegal.-
400InvalidParameterInvalid parameter.The error message returned because the parameter is set to an invalid value.
400UnauthorizedThe AccessKeyId is unauthorized.The error message returned because you do not have the permissions to perform this operation.
404InvalidDeleteTrafficMatchRules.NotFoundThe specified DeleteTrafficMatchRules are not found.The error message returned because the value of the DeleteTrafficMatchRules parameter does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-04-19The Error code has changedView Change Details
2024-03-15The Error code has changedView Change Details
2023-09-08The Error code has changedView Change Details
2023-01-09The Error code has changed. The request parameters of the API has changedView Change Details
2021-11-26Add OperationView Change Details