def take_action(self, parsed_args): attrs = v2_utils.get_amphora_attrs(self.app.client_manager, parsed_args) data = self.app.client_manager.load_balancer.amphora_show( amphora_id=attrs.pop('amphora_id'), ) rows = const.AMPHORA_ROWS formatters = { 'loadbalancers': v2_utils.format_list, 'amphorae': v2_utils.format_list, } return (rows, utils.get_dict_properties(data, rows, formatters=formatters))
def take_action(self, parsed_args): columns = const.AMPHORA_COLUMNS attrs = v2_utils.get_amphora_attrs(self.app.client_manager, parsed_args) data = self.app.client_manager.load_balancer.amphora_list(**attrs) formatters = { 'amphorae': v2_utils.format_list, } return ( columns, (utils.get_dict_properties( amp, columns, formatters=formatters, ) for amp in data['amphorae']), )
def take_action(self, parsed_args): attrs = v2_utils.get_amphora_attrs(self.app.client_manager, parsed_args) self.app.client_manager.load_balancer.amphora_failover( amphora_id=attrs.pop('amphora_id'))