def location_list(self,print_location): """ List out all the available location for the associated account :returns: None :rtype: NoneType """ db_client = Evemongo_client() locations = db_client.get(LOCATION) n = 1 e = {} for location in locations: e[n] = location n = n + 1 if print_location: Console.ok(str(Printer.dict_table(e, order=['id','name','country', 'availability_zone', 'zone_state','region_name','provider']))) return locations
def keypair_list(self): """ List all the keypairs stored in db :returns: None :rtype: NoneType """ db_client = Evemongo_client() keys = db_client.get(KEYPAIR) n= 1 e = {} for key in keys: e[n] = key n = n + 1 Console.ok(str(Printer.dict_table(e, order=['name', 'fingerprint']))) return
def node_list(self): """ List all the nodes stored in db :returns: None :rtype: NoneType """ db_client = Evemongo_client() nodes = db_client.get(NODE) n= 1 e = {} for node in nodes: e[n] = node n = n + 1 Console.ok(str(Printer.dict_table(e, order=['uuid', 'name', 'state', 'provider']))) return
def image_list(self): """List of amazon images from mongodb :returns: None :rtype: NoneType """ #Fetch the list of images from db db_client = Evemongo_client() images = db_client.get(IMAGE) n= 1 e = {} for image in images: e[n] = image n = n + 1 Console.ok(str(Printer.dict_table(e, order=['id', 'name', 'driver']))) return
def flavor_list(self): """List of amazon images get store it in db :returns: None :rtype: NoneType """ #fetch the list from db, parse and print db_client = Evemongo_client() sizes = db_client.get(FLAVOR) n= 1 e = {} for size in sizes: e[n] = size n = n + 1 Console.ok(str(Printer.dict_table(e, order=['id', 'name', 'ram', 'disk', 'price']))) return
def volume_list(self, print_objs): """ List all the successfuly stored volumes :returns: None :rtype: NoneType """ #Fetch the list of images from db db_client = Evemongo_client() volumes = db_client.get(VOLUME) e = {} n = 1 for vol in volumes: e[n] = vol n = n + 1 if print_objs == True : Console.ok(str(Printer.dict_table(e, order=['id','name', 'size','driver']))) return volumes