def take_action(self, parsed_args):
        attrs = v2_utils.get_flavorprofile_attrs(self.app.client_manager,
                                                 parsed_args)
        flavorprofile_id = attrs.pop('flavorprofile_id')

        self.app.client_manager.load_balancer.flavorprofile_delete(
            flavorprofile_id=flavorprofile_id)
 def take_action(self, parsed_args):
     columns = const.FLAVORPROFILE_COLUMNS
     attrs = v2_utils.get_flavorprofile_attrs(self.app.client_manager,
                                              parsed_args)
     data = self.app.client_manager.load_balancer.flavorprofile_list(
         **attrs)
     return (columns, (utils.get_dict_properties(s, columns, formatters={})
                       for s in data['flavorprofiles']))
    def take_action(self, parsed_args):
        attrs = v2_utils.get_flavorprofile_attrs(self.app.client_manager,
                                                 parsed_args)
        flavorprofile_id = attrs.pop('flavorprofile_id')
        body = {'flavorprofile': attrs}

        self.app.client_manager.load_balancer.flavorprofile_set(
            flavorprofile_id, json=body)
Esempio n. 4
0
    def take_action(self, parsed_args):
        rows = const.FLAVORPROFILE_ROWS
        attrs = v2_utils.get_flavorprofile_attrs(self.app.client_manager,
                                                 parsed_args)
        flavorprofile_id = attrs.pop('flavorprofile_id')

        data = self.app.client_manager.load_balancer.flavorprofile_show(
            flavorprofile_id=flavorprofile_id)

        return (rows, (utils.get_dict_properties(data, rows, formatters={})))
    def take_action(self, parsed_args):
        rows = const.FLAVORPROFILE_ROWS
        attrs = v2_utils.get_flavorprofile_attrs(self.app.client_manager,
                                                 parsed_args)
        body = {"flavorprofile": attrs}
        data = self.app.client_manager.load_balancer.flavorprofile_create(
            json=body)

        return (rows, (utils.get_dict_properties(data['flavorprofile'],
                                                 rows,
                                                 formatters={})))
    def take_action(self, parsed_args):
        rows = const.FLAVORPROFILE_ROWS
        data = None
        if uuidutils.is_uuid_like(parsed_args.flavorprofile):
            try:
                data = (
                    self.app.client_manager.load_balancer.flavorprofile_show(
                        flavorprofile_id=parsed_args.flavorprofile))
            except exceptions.NotFound:
                pass
        if data is None:
            attrs = v2_utils.get_flavorprofile_attrs(self.app.client_manager,
                                                     parsed_args)
            flavorprofile_id = attrs.pop('flavorprofile_id')

            data = self.app.client_manager.load_balancer.flavorprofile_show(
                flavorprofile_id=flavorprofile_id)

        return (rows, (utils.get_dict_properties(data, rows, formatters={})))