amazon-web-services - 我可以使用 boto 将 "ok_action"添加到现

我有 700 个 cloudwatch 警报是我的用户在“OKActions”中没有操作的情况下创建的,这意味着它们不会自行解决。

这些已经在生产中了,所以我对删除\移动\等犹豫不决。

在 AWS 控制台中,我可以简单地添加一个新操作。 但是我在 docs for boto 中找不到这样的操作:

can_paginate()
delete_alarms()
delete_dashboards()
describe_alarm_history()
describe_alarms()
describe_alarms_for_metric()
disable_alarm_actions()
enable_alarm_actions()
generate_presigned_url()
get_dashboard()
get_metric_data()
get_metric_statistics()
get_metric_widget_image()
get_paginator()
get_waiter()
list_dashboards()
list_metrics()
put_dashboard()
put_metric_alarm()
put_metric_data()
set_alarm_state()

我可以使用 boto 向现有的 cloudwatch 警报添加“ok_action”而不创建新警报吗?

AWS 客户端? 其他一些 aws 自动化?

最佳答案

亚马逊的回答:

tl;dr:没有好的方法可以做到这一点。

Hello,

Thank you for contacting AWS Premium Support. My name is Sonal and I will be assisting you with the case.

I understand that you would like to add OK Action to the existing alarms without modifying anything else in the alarm configuration. Since you need to add this action to all your alarms, so you are looking for a way to do this custom script.

"PutMetricAlarm" is the only API used for both Creating and Updating an alarm. Please note that when you update an existing alarm using "PutMetricAlarm" API, the update completely overwrites the previous configuration of the alarm. This means that you have to specify all the parameters of the existing alarm along with the parameters you want to modify.

So in order to modify the existing alarms, your custom script would need to do the following: -->Get a list of all the alarms to be updated. You can use "DescribeAlarms" API[1] -->You can parse the list of alarms, extract the required parameters --> Use the above parameters to make a "PutMetricAlarm" API[2] call along with the OKActions parameter.

Please note that providing with actual code for deploying these solutions for your specific environment would be out of scope of AWS Support but, of course, we will be able to guide you during the process if you face any issues.

关于amazon-web-services - 我可以使用 boto 将 "ok_action"添加到现有的 cloudwatch 警报而不创建新警报吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54519358/

相关文章:

spring - 多部分文件(未给定条件)。错误 400(错误请求)

sql-server - 如何将变量传递给 SSDT 2017 中的 ODBC SQL 命令?

python - GAE : Why does GAE perform worse than nor

angularjs - 使用 ui-sref 和 $state.go 在新标签页中打开

laravel - 无法使用 npm run production 在生产环境中编译 Assets

firebase - 为什么我的 Xamarin.iOS 应用程序没有收到来自 Google Fir

listview - 只允许扩展一个 ExpansionTile

c++ - 如何在 Visual Studio Code 中构建和运行作为发布版的 C++ 应用程序

git - Jenkins 管道在远程源提取期间失败(无法更新本地引用)

node.js - Express Session cookie 未保存在 Chrome 中?