Exemplo n.º 1
0
Arquivo: run.py Projeto: meigo/brenda
def status(opts, conf):
    ec2 = aws.get_ec2_conn(conf)
    instances = aws.filter_instances(opts, conf)
    if instances:
        print "Active Instances"
        now = time.time()
        for i in instances:
            uptime = aws.get_uptime(now, i.launch_time)
            print ' ', i.image_id, aws.format_uptime(uptime), i.public_dns_name
    requests = ec2.get_all_spot_instance_requests()
    if requests:
        print "Spot Requests"
        for r in requests:
            dns_name = ''
            print "  %s %s %s %s $%s %s %s" % (r.id, r.region, r.type, r.create_time, r.price, r.state, r.status)
Exemplo n.º 2
0
def status(opts, conf):
    ec2 = aws.get_ec2_conn(conf)
    instances = aws.filter_instances(opts, conf)
    if instances:
        print "Active Instances"
        now = time.time()
        for i in instances:
            uptime = aws.get_uptime(now, i.launch_time)
            print ' ', i.image_id, aws.format_uptime(uptime), i.public_dns_name
    requests = ec2.get_all_spot_instance_requests()
    if requests:
        print "Spot Requests"
        for r in requests:
            dns_name = ''
            print "  %s %s %s %s $%s %s %s" % (r.id, r.region, r.type, r.create_time, r.price, r.state, r.status)
Exemplo n.º 3
0
def status(opts, conf):
    now = time.time()
    instances = aws.filter_instances(opts, conf,
                                     {'instance-state-name': 'running'})
    if instances:
        print "Running Instances"
    for i in instances:
        uptime = aws.get_uptime(now, i.launch_time)
        print ' ', i.image_id, aws.format_uptime(
            uptime), i.public_dns_name, i.tags

    requests = aws.get_all_spot_instance_requests(
        opts, conf, {'state': ['active', 'open']})
    if requests:
        print "Active Spot Requests"
    for r in requests:
        print "  %s %s %s %s $%s %s %s %s" % (r.id, r.region, r.type,
                                              r.create_time, r.price, r.state,
                                              r.status, r.tags)
Exemplo n.º 4
0
def instances(opts, conf):
    now = time.time()
    for i in aws.filter_instances(opts, conf):
        uptime = aws.get_uptime(now, i.launch_time)
        print i.state, i.image_id, aws.format_uptime(
            uptime), i.public_dns_name, i.tags
Exemplo n.º 5
0
Arquivo: tool.py Projeto: t-/brenda
def instances(opts, conf):
    now = time.time()
    for i in aws.filter_instances(opts, conf):
        uptime = aws.get_uptime(now, i.launch_time)
        print i.image_id, aws.format_uptime(uptime), i.public_dns_name