awslimitchecker.trustedadvisor module¶
-
class
awslimitchecker.trustedadvisor.
TrustedAdvisor
[source]¶ Bases:
object
Class to contain all TrustedAdvisor-related logic.
-
__dict__
= dict_proxy({'__module__': 'awslimitchecker.trustedadvisor', '_get_limit_check_id': <function _get_limit_check_id at 0x7f34b09c7a28>, '_poll': <function _poll at 0x7f34b09c79b0>, 'update_limits': <function update_limits at 0x7f34b09c7938>, '__dict__': <attribute '__dict__' of 'TrustedAdvisor' objects>, '_update_services': <function _update_services at 0x7f34b09c7aa0>, '__weakref__': <attribute '__weakref__' of 'TrustedAdvisor' objects>, '__doc__': None, '__init__': <function __init__ at 0x7f34b09c7848>, 'connect': <function connect at 0x7f34b09c78c0>})¶
-
__module__
= 'awslimitchecker.trustedadvisor'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
_get_limit_check_id
()[source]¶ Query currently-available TA checks, return the check ID and metadata of the ‘performance/Service Limits’ check.
Returns: 2-tuple of Service Limits TA check ID (string), metadata (list), or (None, None). Return type: tuple
-
_poll
()[source]¶ Poll Trusted Advisor (Support) API for limit checks.
Return a dict of service name (string) keys to nested dict vals, where each key is a limit name and each value the current numeric limit.
e.g.:
{ 'EC2': { 'SomeLimit': 10, } }
-
_update_services
(ta_results, services)[source]¶ Given a dict of TrustedAdvisor check results from
_poll()
and a dict of Service objects passed in toupdate_limits()
, updated the TrustedAdvisor limits for all services.Parameters:
-
update_limits
(services)[source]¶ Poll ‘Service Limits’ check results from Trusted Advisor, if possible. Iterate over all
AwsLimit
objects for the given services and update their limits from TA if present in TA checks.Parameters: services (dict) – dict of service name (string) to _AwsService
objects
-