示例#1
0
    def take_action(self, parsed_args):
        attrs = v2_utils.get_quota_attrs(self.app.client_manager, parsed_args)

        project_id = attrs.pop('project_id')

        self.app.client_manager.load_balancer.quota_reset(
            project_id=project_id)
示例#2
0
    def take_action(self, parsed_args):
        rows = const.QUOTA_ROWS
        attrs = v2_utils.get_quota_attrs(self.app.client_manager, parsed_args)
        project_id = attrs.pop('project_id')

        data = self.app.client_manager.load_balancer.quota_show(
            project_id=project_id)

        return (rows, (utils.get_dict_properties(data, rows)))
示例#3
0
    def take_action(self, parsed_args):
        rows = const.QUOTA_ROWS
        attrs = v2_utils.get_quota_attrs(self.app.client_manager, parsed_args)
        self._check_attrs(attrs)
        project_id = attrs.pop('project_id')
        body = {'quota': attrs}

        data = self.app.client_manager.load_balancer.quota_set(project_id,
                                                               json=body)

        return (rows, (utils.get_dict_properties(data['quota'], rows)))
    def take_action(self, parsed_args):
        rows = const.QUOTA_ROWS
        data = None
        if uuidutils.is_uuid_like(parsed_args.project):
            try:
                data = self.app.client_manager.load_balancer.quota_show(
                    project_id=parsed_args.project)
            except exceptions.NotFound:
                pass
        if data is None:
            attrs = v2_utils.get_quota_attrs(self.app.client_manager,
                                             parsed_args)
            project_id = attrs.pop('project_id')

            data = self.app.client_manager.load_balancer.quota_show(
                project_id=project_id
            )

        return (rows, (utils.get_dict_properties(data, rows)))