CreateTrafficMirrorSession_专有网络_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

CreateTrafficMirrorSession 接口属于异步接口,即系统返回一个实例 ID,但该镜像会话尚未创建成功,系统后台的创建任务仍在进行。您可以调用 ListTrafficMirrorSessions 查询镜像会话的创建状态:

  • 当镜像会话处于 Creating 状态时,表示镜像会话正在创建中。
  • 当镜像会话处于 Created 状态时,表示镜像会话创建完成。

流控信息

请求速率为600/60(s)。

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
vpc:CreateTrafficMirrorSession
Create
TrafficMirrorSession
acs:vpc:{#regionId}:{#accountId}:trafficmirrorsession/*
TrafficMirrorFilter
acs:vpc:{#regionId}:{#accountId}:trafficmirrorfilter/{#TrafficMirrorFilterId}

请求参数

字段名称字段详情
TrafficMirrorSessionDescriptionstring

镜像会话的描述信息。展开详情

示例值:This is a trafficmirrorsession.
TrafficMirrorSessionNamestring

镜像会话的名称。展开详情

示例值:test参考取值来源:
    ListTrafficMirrorSessions
ClientTokenstring

客户端 Token,用于保证请求的幂等性。展开详情

示例值:0c593ea1-3bea-11e9-b96b-88e9fe63****
DryRunboolean

是否只预检此次请求,取值:展开详情

示例值:false
TrafficMirrorTargetIdstring

镜像目的的实例 ID,目前支持弹性网卡和私网负载均衡实例作为镜像目的。

示例值:eni-j6c8znm5l1yt4sox****参考取值来源:
    ListTrafficMirrorSessions
TrafficMirrorTargetTypestring

镜像目的类型,取值:展开详情

示例值:NetworkInterface参考取值来源:
    ListTrafficMirrorSessions
TrafficMirrorFilterIdstring

流量镜像筛选条件的实例 ID。

示例值:tmf-j6cmls82xnc86vtpe****参考取值来源:
    ListTrafficMirrorFilters
    CreateTrafficMirrorFilter
VirtualNetworkIdinteger<int32>

指定 VNI(VXLAN Network Identifier),用来区分不同的镜像流量,取值范围为 0~16777215展开详情

示例值:1
Priorityinteger<int32>

镜像会话的优先级,取值范围为 1~32766展开详情

示例值:1取值 <= 32766
Enabledboolean

是否开启流量会话,取值:展开详情

示例值:false
PacketLengthinteger<int32>

指定被镜像的原始报文长度(不包含 VXLAN 报文长度),默认值 1500,取值范围:648500,单位:字节。展开详情

示例值:1500
TrafficMirrorSourceIdsarray<string>

镜像源的实例 ID,目前支持弹性网卡作为镜像源。其中 N 的默认值为 1,即一个镜像会话只支持添加一个镜像源。

示例值:eni-j6c2fp57q8rr47rp****子级条数 <= 30
RegionIdstring

镜像会话的所属地域 ID。您可以通过调用 DescribeRegions 接口获取地域 ID。关于流量镜像支持的地域,请参见流量镜像概述

示例值:cn-hongkong参考取值来源:
    DescribeRegions
ResourceGroupIdstring

流量镜像所属的资源组 ID。

示例值:rg-bp67acfmxazb4ph****
Tagarray<object>

资源的标签。

子级条数 <= 21

返回参数

字段名称字段详情
TrafficMirrorSessionIdstring

镜像会话的实例 ID。

示例值:tms-j6ce5di4w7nvigfjz****
RequestIdstring

请求 ID。

示例值:0ED8D006-F706-4D23-88ED-E11ED28DCAC0
ResourceGroupIdstring

流量镜像所属的资源组 ID。

示例值: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.诊断
404
ResourceNotFound.GatewayLoadBalancerEndpoint
GatewayLoadBalancerEndpoint instance not found.诊断

变更历史

变更时间变更内容概要操作
2025-02-08
变更错误码400
新增错误码404
2024-09-11
变更错误码400
2024-01-15
变更错误码400
2023-09-26
变更错误码400
2023-09-21
变更错误码400
2023-09-14
变更错误码400
2023-08-30
变更错误码400
  • 1
  • 2
  • 10 条/页

相关示例

创建筛选条件 --> 创建筛选规则 --> 创建镜像会话 --> 更新镜像会话状态 -->删除镜像会话
2021-12-22