How to use the cloudaux.decorators.modify_output 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 / orchestration / aws / iam / role.py View on Github external
@modify_output
def get_role(role, flags=FLAGS.ALL, **conn):
    """
    Orchestrates all the calls required to fully build out an IAM Role in the following format:

    {
        "Arn": ...,
        "AssumeRolePolicyDocument": ...,
        "CreateDate": ...,  # str
        "InlinePolicies": ...,
        "InstanceProfiles": ...,
        "ManagedPolicies": ...,
        "Path": ...,
        "RoleId": ...,
        "RoleName": ...,
        "Tags": {},
        "_version": 3
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / gcp / iam / serviceaccount.py View on Github external
@modify_output
def get_serviceaccount_complete(service_account, flags=FLAGS.ALL, **conn):
    return registry.build_out(flags, service_account, **conn)
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / events.py View on Github external
@modify_output
def get_event(rule, flags=FLAGS.ALL, **conn):
    """
    Orchestrates all the calls required to fully build out a CloudWatch Event Rule in the following format:

    {
        "Arn": ...,
        "Name": ...,
        "Region": ...,
        "Description": ...,
        "State": ...,
        "Rule": ...,
        "Targets" ...,
        "_version": 1
    }

    :param rule: str cloudwatch event name
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / elb.py View on Github external
@modify_output
def get_load_balancer(load_balancer, flags=FLAGS.ALL ^ FLAGS.POLICY_TYPES, **conn):
    """
    Fully describes an ELB.

    :param loadbalancer: Could be an ELB Name or a dictionary. Likely the return value from a previous call to describe_load_balancers. At a minimum, must contain a key titled 'LoadBalancerName'.
    :param flags: Flags describing which sections should be included in the return value. Default is FLAGS.ALL minus FLAGS.POLICY_TYPES.
    :return: Returns a dictionary describing the ELB with the fields described in the flags parameter.
    """
    # Python 2 and 3 support:
    try:
        basestring
    except NameError as _:
        basestring = str

    if isinstance(load_balancer, basestring):
        load_balancer = dict(LoadBalancerName=load_balancer)
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / iam / group.py View on Github external
@modify_output
def get_group(group, flags=FLAGS.BASE | FLAGS.INLINE_POLICIES | FLAGS.MANAGED_POLICIES, **conn):
    """
    Orchestrates all the calls required to fully build out an IAM Group in the following format:

    {
        "Arn": ...,
        "GroupName": ...,
        "Path": ...,
        "GroupId": ...,
        "CreateDate": ...,  # str
        "InlinePolicies": ...,
        "ManagedPolicies": ...,  # These are just the names of the Managed Policies.
        "Users": ...,  # False by default -- these are just the names of the users.
        "_version": 1
    }
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / iam / user.py View on Github external
@modify_output
def get_user(user, flags=FLAGS.ALL, **conn):
    """
    Orchestrates all the calls required to fully build out an IAM User in the following format:

    {
        "Arn": ...,
        "AccessKeys": ...,
        "CreateDate": ...,  # str
        "InlinePolicies": ...,
        "ManagedPolicies": ...,
        "MFADevices": ...,
        "Path": ...,
        "UserId": ...,
        "UserName": ...,
        "SigningCerts": ...
    }
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / vpc.py View on Github external
@modify_output
def get_vpc(vpc_id, flags=FLAGS.ALL, **conn):
    """
    Orchestrates all the calls required to fully fetch details about a VPC:

    {
        "Arn": ...,
        "Region": ...,
        "Name": ...,
        "Id": ...,
        "Tags: ...,
        "VpcPeeringConnections": ...,
        "ClassicLink": ...,
        "DhcpOptionsId": ...,
        "InternetGateway": ...,
        "IsDefault": ...,
        "CidrBlock": ...,
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / s3.py View on Github external
@modify_output
def get_bucket(bucket_name, include_created=None, flags=FLAGS.ALL ^ FLAGS.CREATED_DATE, **conn):
    """
    Orchestrates all the calls required to fully build out an S3 bucket in the following format:
    
    {
        "Arn": ...,
        "Name": ...,
        "Region": ...,
        "Owner": ...,
        "Grants": ...,
        "GrantReferences": ...,
        "LifecycleRules": ...,
        "Logging": ...,
        "Policy": ...,
        "Tags": ...,
        "Versioning": ...,
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / lambda_function.py View on Github external
@modify_output
def get_lambda_function(lambda_function, flags=FLAGS.ALL, **conn):
    """Fully describes a lambda function.
    
    Args:
        lambda_function: Name, ARN, or dictionary of lambda function. If dictionary, should likely be the return value from list_functions. At a minimum, must contain a key titled 'FunctionName'.
        flags: Flags describing which sections should be included in the return value. Default ALL
    
    Returns:
        dictionary describing the requested lambda function.
    """
    # Python 2 and 3 support:
    try:
        basestring
    except NameError as _:
        basestring = str
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / elbv2.py View on Github external
@modify_output
def get_elbv2(alb, flags=FLAGS.ALL, **conn):
    """
    Fully describes an ALB (ELBv2).

    :param alb: Could be an ALB Name, ALB ARN, or a dictionary. Likely the return value from a previous call to describe_load_balancers. At a minimum, must contain a key titled 'LoadBalancerArn'.
    :param flags: Flags describing which sections should be included in the return value. Default is FLAGS.ALL.
    :return: Returns a dictionary describing the ALB with the fields described in the flags parameter.
    """
    # Python 2 and 3 support:
    try:
        basestring
    except NameError as _:
        basestring = str

    if isinstance(alb, basestring):
        from cloudaux.orchestration.aws.arn import ARN