全部产品
Search
文档中心

专有网络 VPC:UpdateTrafficMirrorSessionAttribute - 修改流量镜像会话的配置信息

更新时间:Aug 28, 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:私网负载均衡实例。

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. 当前操作不支持传统型负载均衡实例
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网关网卡时,流量镜像目的必须为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实例。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情