示例#1
0
    def take_action(self, parsed_args):
        rows = const.L7RULE_ROWS

        attrs = v2_utils.get_l7rule_attrs(self.app.client_manager, parsed_args)
        data = self.app.client_manager.load_balancer.l7rule_show(
            l7rule_id=attrs['l7rule_id'], l7policy_id=attrs['l7policy_id'])

        return (rows, (utils.get_dict_properties(data, rows, formatters={})))
示例#2
0
    def take_action(self, parsed_args):
        columns = const.L7RULE_COLUMNS
        attrs = v2_utils.get_l7rule_attrs(self.app.client_manager, parsed_args)

        data = self.app.client_manager.load_balancer.l7rule_list(
            l7policy_id=attrs['l7policy_id'])

        return (columns, (utils.get_dict_properties(s, columns, formatters={})
                          for s in data['rules']))
示例#3
0
    def take_action(self, parsed_args):
        attrs = v2_utils.get_l7rule_attrs(self.app.client_manager, parsed_args)
        validate.check_l7rule_attrs(attrs)

        l7policy_id = attrs.pop('l7policy_id')
        l7rule_id = attrs.pop('l7rule_id')

        body = {'rule': attrs}

        self.app.client_manager.load_balancer.l7rule_set(
            l7rule_id=l7rule_id, l7policy_id=l7policy_id, json=body)
示例#4
0
    def take_action(self, parsed_args):
        rows = const.L7RULE_ROWS
        attrs = v2_utils.get_l7rule_attrs(self.app.client_manager, parsed_args)
        validate.check_l7rule_attrs(attrs)

        l7policy_id = attrs.pop('l7policy_id')
        body = {"rule": attrs}
        data = self.app.client_manager.load_balancer.l7rule_create(
            l7policy_id=l7policy_id, json=body)

        return (rows, (utils.get_dict_properties(data['rule'],
                                                 rows,
                                                 formatters={})))
示例#5
0
    def take_action(self, parsed_args):
        attrs = v2_utils.get_l7rule_attrs(self.app.client_manager, parsed_args)

        self.app.client_manager.load_balancer.l7rule_delete(
            l7rule_id=attrs['l7rule_id'], l7policy_id=attrs['l7policy_id'])