1. 接口描述
接口请求域名: cfw.tencentcloudapi.com 。
查询状态监控场景。Op=describe_scene 用于发现可用场景、指标、视角和二级下拉 available_options;Op=fetch_scene 用于拉取具体场景快照,结果在 Response.Data 的 JSON 字符串中。
默认接口请求频率限制:20次/秒。
推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。
2. 输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| Action | 是 | String | 公共参数,本接口取值:DescribeCfwStatusMonitor。 |
| Version | 是 | String | 公共参数,本接口取值:2019-09-04。 |
| Region | 否 | String | 公共参数,本接口不需要传递此参数。 |
| Op | 是 | String | 操作类型。describe_scene 表示发现场景和二级下拉选项;fetch_scene 表示获取具体场景快照。必填。 示例值:describe_scene |
| FirewallType | 是 | String | 防火墙场景类型。支持 internet_edge(互联网边界防火墙)、nat_cluster(NAT边界防火墙-集群)、nat_ha(NAT边界防火墙-主备)、vpc_cluster(VPC边界防火墙-集群)、vpc_ha(VPC边界防火墙-主备)。必填。 示例值:internet_edge |
| SelectionId | 否 | String | 二级下拉选项 ID。fetch_scene 按需传入,值来自 describe_scene 返回的 selection.available_options[].id;internet_edge 为地域,NAT 为实例 ID,VPC 带宽场景为防火墙组 ID;vpc_cluster 的 connections 汇总场景会忽略该参数。 示例值:cfwnat-c8b3fb7c |
| SelectionName | 否 | String | 二级下拉显示名称。可替代 SelectionId 按名称匹配,值来自 describe_scene 返回的 selection.available_options[].name。 示例值:自动化 |
| SelectionInstanceId | 否 | String | 引擎实例 ID。主要用于 vpc_ha 下一个防火墙组对应多个实例的场景,优先使用 describe_scene 返回的 selection.available_options[].instance_id;如只有 instance_ids,则从数组中选择一个字符串值。 示例值:cfwew-46cfffdc |
| Metric | 否 | String | 指标页签。fetch_scene 可传;不传时使用该场景默认值。支持 bandwidth、connections。 示例值:connections |
| Perspective | 否 | String | 指标下的视角。fetch_scene 可传;不传时使用该场景默认值。支持 ip、subnet、session、switch、vpc,实际可用组合以 describe_scene 返回为准。 示例值:ip |
| IpScope | 否 | String | NAT 主备连接数 IP 视角范围。external 表示外部 IP,asset 表示资产 IP;仅 nat_ha + connections + ip 使用,其他组合传入将返回 InvalidParameter。 示例值:external |
| TimePreset | 否 | String | 预设时间范围。默认 24h;fetch_scene 使用。支持 5m、15m、30m、1h、6h、24h、3d、7d、30d、today、yesterday、day_before_yesterday、this_week、last_week、this_month。 示例值:1h |
| StartTime | 否 | String | 自定义开始时间。格式 YYYY-MM-DD HH:MM:SS;必须与 EndTime 同时传,最大跨度 30 天。 示例值:2026-07-15 15:00:00 |
| EndTime | 否 | String | 自定义结束时间。格式 YYYY-MM-DD HH:MM:SS;必须与 StartTime 同时传,最大跨度 30 天。 示例值:2026-07-15 17:00:00 |
| Page | 否 | Integer | 页码,从 1 开始。默认 1;fetch_scene 列表视角使用。 示例值:1 |
| Limit | 否 | Integer | 每页条数。默认 10,取值 1 至 100;fetch_scene 列表视角使用。 示例值:10 |
| OverviewOnly | 否 | Boolean | 是否只获取概览数据。true 时 fetch_scene 只请求 overview,跳过 table/detail,适合只看场景快照汇总。 示例值:true |
| Offset | 否 | Integer | 原始偏移量覆盖。可选,传入后覆盖 Page 计算结果;取值 0 至 10000。 示例值:0 |
| SortBy | 否 | String | 排序字段。可选。互联网边界 IP、NAT IP/子网视角支持 InputMax、OutputMax;VPC switch 视角支持 SwitchName;VPC ip/vpc 视角支持 FlowMax;其他组合不要传。 示例值:InputMax |
| SortOrder | 否 | String | 排序方向。默认 desc;支持 asc、desc。 示例值:desc |
| Filters.N | 否 | Array of CfwStatusMonitorFilter | 过滤条件列表。保留字段;当前公开 fetch_scene 场景均不支持,调用方不要传。 |
3. 输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| Data | String | 查询结果。UTF-8 JSON object 字符串;调用方需解析 Response.Data。describe_scene 的 scene 返回 metric_options、perspective_options、default_metric、default_perspective、selection_required_by_metric、selection_kind_by_metric 和 time_preset_options;selection.available_options 返回可用于 SelectionId/SelectionName/SelectionInstanceId 的选项。fetch_scene 返回选中场景的 data 快照,可能包含 overview、table 或 detail。下方示例是字段结构节选,数组仅展示代表值。 示例值:{"op":"describe_scene","name":"互联网边界防火墙","type":"internet_edge","metric":"bandwidth","view":"ip","select":"region?","source":"DescribeEdgeIpFlowLists","unit":"bps/1024"} |
| RequestId | String | 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 |
4. 示例
示例1 发现场景和二级下拉选项
describe_scene 用来发现可用 metric/perspective 组合、默认值、选择项要求和二级下拉 available_options;fetch_scene 应原样使用发现结果。输出为字段结构节选,数组仅展示代表值。
输入示例
POST / HTTP/1.1
Host: cfw.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCfwStatusMonitor
<公共请求参数>
{
"Op": "describe_scene",
"FirewallType": "internet_edge"
}
输出示例
{
"Response": {
"Data": "{\"op\":\"describe_scene\",\"scene\":{\"firewall_type\":\"internet_edge\",\"metric_options\":[\"bandwidth\"],\"perspective_options\":{\"bandwidth\":[\"ip\"]},\"default_metric\":\"bandwidth\",\"default_perspective\":{\"bandwidth\":\"ip\"},\"selection_required_by_metric\":{\"bandwidth\":false},\"selection_kind_by_metric\":{\"bandwidth\":\"region\"},\"time_preset_options\":[\"1h\",\"24h\",\"7d\"]},\"selection\":{\"available_options\":[{\"id\":\"__all__\",\"name\":\"全部地域\"},{\"id\":\"ap-guangzhou\",\"name\":\"广州\"}]}}",
"RequestId": "4266525E-10C4-41E1-8A28-5CCE1FBF6A58"
}
}
示例2 拉取互联网边界状态监控快照
fetch_scene 拉取一个具体场景快照;它不是单纯 metrics 查询,还包含场景选择、概览和列表/明细视角。
输入示例
POST / HTTP/1.1
Host: cfw.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCfwStatusMonitor
<公共请求参数>
{
"Op": "fetch_scene",
"FirewallType": "internet_edge",
"Metric": "bandwidth",
"Perspective": "ip",
"SelectionId": "ap-guangzhou",
"TimePreset": "24h",
"OverviewOnly": true,
"Limit": 10
}
输出示例
{
"Response": {
"Data": "{\"op\":\"fetch_scene\",\"data\":{\"overview\":{\"InputMax\":1024}}}",
"RequestId": "4266525E-10C4-41E1-8A28-5CCE1FBF6A58"
}
}
5. 开发者资源
腾讯云 API 平台
腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。
API Inspector
用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。
SDK
云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。
- Tencent Cloud SDK 3.0 for Python: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for Java: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for PHP: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for Go: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for Node.js: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for .NET: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for C++: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for Ruby: CNB, GitHub, Gitee
命令行工具
6. 错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
| 错误码 | 描述 |
|---|---|
| FailedOperation.ResponseTooLarge | FailedOperation.ResponseTooLarge |
| InternalError | 内部错误。 |
| InvalidParameter | 参数错误。 |