def take_action(self, parsed_args): rows = const.MONITOR_ROWS attrs = v2_utils.get_health_monitor_attrs(self.app.client_manager, parsed_args) body = {"healthmonitor": attrs} data = self.app.client_manager.load_balancer.health_monitor_create( json=body) if parsed_args.wait: pool = self.app.client_manager.load_balancer.pool_show( data['healthmonitor']['pools'][0]['id']) v2_utils.wait_for_active(status_f=( self.app.client_manager.load_balancer.load_balancer_show), res_id=pool['loadbalancers'][0]['id']) data = { 'healthmonitor': (self.app.client_manager.load_balancer.health_monitor_show( data['healthmonitor']['id'])) } formatters = {'pools': v2_utils.format_list} return (rows, (utils.get_dict_properties(data['healthmonitor'], rows, formatters=formatters)))
def take_action(self, parsed_args): attrs = v2_utils.get_health_monitor_attrs(self.app.client_manager, parsed_args) health_monitor_id = attrs.pop('health_monitor_id') self.app.client_manager.load_balancer.health_monitor_delete( health_monitor_id=health_monitor_id)
def take_action(self, parsed_args): attrs = v2_utils.get_health_monitor_attrs(self.app.client_manager, parsed_args) listener_id = attrs.pop('health_monitor_id') body = {'healthmonitor': attrs} self.app.client_manager.load_balancer.health_monitor_set(listener_id, json=body)
def take_action(self, parsed_args): columns = const.MONITOR_COLUMNS attrs = v2_utils.get_health_monitor_attrs(self.app.client_manager, parsed_args) data = self.app.client_manager.load_balancer.health_monitor_list( **attrs) formatters = {'pools': v2_utils.format_list} return (columns, (utils.get_dict_properties(s, columns, formatters=formatters) for s in data['healthmonitors']))
def take_action(self, parsed_args): attrs = v2_utils.get_health_monitor_attrs(self.app.client_manager, parsed_args) health_monitor_id = attrs.pop('health_monitor_id') self.app.client_manager.load_balancer.health_monitor_delete( health_monitor_id=health_monitor_id) if parsed_args.wait: v2_utils.wait_for_delete(status_f=( self.app.client_manager.load_balancer.health_monitor_show), res_id=health_monitor_id)
def take_action(self, parsed_args): rows = const.MONITOR_ROWS attrs = v2_utils.get_health_monitor_attrs(self.app.client_manager, parsed_args) body = {"healthmonitor": attrs} data = self.app.client_manager.load_balancer.health_monitor_create( json=body) formatters = {'pools': v2_utils.format_list} return (rows, (utils.get_dict_properties(data['healthmonitor'], rows, formatters=formatters)))
def take_action(self, parsed_args): rows = const.MONITOR_ROWS attrs = v2_utils.get_health_monitor_attrs(self.app.client_manager, parsed_args) health_monitor_id = attrs.pop('health_monitor_id') data = self.app.client_manager.load_balancer.health_monitor_show( health_monitor_id=health_monitor_id, ) formatters = {'pools': v2_utils.format_list} return (rows, (utils.get_dict_properties(data, rows, formatters=formatters)))
def take_action(self, parsed_args): attrs = v2_utils.get_health_monitor_attrs(self.app.client_manager, parsed_args) hm_id = attrs.pop('health_monitor_id') body = {'healthmonitor': attrs} self.app.client_manager.load_balancer.health_monitor_set(hm_id, json=body) if parsed_args.wait: v2_utils.wait_for_active(status_f=( self.app.client_manager.load_balancer.health_monitor_show), res_id=hm_id)
def take_action(self, parsed_args): rows = const.MONITOR_ROWS data = None if uuidutils.is_uuid_like(parsed_args.health_monitor): try: data = ( self.app.client_manager.load_balancer.health_monitor_show( health_monitor_id=parsed_args.health_monitor)) except exceptions.NotFound: pass if data is None: attrs = v2_utils.get_health_monitor_attrs(self.app.client_manager, parsed_args) health_monitor_id = attrs.pop('health_monitor_id') data = self.app.client_manager.load_balancer.health_monitor_show( health_monitor_id=health_monitor_id, ) formatters = {'pools': v2_utils.format_list} return (rows, (utils.get_dict_properties(data, rows, formatters=formatters)))