すべてのプロダクト
Search
ドキュメントセンター

Cloud Enterprise Network:AddTraficMatchRuleToTrafficMarkingPolicy

最終更新日:Jun 10, 2026

トラフィックマーキングポリシーにトラフィック分類ルールを追加します。

説明

この API は廃止されました。一時的にアクセス可能ですが、更新やバグ修正対応は一切行われません。代わりに Cbn(2017-09-12) - AddTrafficMatchRuleToTrafficMarkingPolicy への移行を推奨します。より強化された機能に加え、サポートも引き続きご利用いただけます。

操作説明

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.

今すぐお試しください

この API を OpenAPI Explorer でお試しください。手作業による署名は必要ありません。呼び出しに成功すると、入力したパラメーターに基づき、資格情報が組み込まれた SDK コードが自動的に生成されます。このコードをダウンロードしてローカルで使用できます。

テスト

RAM 認証

下表に、この API を呼び出すために必要な認証情報を示します。認証情報は、RAM (Resource Access Management) ポリシーを使用して定義できます。以下で各列名について説明します。

  • アクション:特定のリソースに対して実行可能な操作。ポリシー構文ではAction要素として指定します。

  • API:アクションを具体的に実行するための API。

  • アクセスレベル:各 API に対して事前定義されているアクセスの種類。有効な値:create、list、get、update、delete。

  • リソースタイプ:アクションが作用するリソースの種類。リソースレベルでの権限をサポートするかどうかを示すことができます。ポリシーの有効性を確保するため、アクションの対象として適切なリソースを指定してください。

    • リソースレベルの権限を持つ API の場合、必要なリソースタイプはアスタリスク (*) でマークされます。ポリシーのResource要素で対応する ARN を指定してください。

    • リソースレベルの権限を持たない API の場合、「すべてのリソース」と表示され、ポリシーのResource要素でアスタリスク (*) でマークされます。

  • 条件キー:サービスによって定義された条件のキー。このキーにより、きめ細やかなアクセス制御が可能になります。この制御は、アクション単体に適用することも、特定のリソースに対するアクションに適用することもできます。Alibaba Cloud は、サービス固有の条件キーに加えて、すべての RAM 統合サービスに適用可能な一連の共通条件キーを提供しています。

  • 依存アクション:ある特定のアクションを実行するために、前提として実行が必要となる他のアクション。依存アクションの権限も RAM ユーザーまたは RAM ロールに付与する必要があります。

アクション

アクセスレベル

リソースタイプ

条件キー

依存アクション

cen:AddTraficMatchRuleToTrafficMarkingPolicy

create

*All Resource

*

なし なし

リクエストパラメーター

パラメーター

必須 / 任意

説明

ClientToken

string

任意

リクエストのべき等性を確保するために使用されるクライアントトークン。

クライアントを使用して値を生成できますが、異なるリクエスト間で一意であることを確認する必要があります。トークンには ASCII 文字のみを含めることができます。

説明

このパラメーターを設定しない場合、ClientToken は RequestId の値に設定されます。RequestId の値はリクエストごとに異なる場合があります。

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

DryRun

boolean

任意

ドライランを実行するかどうかを指定します。有効な値:

  • true: ドライランを実行します。システムは必須パラメーター、リクエスト構文、および使用制限をチェックします。リクエストがドライランに失敗した場合、エラーメッセージが返されます。リクエストがドライランに合格した場合、DryRunOperation エラーコードが返されます。

  • false (デフォルト): ドライランを実行し、リクエストを送信します。

false

TrafficMarkingPolicyId

string

必須

トラフィックマーキングポリシーの ID。

tm-u9nxup5kww5po8****

TrafficMatchRules

array<object>

任意

トラフィック分類ルールの情報。

最大 50 個のトラフィック分類ルールを指定できます。

object

任意

The description of the traffic classification rule.

MatchDscp

integer

任意

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.

説明

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

任意

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

任意

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

任意

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

任意

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:

  • If you enter only one port number such as 1, the system matches the packets whose destination port is port 1.

  • If you enter two port numbers such as 1 and 200, the system matches the packets whose destination ports fall between 1 and 200.

  • If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, packets are considered a match regardless of the destination port.

You can specify at most 50 traffic classification rules.

integer

任意

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:

  • If you enter only one port number such as 1, the system matches the packets whose destination port is port 1.

  • If you enter two port numbers such as 1 and 200, the system matches the packets whose destination ports fall between 1 and 200.

  • If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, packets are considered a match regardless of the destination port.

You can specify at most 50 traffic classification rules.

80

SrcCidr

string

任意

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

任意

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:

  • If you enter only one port number such as 1, the system matches the packets whose source port is 1.

  • If you enter two port numbers such as 1 and 200, the system matches the packets whose source ports fall between 1 and 200.

  • If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, packets are considered a match regardless of the source port.

You can specify at most 50 traffic classification rules.

integer

任意

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:

  • If you enter only one port number such as 1, the system matches the packets whose source port is 1.

  • If you enter two port numbers such as 1 and 200, the system matches the packets whose source ports fall between 1 and 200.

  • If you enter two port numbers and one of them is -1, the other port number must also be -1. In this case, packets are considered a match regardless of the source port.

You can specify at most 50 traffic classification rules.

200

TrafficMatchRuleName

string

任意

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

レスポンスフィールド

フィールド

説明

object

The response.

RequestId

string

The ID of the request.

0876E54E-3E36-5C31-89F0-9EE8A9266F9A

成功レスポンス

JSONJSON

{
  "RequestId": "0876E54E-3E36-5C31-89F0-9EE8A9266F9A"
}

エラーコード

HTTP ステータスコード

エラーコード

エラーメッセージ

説明

400 InvalidTrafficMarkingPolicyId.NotFound Operation is failed because traffic marking policy id is not found.
400 InstanceExist.TrafficMatchRules The instance already exists.
400 Duplicated.TrafficMatchRules The parameter TrafficMatchRules are duplicated.
400 IllegalParam.SrcCidr SrcCidr is illegal.
400 IncorrectStatus.TrafficMarkingPolicy The status of TrafficMarkingPolicy is incorrect.
400 IllegalParam.DstCidr DstCidr is illegal.
400 IllegalParam.Protocol Protocol is illegal.
400 InvalidParameter Invalid parameter.
400 Unauthorized The AccessKeyId is unauthorized.

完全なリストについては、「エラーコード」をご参照ください。

変更履歴

完全なリストについては、「変更履歴」をご参照ください。