如何使用 python boto 获取 EBS 卷类型?

How can I get EBS volume type with python boto?

我开始在 python 中编写简单的 nagios 检查以监控 EBS gp2 卷上的 "Burst Balance"。我想跳过使用预配置 IOPS (io1)

检查卷

我可以通过 aws ec2 describe-volumes 获取此信息。

如何在 python 中使用 boto 检查卷类型?

boto3describe_volumes()调用returns卷类型:

'VolumeType': 'standard'|'io1'|'gp2'|'sc1'|'st1'

我在 boto 中找不到等效项,但可能是时候转到 boto3 了。如果需要,您可以在同一应用程序中同时使用它们,只需 import boto3 并并行使用即可。