How to use the cloudaux.aws.decorators.rate_limited function in cloudaux

To help you get started, we’ve selected a few cloudaux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Netflix-Skunkworks / cloudaux / cloudaux / aws / iam.py View on Github external
@rate_limited()
@sts_conn('iam', service_type='client')
def get_role_inline_policy_names(role, client=None, **kwargs):
    marker = {}
    inline_policies = []

    while True:
        response = client.list_role_policies(
            RoleName=role['RoleName'],
            **marker
        )
        inline_policies.extend(response['PolicyNames'])

        if response['IsTruncated']:
            marker['Marker'] = response['Marker']
        else:
            return inline_policies
github Netflix-Skunkworks / cloudaux / cloudaux / aws / iam.py View on Github external
@rate_limited()
def list_attached_group_managed_policies(group_name, client=None, **kwargs):
    """Lists the attached IAM managed policies for a given IAM group."""
    return client.list_attached_group_policies(GroupName=group_name, **kwargs)
github Netflix-Skunkworks / cloudaux / cloudaux / aws / ec2.py View on Github external
@rate_limited()
def describe_instances(**kwargs):
    return kwargs.pop('client').get_paginator('describe_instances').paginate()
github Netflix-Skunkworks / cloudaux / cloudaux / aws / s3.py View on Github external
@rate_limited()
def get_bucket_location(client=None, **kwargs):
    """
    Bucket='string'
    """
    return client.get_bucket_location(**kwargs)
github Netflix-Skunkworks / cloudaux / cloudaux / aws / sqs.py View on Github external
@rate_limited()
def purge_queue(client=None, **kwargs):
    return client.purge_queue(**kwargs)
github Netflix-Skunkworks / cloudaux / cloudaux / aws / sns.py View on Github external
@rate_limited()
def get_endpoint_attributes(client=None, **kwargs):
    return client.get_endpoint_attributes(**kwargs)['Attributes']
github Netflix-Skunkworks / cloudaux / cloudaux / aws / ec2.py View on Github external
@rate_limited()
def describe_vpc_classic_link_dns_support(**kwargs):
    return kwargs.pop('client').describe_vpc_classic_link_dns_support(**kwargs)
github Netflix-Skunkworks / cloudaux / cloudaux / aws / ec2.py View on Github external
@rate_limited()
def describe_images(**kwargs):
    return kwargs.pop('client').describe_images(**kwargs)['Images']
github Netflix-Skunkworks / cloudaux / cloudaux / aws / iam.py View on Github external
@rate_limited()
def get_account_authorization_details(filter=None, client=None, **kwargs):
    possible_filters = ['User', 'Role', 'Group', 'LocalManagedPolicy', 'AWSManagedPolicy']

    if filter not in possible_filters:
        raise InvalidAuthorizationFilterException('Must provide filter value: {}'.format(', '.join(possible_filters)))

    if filter == 'User':
        return _get_account_authorization_user_details(client=client, **kwargs)
    elif filter == 'Role':
        return _get_account_authorization_role_details(client=client, **kwargs)
    elif filter == 'Group':
        return _get_account_authorization_group_details(client=client, **kwargs)
    elif filter == 'LocalManagedPolicy':
        return _get_account_authorization_local_managed_policies_details(client=client, **kwargs)
    elif filter == 'AWSManagedPolicy':
        return _get_account_authorization_aws_managed_policies_details(client=client, **kwargs)
github Netflix-Skunkworks / cloudaux / cloudaux / aws / s3.py View on Github external
@rate_limited()
def get_bucket_website(client=None, **kwargs):
    """
    Bucket='string'
    """
    return client.get_bucket_website(**kwargs)