awslimitchecker.quotas module¶
-
class
awslimitchecker.quotas.
ServiceQuotasClient
(boto_connection_kwargs)[source]¶ Bases:
awslimitchecker.connectable.Connectable
Client for the AWS Service Quotas service, that manages retrieving quotas information and updating
AwsLimit
instances for them. This class is also intended to cache Service Quotas responses.Parameters: boto_connection_kwargs (dict) – keyword arguments to pass to boto3 connection methods. -
__init__
(boto_connection_kwargs)[source]¶ Client for the AWS Service Quotas service, that manages retrieving quotas information and updating
AwsLimit
instances for them. This class is also intended to cache Service Quotas responses.Parameters: boto_connection_kwargs (dict) – keyword arguments to pass to boto3 connection methods.
-
__module__
= 'awslimitchecker.quotas'¶
-
api_name
= 'service-quotas'¶
-
get_quota_value
(service_code, quota_name, units='None', converter=None)[source]¶ Return a given quota value, or None if it cannot be found. If
units
is a value other thanNone
, attempt to convert the value to the specified units.Parameters: - service_code (str) – the service code to get a quota from
- quota_name (str) – the quota name to get
- units (str) – the units for the value, or the string “None”
- converter (
callable
) – A callable for unit conversion. Must take three positional arguments: the Service Quotas value for this quota (float), the quotaUnit
str, and the return value ofquotas_unit()
. This callable is responsible for converting the quota value from the quota Unit to this class’s expected unit. If they cannot be converted, it should log an error and return None.
Returns: the quota value
Return type:
-
quotas_for_service
(service_code)[source]¶ Return this account’s current quotas for the specified service code. Also cache them on this class instance.
Parameters: service_code (str) – the service code to get quotas for Returns: QuotaName to dictionary of quota information returned by the service Return type: dict
-