Ejemplo n.º 1
0
def awsenv_print(environment):
    """
    Print information about all EC2 and RDS instances in the given AWS-environment.

    :param environment:
        The name of the environment.
    """
    awsenvironment = AwsEnvironment(environment)
    print('-' * 80)
    print('EC2 instances:')
    print('-' * 80)
    try:
        instancewrappers = awsenvironment.get_ec2_instancewrappers()
    except LookupError as e:
        print str(e)
    else:
        for instancewrapper in instancewrappers:
            print()
            print('{0}:'.format(instancewrapper.prettyname()))
            print_ec2_instance(instancewrapper.instance)

    print()
    print('-' * 80)
    print('RDS instances:')
    print('-' * 80)
    dbinstancewrappers = awsenvironment.get_rds_instancewrappers()
    for dbinstancewrapper in dbinstancewrappers:
        print()
        print_rds_instance(dbinstancewrapper.dbinstance)
Ejemplo n.º 2
0
def rds_print_instance(dbinstanceid, full=False):
    """
    Print RDS instance info.

    :param dbinstanceid:
        The id/name of the RDS instance.
    :param full:
        Print all attributes, or just the most useful ones? Defaults to
        ``False``.
    """
    dbinstancewrapper = RdsInstanceWrapper.get_dbinstancewrapper(dbinstanceid)
    print_rds_instance(dbinstancewrapper.dbinstance, full=bool(full), indentspaces=0)
Ejemplo n.º 3
0
def rds_print_instance(dbinstanceid, full=False):
    """
    Print RDS instance info.

    :param dbinstanceid:
        The id/name of the RDS instance.
    :param full:
        Print all attributes, or just the most useful ones? Defaults to
        ``False``.
    """
    dbinstancewrapper = RdsInstanceWrapper.get_dbinstancewrapper(dbinstanceid)
    print_rds_instance(dbinstancewrapper.dbinstance,
                       full=bool(full),
                       indentspaces=0)
Ejemplo n.º 4
0
@task
def awsenv_print(environment):
    """
    Print information about all EC2 and RDS instances in the given AWS-environment.

    :param environment:
        The name of the environment.
    """
    awsenvironment = AwsEnvironment(environment)
    print '-' * 80
    print 'EC2 instances:'
    print '-' * 80
    try:
        instancewrappers = awsenvironment.get_ec2_instancewrappers()
    except LookupError, e:
        print str(e)
    else:
        for instancewrapper in instancewrappers:
            print
            print '{0}:'.format(instancewrapper.prettyname())
            print_ec2_instance(instancewrapper.instance)

    print
    print '-' * 80
    print 'RDS instances:'
    print '-' * 80
    dbinstancewrappers = awsenvironment.get_rds_instancewrappers()
    for dbinstancewrapper in dbinstancewrappers:
        print
        print_rds_instance(dbinstancewrapper.dbinstance)
Ejemplo n.º 5
0
@task
def awsenv_print(environment):
    """
    Print information about all EC2 and RDS instances in the given AWS-environment.

    :param environment:
        The name of the environment.
    """
    awsenvironment = AwsEnvironment(environment)
    print "-" * 80
    print "EC2 instances:"
    print "-" * 80
    try:
        instancewrappers = awsenvironment.get_ec2_instancewrappers()
    except LookupError, e:
        print str(e)
    else:
        for instancewrapper in instancewrappers:
            print
            print "{0}:".format(instancewrapper.prettyname())
            print_ec2_instance(instancewrapper.instance)

    print
    print "-" * 80
    print "RDS instances:"
    print "-" * 80
    dbinstancewrappers = awsenvironment.get_rds_instancewrappers()
    for dbinstancewrapper in dbinstancewrappers:
        print
        print_rds_instance(dbinstancewrapper.dbinstance)