调用CreateTrafficMirrorFilter接口创建流量镜像筛选条件。
接口说明
CreateTrafficMirrorFilter 接口属于异步接口,即系统返回一个实例 ID,但该流量镜像筛选条件尚未创建成功,系统后台的创建任务仍在进行。您可以调用 ListTrafficMirrorFilters 查询流量镜像筛选条件的创建状态:
当流量镜像筛选条件处于 Creating 状态时,表示流量镜像筛选条件正在创建中。
当流量镜像筛选条件处于 Created 状态时,表示流量镜像筛选条件创建完成。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:CreateTrafficMirrorFilter |
create |
*TrafficMirrorFilter
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| TrafficMirrorFilterDescription |
string |
否 |
流量镜像筛选条件的描述信息。 描述长度为 1~256 个字符,不能以 |
this is a filter. |
| TrafficMirrorFilterName |
string |
否 |
流量镜像筛选条件的名称。 名称长度为 1~128 个字符,不能以 |
abc |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。 |
123e4567-e89b-12d3-a456-426655440000 |
| DryRun |
boolean |
否 |
是否只预检此次请求。取值:
|
false |
| IngressRules |
array<object> |
否 |
入方向规则信息。 |
|
|
object |
否 |
入方向规则信息。 |
||
| Action |
string |
是 |
入方向规则的采集策略。取值:
|
accept |
| SourceCidrBlock |
string |
否 |
入方向规则网络流量的源地址网段。 |
10.0.0.0/24 |
| Protocol |
string |
是 |
入方向需要镜像的网络流量使用的协议类型。取值:
|
TCP |
| IpVersion |
string |
是 |
实例的 IP 协议版本。取值:
|
IPv4 |
| DestinationPortRange |
string |
否 |
入方向规则网络流量的目的端口范围。端口范围为 1~65535,使用正斜线(/)隔开起始端口和终止端口,格式为1/200、80/80。 说明
当IngressRules.N.Protocol取值为 ALL 或 ICMP 时,该参数无需设置,表示不限制端口。 |
80/120 |
| Priority |
integer |
否 |
入方向规则的优先级。数字越小,优先级越高。 其中 N 最大取值为 10,即一个筛选条件最多可配置 10 条入方向规则。 |
1 |
| DestinationCidrBlock |
string |
否 |
入方向规则网络流量的目的地址网段。 |
10.0.0.0/24 |
| SourcePortRange |
string |
否 |
入方向规则网络流量的源端口范围。端口范围为 1~65535,使用正斜线(/)隔开起始端口和终止端口,格式为1/200、80/80。 说明
当IngressRules.N.Protocol取值为 ALL 或 ICMP 时,该参数无需配置,表示不限制端口。 |
80/120 |
| EgressRules |
array<object> |
否 |
出方向规则的信息。 |
|
|
object |
否 |
出方向规则的信息。 |
||
| Action |
string |
是 |
出方向规则的采集策略。取值:
|
accept |
| SourceCidrBlock |
string |
否 |
出方向规则网络流量的源地址网段。 |
10.0.0.0/24 |
| Protocol |
string |
是 |
出方向需要镜像的网络流量使用的协议类型。取值:
|
TCP |
| IpVersion |
string |
是 |
实例的 IP 协议版本。取值:
|
IPv4 |
| DestinationPortRange |
string |
否 |
出方向规则网络流量的目的端口范围。端口范围为 1~65535,使用正斜线(/)隔开起始端口和终止端口,格式为1/200、80/80,其中**-1/-1**不能单独设置,代表不限制端口。 说明
当EgressRules.N.Protocol取值为 ALL 或 ICMP 时,该参数无需配置,表示不限制端口。 |
22/40 |
| Priority |
integer |
否 |
出方向规则的优先级。数字越小,优先级越高。 其中 N 最大取值为 10,即一个筛选条件最多可配置 10 条出方向规则。 |
1 |
| DestinationCidrBlock |
string |
否 |
出方向规则网络流量的目的地址网段。 |
10.0.0.0/24 |
| SourcePortRange |
string |
否 |
出方向规则网络流量的源端口范围。端口范围为 1~65535,使用正斜线(/)隔开起始端口和终止端口,格式为1/200、80/80,其中**-1/-1**不能单独设置,代表不限制端口。 说明
当EgressRules.N.Protocol取值为 ALL 或 ICMP 时,该参数无需配置,表示不限制端口。 |
22/40 |
| RegionId |
string |
是 |
流量镜像的所属地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。关于流量镜像支持的地域,请参见流量镜像概述。 |
cn-hongkong |
| ResourceGroupId |
string |
否 |
流量镜像所属的资源组 ID。 |
rg-bp67acfmxazb4ph**** |
| Tag |
array<object> |
否 |
资源的标签。 |
|
|
object |
否 |
标签。 |
||
| Key |
string |
否 |
资源的标签键。最多支持输入 20 个标签键。如需传入该值,则不能输入空字符串。 一个标签键最多支持 128 个字符,不能以 |
FinanceDept |
| Value |
string |
否 |
资源的标签值。最多支持输入 20 个标签值。如需传入该值,可以输入空字符串。 最多支持 128 个字符,不能以 |
FinanceJoshua |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
流量镜像筛选条件的实例 ID。 |
||
| TrafficMirrorFilterId |
string |
流量镜像筛选条件的实例 ID。 |
tmf-j6cmls82xnc86vtpe**** |
| RequestId |
string |
请求 ID。 |
28DB147D-217B-43E8-9E94-A3F6837DDC8A |
| ResourceGroupId |
string |
流量镜像所属的资源组 ID。 |
rg-bp67acfmxazb4ph**** |
示例
正常返回示例
JSON格式
{
"TrafficMirrorFilterId": "tmf-j6cmls82xnc86vtpe****",
"RequestId": "28DB147D-217B-43E8-9E94-A3F6837DDC8A",
"ResourceGroupId": "rg-bp67acfmxazb4ph****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | UnsupportedFeature.IpVersion | The ipversion type is not supported. | 输入的ipVersion不支持 |
| 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 | QuotaExceeded.TrafficMirrorFilter | The maximum number of traffic image filters is exceeded. | 流量镜像筛选条件数量配额超限。 |
| 400 | DuplicatedParam.Priority | The specified priority conflicts with the existing priority. | 指定的优先级参数与已有的优先级重复。 |
| 400 | UnsupportedRegion | The feature is not supported in current region. | 当前地域不支持该功能。 |
| 400 | IllegalParamFormat.SrcCidrBlock | The format of the specified source CIDR block is invalid. | 源CIDR参数格式不合法。 |
| 400 | IllegalParamFormat.DstCidrBlock | The format of the specified dst CIDR block is invalid. | 目标CIDR参数格式不合法。 |
| 400 | IllegalParam.DestinationCidrBlock | The param of DestinationCidrBlock %s is illegal. | |
| 400 | IllegalParam.SourceCidrBlock | The param of SourceCidrBlock %s is illegal. | |
| 400 | IllegalParam.Protocol | The specified Protocol %s is invalid. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。