Deletes a traffic mirror source from a traffic mirror session.

Usage notes

  • The RemoveSourcesFromTrafficMirrorSession operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the ListTrafficMirrorSessions operation to query the status of a traffic mirror session:
    • If the traffic mirror session is in the Modifying state, the traffic mirror source is being deleted.
    • If the traffic mirror session is in the Created state, the traffic mirror source is deleted.
  • You cannot repeatedly call the RemoveSourcesFromTrafficMirrorSession operation to delete a traffic mirror source from a traffic mirror session within the specified period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes RemoveSourcesFromTrafficMirrorSession

The operation that you want to perform. Set the value to RemoveSourcesFromTrafficMirrorSession.

ClientToken String No 0c593ea1-3bea-11e9-b96b-88e9fe63****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Note If you do not set this parameter, the system uses RequestId as ClientToken. RequestId may be different for each API request.
DryRun Boolean No false

Specifies whether to check the request without performing the operation. Valid values:

  • true: checks the request without performing the operation. The system checks the required parameters, request format, and limits. If the request fails the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false (default): sends the request. After the request passes the check, the operation is performed.
TrafficMirrorSessionId String Yes tms-j6cla50buc44ap8tu****

The ID of the traffic mirror session from which you want to delete a traffic mirror source.

TrafficMirrorSourceIds.N String Yes eni-j6c8znm5l1yt4sox****

The ID of the traffic mirror source to be deleted. Maximum value of N: 10.

RegionId String Yes cn-hongkong

The ID of the region to which the traffic mirror session belongs. You can call the DescribeRegions operation to query the most recent region list. For more information about regions that support traffic mirroring, see Overview of traffic mirroring.

Response parameters

Parameter Type Example Description
RequestId String A33B2C6A-89D1-4DEA-A807-A6E8CC552484

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=RemoveSourcesFromTrafficMirrorSession
&RegionId=cn-hongkong
&TrafficMirrorSessionId=tms-j6cla50buc44ap8tu****
&TrafficMirrorSourceIds.1=eni-j6c8znm5l1yt4sox****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<RemoveSourcesFromTrafficMirrorSessionResponse>
<RequestId>A33B2C6A-89D1-4DEA-A807-A6E8CC552484</RequestId>
</RemoveSourcesFromTrafficMirrorSessionResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "A33B2C6A-89D1-4DEA-A807-A6E8CC552484"
}

Error codes

HttpCode Error code Error message Description
400 IncorrectBusinessStatus.TrafficMirror The business status of traffic mirror is incorrect. The error message returned because the mirrored traffic is in an invalid state.
400 OptInRequired.TrafficMirror You need to subscribe to the traffic mirror service first. The error message returned because traffic mirroring is disabled.
400 DuplicatedParam.SourceInstanceIds The parameter of source instance IDs contains duplicate values. The error message returned because duplicate values are set for the TrafficMirrorSourceIds.N parameter.
400 ResourceNotFound.TrafficMirrorSession The specified resource of traffic mirror session is not found. The error message returned because the specified traffic mirror session does not exist.
400 IncorrectStatus.TrafficMirrorSession The status of traffic mirror session is incorrect. The error message returned because the traffic mirror session is in an invalid state.
400 ResourceNotAssociated.TrafficMirrorSource The specified traffic mirror source and session are not associated. The error message returned because the specified mirror source is not associated with the traffic mirror session.
400 ResourceNotFound.NetworkInterface The specified resource of network interface is not found. The error message returned because the specified ENI does not exist.
400 ResourceNotFound.EcsInstance The specified resource of ECS instance is not found. The error message returned because the specified Elastic Compute Service (ECS) instance does not exist.

For a list of error codes, visit the API Error Center.