简体   繁体   English

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

[英]How can I get EBS volume type with python boto?

I started writing simple nagios check in python to monitor "Burst Balance" on EBS gp2 volumes. 我开始在python中编写简单的nagios检查来监视EBS gp2卷上的“突发平衡”。 I'd like to skip checking volumes with Provisioned IOPS (io1) 我想跳过使用预置IOPS(io1)检查卷

I can get this information with aws ec2 describe-volumes . 我可以通过aws ec2 describe-volumes获得此信息。

How can I check volume type with boto in python? 如何在python中使用boto检查卷类型?

The boto3 describe_volumes() call returns the volume type: boto3 describe_volumes()调用返回卷类型:

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

I couldn't find an equivalent in boto , but it's probably time to move across to boto3 . 我在boto找不到对应的东西,但是可能是时候转向boto3 If desired, you can use both of them in the same application, simply import boto3 and use it in parallel. 如果需要,您可以在同一应用程序中同时使用它们,只需import boto3并并行使用即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM