api - 循环 Power BI API 调用以提取未知数量的记录以避免速率限制?
问题描述
我正在尝试连接到 Palo Alto 的 Cortex XDR,以将事件拉入 Power BI 以分析平均解决时间、每位分析师的总数等。
我能够验证并提取最后 100 个事件。根据文档,每次查询无法提取超过 100 个。
这是正在运行的查询。
let
body = "{ ""request_data"": {}}",
GetJson = Web.Contents("https://api-{company}.xdr.us.paloaltonetworks.com/public_api/v1/incidents/get_incidents/",
[
Headers = [#"Content-Type" = "application/json",
#"x-xdr-auth-id" = "{API ID}",
#"Authorization" = "{API KEY}"
],
Content = Text.ToBinary(body)
]
),
FormatAsJson = Json.Document(GetJson),
#"Converted to Table" = Record.ToTable(FormatAsJson),
Value = #"Converted to Table"{0}[Value],
incidents = Value[incidents],
Result = Table.FromRecords(incidents)
in
Result
在查看文档时,我注意到它有一种方法可以查询特定范围的事件(不超过 100 个)并尝试将其插入但无法提取指定的事件。
有没有办法在不知道总数的情况下循环 API 拉取所有事件(将不断增加)?
解决方案
推荐阅读
- swift - NSTableView:如果我设置“行大小样式:自动”,那么所有行都有 0px 大小
- sql - 在 SQL 中循环并插入多个逗号分隔的 List
- c# - 系统年份 YYYY 加上库尔姆的值 MMDD 在 C# 中作为“dd-MMM-yyyy”插入数据库
- awk - 提取部分列以制作 cp 命令
- javascript - 邮递员预请求脚本:无法从响应中访问标头
- reactjs - methods.myFunction().call() throws 返回值是无效的,它是否耗尽了 Gas?错误
- javascript - 保存暗模式状态 html/css/js
- npm - 运行 npm init 时 git 存储库问题有什么用?
- php - laravel 数据库未更新
- javascript - 样式化的组件 - 尝试通过不同的键名访问 json