调用AddSourcesToTrafficMirrorSession接口为镜像会话增加镜像源。
接口说明
- AddSourcesToTrafficMirrorSession 接口属于异步接口,即系统返回一个请求 ID,但该镜像源尚未增加成功,系统后台的增加任务仍在进行。您可以调用 ListTrafficMirrorSessions 查询镜像源的增加状态:
当镜像会话处于 Modifying 状态时,表示镜像源正在增加中。
当镜像会话处于 Created 状态时,表示镜像源增加成功。
AddSourcesToTrafficMirrorSession 接口不支持并发为同一个镜像会话增加镜像源。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:AddSourcesToTrafficMirrorSession |
update |
*TrafficMirrorSession
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。 |
0c593ea1-3bea-11e9-b96b-88e9fe63**** |
| DryRun |
boolean |
否 |
是否只预检此次请求,取值:
|
false |
| TrafficMirrorSessionId |
string |
是 |
需要增加镜像源的镜像会话实例 ID。 |
tms-j6cla50buc44ap8tu**** |
| TrafficMirrorSourceIds |
array |
是 |
需要增加的镜像源的实例 ID,目前支持弹性网卡作为镜像源。其中 N 的默认值为 1,即一个镜像会话只支持添加一个镜像源。 |
eni-j6ccmrl8z3xkvxgw**** |
|
string |
否 |
需要增加的镜像源的实例 ID,目前支持弹性网卡作为镜像源。其中 N 的默认值为 1,即一个镜像会话只支持添加一个镜像源。 |
eni-j6c8znm5l1yt4sox**** |
|
| RegionId |
string |
是 |
镜像会话的所属地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 关于流量镜像支持的地域,请参见流量镜像概述。 |
cn-hongkong |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
87F70089-5B38-41A8-BAD8-0B55E2F8DC57 |
示例
正常返回示例
JSON格式
{
"RequestId": "87F70089-5B38-41A8-BAD8-0B55E2F8DC57"
}
错误码
|
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.SourceInstanceIds | The parameter of source instance IDs contains duplicate values. | 流量镜像源实例ID参数中包含重复值。 |
| 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 | ResourceAlreadyAssociated.TrafficMirrorSource | The specified traffic mirror source and session are already associated. | 指定的流量镜像源和会话已经绑定。 |
| 400 | ResourceNotFound.NetworkInterface | The specified resource of %s is not found. | 指定的NetworkInterface %s 不存在 |
| 400 | ResourceNotFound.EcsInstance | The specified resource of ECS instance is not found. | 指定的ECS实例不存在。 |
| 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 | QuotaExceeded.NetworkInterfaceRelatedSession | The quota of the number of traffic mirror sessions related to one network interface is exceeded. | 单个网卡所能关联的流量镜像会话数量配额超限。 |
| 400 | OperationDenied.FreeNetworkInterface | The network interface is not attached to any ECS instance. | 指定的网卡未绑定任何ECS实例。 |
| 400 | QuotaExceeded.SourceNumPerSession | The quota of the number of traffic mirror sources per session is exceeded. | 每个流量镜像会话所允许关联的源的数量配额超限。 |
| 400 | QuotaExceeded.SourceNumPerTarget | The maximum number of traffic mirror sources for a target is exceeded. | 该镜像目标关联的镜像源数量超过限额。 |
| 400 | OperationUnsupported.BondingNetworkInterface | The specified traffic mirror source is bonding eni without slave. | 当前操作不支持无slave的bonding网卡。 |
| 400 | OperationDenied.UnsupportedTargetType | Traffic mirror target must be SLB if traffic mirror sources contain nat gateway network interface. | 流量镜像源中存在NAT网关网卡时,流量镜像目的必须为SLB类型 |
| 400 | OperationDenied.InvalidSourceBondEniType | The traffic mirroring source does not support the entered bond ENI type. | 流量镜像源不支持所输入的托管弹性网卡类型。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。