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

Virtual Private Cloud:CreateTrafficMirrorSession

最終更新日:Apr 27, 2026

ミラーセッションを作成します。

操作説明

CreateTrafficMirrorSession インターフェイスは非同期インターフェイスです。つまり、システムはインスタンス ID を返しますが、その時点でミラーセッションはまだ作成されておらず、バックグラウンドで作成タスクが実行中です。ListTrafficMirrorSessions を呼び出して、ミラーセッションの作成ステータスを確認できます。

  • ミラーセッションのステータスが Creating の場合、ミラーセッションが作成中であることを示します。

  • ミラーセッションのステータスが Created の場合、ミラーセッションの作成が完了したことを示します。

今すぐお試しください

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

テスト

RAM 認証

この操作の認証情報はありません。問題が発生した場合は、アカウントマネージャーにご連絡ください。

リクエストパラメーター

パラメーター

必須 / 任意

説明

TrafficMirrorSessionDescription

string

任意

ミラーセッションの説明です。

説明は 1~256 文字で指定する必要があります。また、http:// または https:// で開始することはできません。

This is a trafficmirrorsession.

TrafficMirrorSessionName

string

任意

ミラーセッションの名前です。

名前は 1~128 文字で指定する必要があります。また、http:// または https:// で開始することはできません。

test

ClientToken

string

任意

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

クライアント側で値を生成できますが、すべてのリクエストの中で一意であることを保証する必要があります。クライアントトークンには ASCII 文字のみを使用できます。

説明

このパラメーターを設定しない場合、システムは RequestIdClientToken として使用します。RequestId は各 API リクエストごとに異なる場合があります。

0c593ea1-3bea-11e9-b96b-88e9fe63****

DryRun

boolean

任意

ドライランを実行するかどうかを指定します。有効な値は次のとおりです。

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

  • false (デフォルト):ドライランを実行せずにリクエストを送信します。ドライランに成功した場合、操作が実行されます。

false

TrafficMirrorTargetId

string

必須

ミラーターゲットの ID です。ミラーターゲットとして指定できるのは、Elastic Network Interface (ENI) または Server Load Balancer (SLB) インスタンスのみです。

eni-j6c8znm5l1yt4sox****

TrafficMirrorTargetType

string

必須

ミラーターゲットのタイプです。有効な値は次のとおりです。

  • NetworkInterface:ENI

  • SLB:SLB インスタンス

NetworkInterface

TrafficMirrorFilterId

string

必須

フィルターの ID です。

tmf-j6cmls82xnc86vtpe****

VirtualNetworkId

integer

任意

VXLAN ネットワーク識別子 (VNI) です。有効な値は 016777215 です。

VNI を使用して、ミラーターゲットで異なるセッションからのミラーされたトラフィックを識別できます。カスタム VNI を指定することも、システムが割り当てるランダムな VNI を使用することも可能です。システムにランダムな VNI を割り当てさせたい場合は、値を入力しないでください。

1

Priority

integer

必須

ミラーセッションの優先度です。有効な値は 132766 です。

値が小さいほど優先度が高くなります。同一リージョンで同一アカウントにより作成されるミラーセッションに対して、同じ優先度を指定することはできません。

1

Enabled

boolean

任意

ミラーセッションを有効にするかどうかを指定します。有効な値は次のとおりです。

  • false (デフォルト):ミラーセッションを有効にしません。

  • true:ミラーセッションを有効にします。

false

PacketLength

integer

任意

最大転送単位です。

有効な値は 64~9600 です。デフォルト値は 1500 です。

1500

TrafficMirrorSourceIds

array

必須

ミラーソースの ID です。ミラーソースとして指定できるのは ENI のみです。N のデフォルト値は 1 であり、ミラーセッションに追加できるミラーソースは 1 つのみです。

eni-j6c2fp57q8rr47rp****

string

任意

ミラーソースの ID です。ミラーソースとして指定できるのは ENI のみです。N のデフォルト値は 1 であり、ミラーセッションに追加できるミラーソースは 1 つのみです。

eni-j6c2fp57q8rr47rp****

RegionId

string

必須

ミラーセッションが属するリージョンの ID です。DescribeRegions 操作を呼び出して、最新のリージョンリストを照会できます。トラフィックミラーリングをサポートするリージョンの詳細については、「トラフィックミラーリングの概要」をご参照ください。

cn-hongkong

ResourceGroupId

string

任意

ミラーされたトラフィックが属するリソースグループの ID です。

rg-bp67acfmxazb4ph****

Tag

array<object>

任意

リソースのタグです。

object

任意

リソースのタグです。

Key

string

任意

タグキーです。最大 20 個のタグキーを指定できます。タグキーは空文字列であってはなりません。

タグキーの長さは最大 128 文字です。aliyun または acs: で開始することはできず、http:// または https:// を含むことはできません。

FinanceDept

