跳转到内容
搜索文档

可编程流防护 (Programmable Flow Protection)

最后更新 查看 MarkdownAgent 设置

使用 Cloudflare API 配置可编程流防护。

使用 Cloudflare API 配置可编程流防护。

有关 API 调用的示例,请参阅常用 API 调用

端点 (Endpoints)

要获取完整的端点,请将下面列出的可编程流防护 API 端点附加到 Cloudflare API 基础 URL:

https://api.cloudflare.com/client/v4

{account_id} 参数是账户 ID(十六进制字符串)。您可以在 Cloudflare 仪表板中找到此值。

以下各节中的表总结了可用的操作。

程序操作 (Program operations)

操作 方法与端点 / 描述
获取程序列表

GET accounts/{account_id}/magic/programmable_flow_protection/configs/programs

获取账户中的所有可编程流防护程序。
上传一个程序

POST accounts/{account_id}/magic/programmable_flow_protection/configs/programs

向账户上传一个新程序。包含可选的 X-Program-Name 请求头以指定易于阅读的程序名称。如果省略,API 将生成一个 UUID 作为程序名称。
获取单个程序

GET accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}

获取现有程序的详细信息。
更新一个程序

PATCH accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}

更新现有的程序。
删除一个程序

DELETE accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}

从账户中删除现有的程序。
删除所有程序

DELETE accounts/{account_id}/magic/programmable_flow_protection/configs/programs

从账户中删除所有现有的程序。

规则操作 (Rule operations)

操作 方法与端点 / 描述
获取规则列表

GET accounts/{account_id}/magic/programmable_flow_protection/configs/rules

获取账户中的所有可编程流防护规则。
创建一条规则

POST accounts/{account_id}/magic/programmable_flow_protection/configs/rules

在账户中创建一条新规则。
获取单条规则

GET accounts/{account_id}/magic/programmable_flow_protection/configs/rules/{rule_id}

获取现有规则的详细信息。
更新一条规则

PATCH accounts/{account_id}/magic/programmable_flow_protection/configs/rules/{rule_id}

更新账户中现有的规则。
删除一条规则

DELETE accounts/{account_id}/magic/programmable_flow_protection/configs/rules/{rule_id}

从账户中删除现有的规则。
删除所有规则

DELETE accounts/{account_id}/magic/programmable_flow_protection/configs/rules

从账户中删除所有现有的规则。

调试操作 (Debug operations)

操作 方法与端点 / 描述
使用 PCAP 进行调试

POST accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}/pcap

对 PCAP 文件运行程序,并返回带有程序裁定 (program verdicts) 的注释 PCAP 文件。

分页 (Pagination)

返回项目列表的 API 操作使用分页。有关可用分页查询参数的更多信息,请参阅分页 (Pagination)

这篇文档对您有帮助吗?