prometheus - Prometheus Alertmanger 使用 curl 删除所有静音。REST API
问题描述
如何使用 curl 删除 Prometheus Alertmanger 中所有现有的静音。
我尝试使用它但得到404 page not found
curl -X DELETE http://alerts.example.org:9093/api/v1/silence/<silenceId>
我怎样才能删除所有的沉默?就像是
curl -X DELETE http://alerts.example.org:9093/api/v1/silence/*
解决方案
您不能仅使用 curl 命令删除所有静音,但您可以使用以下命令列出所有静音 ID:
curl -X GET http://alerts.example.org:9093/api/v1/silences | jq --raw-output '.data[].id'
9e2d7680-8543-447f-9776-db513fa88b3b
1e37bb70-a6ae-4247-b748-fd7aee838140
6dac91c5-08a7-4a14-8dac-7137c61ae94d
然后使用“curl -X DELETE”命令删除。
推荐阅读
- pandas - Pandas groupby 多条件和日期差异计算
- react-native - 如何断言 React Native 测试库中的按钮被禁用?
- python - 如何根据带有 Pandas 的分离数据框 y 的值迭代地将列添加到数据框 X?
- c++ - 将向量转换为拥有的数组而不复制
- python - 使用列表创建文本文件以在 Python 中存储字符串
- python - 提取除正则表达式匹配之外的所有内容
- javascript - 有没有办法改变owl-carousel的光标?(不是 owl-dots 或 owl-nav)
- mysql - 错误想要在 POST 后获取数据 - nodejs,mysql
- typescript - 用于在 nesjts 中进行验证的自定义装饰器 - 在服务层上
- vue.js - 在另一个组件中使用一个组件