全部產品
Search
文件中心

Virtual Private Cloud:UpdateTrafficMirrorSessionAttribute - 修改流量鏡像會話的配置資訊

更新時間:Apr 27, 2026

修改鏡像會話的配置資訊。

介面說明

  • UpdateTrafficMirrorSessionAttribute 介面屬於非同步介面,即系統返回一個請求 ID,但該鏡像會話的配置資訊尚未修改成功,系統背景修改任務仍在進行。您可以調用 ListTrafficMirrorSessions 查詢鏡像會話的配置資訊的修改狀態:
    • 當鏡像會話的配置資訊處於 Modifying 狀態時,表示鏡像會話的配置資訊正在修改中。

    • 當鏡像會話的配置資訊處於 Created 狀態時,表示鏡像會話的配置資訊修改成功。

  • UpdateTrafficMirrorSessionAttribute 介面不支援並發修改同一個鏡像會話的配置資訊。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

vpc:UpdateTrafficMirrorSessionAttribute

update

*TrafficMirrorSession

acs:vpc:{#regionId}:{#accountId}:trafficmirrorsession/{#TrafficMirrorSessionId}

TrafficMirrorFilter

acs:vpc:{#regionId}:{#accountId}:trafficmirrorfilter/{#TrafficMirrorFilterId}

請求參數

名稱

類型

必填

描述

樣本值

TrafficMirrorSessionDescription

string

要修改的鏡像會話描述。

描述長度為 1~256 個字元,不能以http://https://開頭。

This is a new session.

TrafficMirrorSessionName

string

要修改的鏡像會話名稱。

名稱長度為 1~128 個字元,不能以http://https://開頭。

abc

ClientToken

string

用戶端 Token,用於保證請求的等冪性。

從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。

說明

若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 標識。每次 API 請求的 RequestId 可能不一樣。

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

DryRun

boolean

是否只預檢此次請求,取值:

  • true:發送檢查請求,不會修改鏡像會話的配置資訊。檢查項包括是否填寫了必需參數、請求格式、業務限制。如果檢查不通過,則返回對應錯誤。如果檢查通過,則返回錯誤碼DryRunOperation

  • false(預設值):發送正常請求,通過檢查後返回 2xx HTTP 狀態代碼並直接修改鏡像會話的配置資訊。

false

TrafficMirrorSessionId

string

要修改的鏡像會話的執行個體 ID。

tms-j6cla50buc44ap8tu****

TrafficMirrorTargetId

string

要修改的鏡像目的執行個體 ID。

eni-j6c2fp57q8rr47rp*****

TrafficMirrorTargetType

string

要修改的鏡像目的類型,取值:

  • NetworkInterface:彈性網卡。

  • SLB:私網Server Load Balancer執行個體。

NetworkInterface

TrafficMirrorFilterId

string

要修改的流量鏡像篩選條件的執行個體 ID。

tmf-j6cmls82xnc86vtpe****

VirtualNetworkId

integer

要修改的指定 VNI,用來區分不同的鏡像流量,取值範圍為 0~16777215。 您可以通過 VNI 在鏡像目的區分不同會話的鏡像流量。您可以自訂 VNI 的值,也可以由系統隨機分配該值。如果由系統隨機分配,該參數無需配置。

10

Priority

integer

要修改的鏡像會話的優先順序,取值範圍為 1~32766。 數字越小,優先順序越高。同一帳號在同一個地區建立的鏡像會話優先順序不能重複。

2

PacketLength

integer

指定被鏡像的原始報文長度(不包含 VXLAN 報文長度),預設值 1500,取值範圍:648500,單位:位元組。

  • 該參數的大小會影響鏡像目的收到的報文長度,詳情請參見流量鏡像概述中的鏡像報文長度和 MTU 限制。

  • 該參數僅在部分地區可用,詳情請參見建立和管理流量鏡像中的鏡像報文長度參數描述。

1500

Enabled

boolean

是否開啟流量會話,取值:

  • false(預設值):不開啟流量會話。

  • true:開啟流量會話。

false

RegionId

string

鏡像會話的所屬地區 ID。您可以通過調用 DescribeRegions 介面擷取地區 ID。關於流量鏡像支援的地區,請參見流量鏡像概述

cn-hongkong

返回參數

名稱

類型

描述

樣本值

object

請求 ID。

RequestId

string

請求 ID。

64DCAF03-E2C7-479A-ACEA-38B79876B006

樣本

正常返回樣本

JSON格式

{
  "RequestId": "64DCAF03-E2C7-479A-ACEA-38B79876B006"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

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.Priority The specified priority conflicts with the existing priority. 指定的優先順序參數與已有的優先順序重複。
400 ResourceNotFound.TrafficMirrorSession The specified resource of traffic mirror session is not found. 指定的流量鏡像會話不存在。
400 IncorrectStatus.TrafficMirrorSession The status of traffic mirror session is incorrect. 流量鏡像工作階段狀態不正確。
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 QuotaExceeded.FilterRelatedSession The quota of the number of traffic mirror sessions related to one filter is exceeded. 流量鏡像篩選條件所關聯的鏡像會話數量配額超限。
400 ResourceNotFound.NetworkInterface The specified resource of network interface is not found. 指定的網卡不存在。
400 ResourceNotFound.EcsInstance The specified resource of ECS instance is not found. 指定的ECS執行個體不存在。
400 ResourceNotFound.Slb The specified resource of SLB is not found. 指定的SLB不存在。
400 OperationDenied.SlbNotInVpc The specified SLB is not in any VPC. 指定的SLB不屬於任何一個VPC。
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. 單個SLB所能關聯的流量鏡像會話數量配額超限。
400 OperationDenied.EcsNotSupportTrafficMirror The ECS instance does not support traffic mirroring. ECS執行個體不支援流量鏡像功能。
400 OperationDenied.DuplicateRole The network interface must not be the source and the target of traffic mirror sessions at the same time. 網卡不能同時作為流量鏡像會話的源和目的。
400 InvalidLoadBalancerId.NotFound The specified resource of load balancer is not found. 指定的SLB執行個體不存在。
400 OperationDenied.FreeNetworkInterface The network interface is not attached to any ECS instance. 指定的網卡未綁定任何ECS執行個體。
400 OperationDenied.ClassicSLB The operation is not allowed because of ClassicSLB. 當前操作不支援傳統型Server Load Balancer執行個體
400 QuotaExceeded.SourceNumPerTarget The maximum number of traffic mirror sources for a target is exceeded. 該鏡像目標關聯的鏡像源數量超過限額。
400 OperationFailed.NotSupportBizType The specified instance type does not support the operation. 操作失敗因為指定的執行個體類型不支援此操作。
400 OperationDenied.UnsupportedTargetType Traffic mirror target must be SLB if traffic mirror sources contain nat gateway network interface. 流量鏡像源中存在NAT Gateway網卡時,流量鏡像目的必須為SLB類型
400 OperationDenied.TargetTypeNotSupportBondEni Operation denied because of target type can not be Bond Network Interface. Bond彈性網卡不支援作為鏡像目的。
400 OperationDenied.TargetTypeNotSupportGatewayLoadBalancerEndpoint Operation denied because of target type can not be GatewayLoadBalancerEndpoint. 網關型負載平衡終端節點不支援作為流量鏡像目的。
400 OperationDenied.InvalidTargetBondEniType The traffic mirroring target 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. 流量鏡像當前不支援完整報文鏡像功能,TrafficMirrorSourceTruncateMode只能設定為0,即預設模式。
500 OperationFailed.GetEniInfo The back-end service failed to query the NIC information. 後段服務查詢網卡資訊失敗
404 ResourceNotFound.GatewayLoadBalancerEndpoint GatewayLoadBalancerEndpoint instance not found. 未找到GatewayLoadBalancerEndpoint執行個體。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情