AddSourcesToTrafficMirrorSession
Adds traffic mirror sources to a traffic mirror session by calling the AddSourcesToTrafficMirrorSession operation.
Operation description
- AddSourcesToTrafficMirrorSession is an asynchronous operation. After a request is sent, the system returns a request ID. However, the traffic mirror source is not yet added, and the addition task is still running in the background. You can call ListTrafficMirrorSessions to query the status of the traffic mirror source addition:
If the traffic mirror session is in the Modifying state, the traffic mirror source is being added.
If the traffic mirror session is in the Created state, the traffic mirror source is added.
AddSourcesToTrafficMirrorSession does not support concurrent requests to add traffic mirror sources to the same traffic mirror session.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:AddSourcesToTrafficMirrorSession |
update |
*TrafficMirrorSession
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The ClientToken value can contain only ASCII characters. Note
If you do not specify this parameter, the system automatically uses the RequestId value as the ClientToken value. The RequestId value may be different for each API request. |
0c593ea1-3bea-11e9-b96b-88e9fe63**** |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
|
false |
| TrafficMirrorSessionId |
string |
Yes |
The instance ID of the traffic mirror session to which you want to increase traffic mirror sources. |
tms-j6cla50buc44ap8tu**** |
| TrafficMirrorSourceIds |
array |
Yes |
The instance ID of the traffic mirror source to increase. Currently, only elastic network interfaces (ENIs) are supported as traffic mirror sources. The default value of N is 1, which indicates that you can add only one traffic mirror source to a traffic mirror session. |
eni-j6ccmrl8z3xkvxgw**** |
|
string |
No |
The instance ID of the traffic mirror source to increase. Currently, only elastic network interfaces (ENIs) are supported as traffic mirror sources. The default value of N is 1, which indicates that you can add only one traffic mirror source to a traffic mirror session. |
eni-j6c8znm5l1yt4sox**** |
|
| RegionId |
string |
Yes |
The region ID of the traffic mirror session. You can call the DescribeRegions operation to query the most recent region list. For more information about the regions that support traffic mirroring, see Traffic mirroring overview. |
cn-hongkong |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
87F70089-5B38-41A8-BAD8-0B55E2F8DC57 |
Examples
Success response
JSON format
{
"RequestId": "87F70089-5B38-41A8-BAD8-0B55E2F8DC57"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IncorrectBusinessStatus.TrafficMirror | The business status of traffic mirror is incorrect. | Traffic mirroring is in an invalid state. |
| 400 | OptInRequired.TrafficMirror | You need to subscribe to the traffic mirror service first. | Traffic mirroring is disabled. |
| 400 | DuplicatedParam.SourceInstanceIds | The parameter of source instance IDs contains duplicate values. | Duplicate values are set for TrafficMirrorSourceIds.N. |
| 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. | The error message returned because NetworkInterface is set to an invalid value. |
| 400 | ResourceNotFound.EcsInstance | The specified resource of ECS instance is not found. | |
| 400 | OperationDenied.EcsNotSupportTrafficMirror | The ECS instance does not support traffic mirroring. | |
| 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. | The number of traffic mirror sessions associated with an ENI has reached the upper limit. |
| 400 | OperationDenied.FreeNetworkInterface | The network interface is not attached to any ECS instance. | The ENI is not associated with an ECS instance. |
| 400 | QuotaExceeded.SourceNumPerSession | The quota of the number of traffic mirror sources per session is exceeded. | The number of traffic mirror sources associated with a traffic mirror session has reached the upper limit. |
| 400 | QuotaExceeded.SourceNumPerTarget | The maximum number of traffic mirror sources for a target is exceeded. | The number of traffic mirror sources associated with the image exceeds the upper limit. |
| 400 | OperationUnsupported.BondingNetworkInterface | The specified traffic mirror source is bonding eni without slave. | The operation does not support a bond ENI without a slave ENI. |
| 400 | OperationDenied.UnsupportedTargetType | Traffic mirror target must be SLB if traffic mirror sources contain nat gateway network interface. | When a NAT gateway NIC exists in the traffic mirroring source, the traffic mirroring purpose must be SLB type. |
| 400 | OperationDenied.InvalidSourceBondEniType | The traffic mirroring source does not support the entered bond ENI type. | The traffic mirroring source does not support the entered bond ENI type. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.