def take_action(self, parsed_args): attrs = v2_utils.get_flavor_attrs(self.app.client_manager, parsed_args) flavor_id = attrs.pop('flavor_id') self.app.client_manager.load_balancer.flavor_delete( flavor_id=flavor_id)
def take_action(self, parsed_args): attrs = v2_utils.get_flavor_attrs(self.app.client_manager, parsed_args) flavor_id = attrs.pop('flavor_id') body = {'flavor': attrs} self.app.client_manager.load_balancer.flavor_set( flavor_id, json=body)
def take_action(self, parsed_args): columns = const.FLAVOR_COLUMNS attrs = v2_utils.get_flavor_attrs(self.app.client_manager, parsed_args) data = self.app.client_manager.load_balancer.flavor_list(**attrs) formatters = {'flavorprofiles': v2_utils.format_list} return (columns, (utils.get_dict_properties(s, columns, formatters=formatters) for s in data['flavors']))
def take_action(self, parsed_args): rows = const.FLAVOR_ROWS attrs = v2_utils.get_flavor_attrs(self.app.client_manager, parsed_args) body = {"flavor": attrs} data = self.app.client_manager.load_balancer.flavor_create(json=body) formatters = {'flavorprofiles': v2_utils.format_list} return (rows, (utils.get_dict_properties(data['flavor'], rows, formatters=formatters)))
def take_action(self, parsed_args): rows = const.FLAVOR_ROWS attrs = v2_utils.get_flavor_attrs(self.app.client_manager, parsed_args) flavor_id = attrs.pop('flavor_id') data = self.app.client_manager.load_balancer.flavor_show( flavor_id=flavor_id) formatters = {'flavorprofiles': v2_utils.format_list} return (rows, (utils.get_dict_properties(data, rows, formatters=formatters)))
def take_action(self, parsed_args): rows = const.FLAVOR_ROWS data = None if uuidutils.is_uuid_like(parsed_args.flavor): try: data = self.app.client_manager.load_balancer.flavor_show( flavor_id=parsed_args.flavor) except exceptions.NotFound: pass if data is None: attrs = v2_utils.get_flavor_attrs(self.app.client_manager, parsed_args) flavor_id = attrs.pop('flavor_id') data = self.app.client_manager.load_balancer.flavor_show( flavor_id=flavor_id) formatters = {'flavorprofiles': v2_utils.format_list} return (rows, (utils.get_dict_properties(data, rows, formatters=formatters)))