def terminate(id): spot = AWSSpotInstance(config) instances = spot.terminate(id) if isinstance(instances, list): Console.reservations([], instances) else: Console.error(instances)
def cancel(id): spot = AWSSpotInstance(config) requests = spot.cancel(id) if isinstance(requests, list): Console.reservations(requests, []) else: Console.error(requests)
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)
def running(): spot = AWSSpotInstance(config) Console.reservations( spot.getInstanceRequests(), spot.getReservation() )
def images(owners): spot = AWSSpotInstance(config) images = spot.getImages(owners=owners) Console.images(images, owners)
def prices(os, type): spot = AWSSpotInstance(config) prices = spot.getPrices(os=os, instance_type=type) Console.prices(os, type, prices)