用于在aw

时间:2016-08-02 10:48:19

标签: python amazon-web-services aws-lib

在这里,我尝试从AWSLIMITCHECKER模块获取AWS限制检查ID,然后我需要检查categorywise

这是我的示例代码:

from awslimitchecker.checker import AwsLimitChecker
from awslimitchecker.trustedadvisor import TrustedAdvisor
#from awslimitchecker.services.base import _AwsService

res = TrustedAdvisor(all_services={},
   region='my region',
   account_id='myacct id',
   account_role='my role'
)

这里我需要传递all_services的这些参数。我需要通过这本词典的所有内容?如何使用函数_get_limit_check_id获取检查ID。

以下是awslimitcheckerhttps://awslimitchecker.readthedocs.io/en/latest/_modules/awslimitchecker/trustedadvisor.html#TrustedAdvisor._get_limit_check_id

的参考链接

我也检查了boto api,但是否可以使用awslimitcheckermodule本身获取检查ID并检查aws trusted advisor?

提前致谢

1 个答案:

答案 0 :(得分:0)

 Hi i have resolved this,but when i getting check ids it shows the following          

错误:

    mycode:

       d = TrustedAdvisor(services,
                 region='myregion',
                 account_id='none',
                 account_role='none'
     )




       e = d._get_limit_check_id()


error:

           File "/usr/lib/python2.6/site-      packages/awslimitchecker/trustedadvisor.py", line 190, in _get_limit_check_id
             checks = self.conn.describe_trusted_advisor_checks(
              AttributeError: 'NoneType' object has no attribute 'describe_trusted_advisor_checks'