Esempio n. 1
0
def terminate(id):
    spot = AWSSpotInstance(config)
    instances = spot.terminate(id)

    if isinstance(instances, list):
        Console.reservations([], instances)
    else:
        Console.error(instances)
Esempio n. 2
0
def cancel(id):
    spot = AWSSpotInstance(config)
    requests = spot.cancel(id)

    if isinstance(requests, list):
        Console.reservations(requests, [])
    else:
        Console.error(requests)
Esempio n. 3
0
def create(price, image, zone, type, security_group_id):
    spot = AWSSpotInstance(config)
    spot.create(price=price, image=image, zone=zone, type=type,
        security_group_id=security_group_id)
Esempio n. 4
0
def running():
    spot = AWSSpotInstance(config)
    Console.reservations(
        spot.getInstanceRequests(),
        spot.getReservation()
    )
Esempio n. 5
0
def images(owners):
    spot = AWSSpotInstance(config)
    images = spot.getImages(owners=owners)
    Console.images(images, owners)
Esempio n. 6
0
def prices(os, type):
    spot = AWSSpotInstance(config)
    prices = spot.getPrices(os=os, instance_type=type)
    Console.prices(os, type, prices)