Value

string

任意

タグ値です。最大 20 個のタグ値を指定できます。タグ値は空文字列であってもかまいません。

タグ値の長さは最大 128 文字です。aliyun または acs: で開始することはできず、http:// または https:// を含むことはできません。

FinanceJoshua

レスポンスフィールド

フィールド

説明

object

TrafficMirrorSessionId

string

ミラーセッションの ID です。

tms-j6ce5di4w7nvigfjz****

RequestId

string

リクエストの ID です。

0ED8D006-F706-4D23-88ED-E11ED28DCAC0

ResourceGroupId

string

ミラーされたトラフィックが属するリソースグループの ID です。

rg-bp67acfmxazb4ph****

成功レスポンス

JSONJSON

{
  "TrafficMirrorSessionId": "tms-j6ce5di4w7nvigfjz****",
  "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
  "ResourceGroupId": "rg-bp67acfmxazb4ph****"
}

エラーコード

HTTP ステータスコード

エラーコード

エラーメッセージ

説明

400 IncorrectBusinessStatus.TrafficMirror The business status of traffic mirror is incorrect.
400 OptInRequired.TrafficMirror You need to subscribe to the traffic mirror service first.
400 DuplicatedParam.SourceInstanceIds The parameter of source instance IDs contains duplicate values.
400 OperationDenied.DuplicateRole The network interface must not be the source and the target of traffic mirror sessions at the same time.
400 ResourceNotFound.NetworkInterface The specified resource of %s is not found.
400 ResourceNotFound.EcsInstance The specified resource of ECS instance is not found.
400 ResourceNotFound.Slb The specified resource of SLB is not found.
400 OperationDenied.SlbNotInVpc The specified SLB is not in any VPC.
400 ResourceNotFound.TrafficMirrorFilter The specified resource of traffic mirror filter is not found.
400 IncorrectStatus.TrafficMirrorFilter The status of traffic mirror filter is incorrect.
400 OperationDenied.EcsNotSupportTrafficMirror The ECS instance does not support traffic mirroring.
400 QuotaExceeded.SessionNum The quota of the number of traffic mirror sessions is exceeded.
400 QuotaExceeded.FilterRelatedSession The quota of the number of traffic mirror sessions related to one filter is exceeded.
400 QuotaExceeded.SourceNumPerSession The quota of the number of traffic mirror sources per session is exceeded.
400 QuotaExceeded.NetworkInterfaceRelatedSession The quota of the number of traffic mirror sessions related to one network interface is exceeded.
400 QuotaExceeded.SlbRelatedSession The quota of the number of traffic mirror sessions related to one SLB is exceeded.
400 UnsupportedRegion The feature is not supported in current region.
400 InvalidLoadBalancerId.NotFound The specified resource of load balancer is not found.
400 OperationDenied.FreeNetworkInterface The network interface is not attached to any ECS instance.
400 OperationDenied.ClassicSLB The operation is not allowed because of ClassicSLB.
400 ResourceNotFound.TargetInstance The specified target instance for traffic mirroring is not found.
400 QuotaExceeded.SourceNumPerTarget The maximum number of traffic mirror sources for a target is exceeded.
400 IncorrectStatus.NetworkInterface The status of network interface is incorrect.
400 OperationFailed.NotSupportBizType The specified instance type does not support the operation.
400 IllegalParam.Priority The specified Priority is illegal or the same as other mirroring sessions.
400 OperationDenied.UnsupportedTargetType Traffic mirror target must be SLB if traffic mirror sources contain nat gateway network interface.
400 OperationDenied.TargetTypeNotSupportGatewayLoadBalancerEndpoint Operation denied because of target type can not be GatewayLoadBalancerEndpoint.
400 OperationDenied.TargetTypeNotSupportBondEni Operation denied because of target type can not be Bond Network Interface.
400 OperationDenied.InvalidTargetBondEniType The traffic mirroring target does not support the entered bond ENI type.
400 OperationDenied.InvalidSourceBondEniType The traffic mirroring source does not support the entered bond ENI type.
400 OperationDenied.TargetTypeNotSupportTrafficMirrorFullPacket The traffic mirror session target type does not support the feature of mirroring source full packet.
400 OperationDenied.TrafficMirrorSessionSourceFullPacketNotSupport The traffic mirror session does not support the feature of mirroring source full packet.
400 QuotaExceeded.SessionNumPerTarget The quota of the number of traffic mirror sessions per target is exceeded.
400 OperationDenied.NotSupportBondEniAsTrafficMirrorSource The operation is not allowed because bond eni cannot be the source of traffic mirror.
400 IncorrectStatus.TrafficMirrorSessionTarget The status of the target of the traffic mirror session is incorrect.
404 ResourceNotFound.GatewayLoadBalancerEndpoint GatewayLoadBalancerEndpoint instance not found.

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

変更履歴

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