Add API shim extension "quota-check-limit"
This extension indicates if Neutron supports checking the resource usage before applying a new quota limit. Change-Id: I94baf069624da4e4009eb8c0820f91b4d9e6738f Related-Bug: #1936408
This commit is contained in:
parent
64e4dc29a4
commit
14df80519c
@ -5532,6 +5532,13 @@ quota:
|
||||
in: body
|
||||
required: true
|
||||
type: object
|
||||
quota-check-limit:
|
||||
description: |
|
||||
A flag used in the ``quota`` update command. If enabled, the Quota engine
|
||||
will first check the resource usage before applying the new quota limit.
|
||||
in: body
|
||||
required: false
|
||||
type: object
|
||||
quota-detail:
|
||||
description: |
|
||||
A ``quota`` detail object. Each key in the object corresponds to a resource
|
||||
|
@ -114,6 +114,7 @@ Request
|
||||
- security_group_rule: quota-security_group_rule-request
|
||||
- subnet: quota-subnet-request
|
||||
- subnetpool: quota-subnetpool-request
|
||||
- check_limit: quota-check-limit
|
||||
|
||||
Request Example
|
||||
---------------
|
||||
|
@ -8,6 +8,7 @@
|
||||
"security_group": 10,
|
||||
"security_group_rule": 100,
|
||||
"subnet": 10,
|
||||
"subnetpool": -1
|
||||
"subnetpool": -1,
|
||||
"check_limit": "True"
|
||||
}
|
||||
}
|
||||
|
@ -105,6 +105,7 @@ from neutron_lib.api.definitions import qos_pps_minimum_rule
|
||||
from neutron_lib.api.definitions import qos_pps_rule
|
||||
from neutron_lib.api.definitions import qos_rule_type_details
|
||||
from neutron_lib.api.definitions import qos_rules_alias
|
||||
from neutron_lib.api.definitions import quota_check_limit
|
||||
from neutron_lib.api.definitions import rbac_address_groups
|
||||
from neutron_lib.api.definitions import rbac_address_scope
|
||||
from neutron_lib.api.definitions import rbac_bgpvpn
|
||||
@ -240,6 +241,7 @@ _ALL_API_DEFINITIONS = {
|
||||
qos_pps_rule,
|
||||
qos_rule_type_details,
|
||||
qos_rules_alias,
|
||||
quota_check_limit,
|
||||
rbac_address_groups,
|
||||
rbac_address_scope,
|
||||
rbac_bgpvpn,
|
||||
|
@ -145,6 +145,7 @@ KNOWN_EXTENSIONS = (
|
||||
'qos-port-network-policy',
|
||||
'qos-rules-alias',
|
||||
'quotas',
|
||||
'quota-check-limit',
|
||||
'rbac-address-group',
|
||||
'rbac-address-scope',
|
||||
'rbac-bgpvpn',
|
||||
|
27
neutron_lib/api/definitions/quota_check_limit.py
Normal file
27
neutron_lib/api/definitions/quota_check_limit.py
Normal file
@ -0,0 +1,27 @@
|
||||
# Copyright 2021 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
ALIAS = 'quota-check-limit'
|
||||
IS_SHIM_EXTENSION = True
|
||||
IS_STANDARD_ATTR_EXTENSION = False
|
||||
NAME = 'Quota engine limit check'
|
||||
DESCRIPTION = ('Support for checking the resource usage before applying a new '
|
||||
'quota limit')
|
||||
UPDATED_TIMESTAMP = '2021-09-08T16:00:00-00:00'
|
||||
RESOURCE_ATTRIBUTE_MAP = {}
|
||||
SUB_RESOURCE_ATTRIBUTE_MAP = {}
|
||||
ACTION_MAP = {}
|
||||
REQUIRED_EXTENSIONS = []
|
||||
OPTIONAL_EXTENSIONS = []
|
||||
ACTION_STATUS = {}
|
@ -0,0 +1,20 @@
|
||||
# Copyright 2021 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron_lib.api.definitions import quota_check_limit
|
||||
from neutron_lib.tests.unit.api.definitions import base
|
||||
|
||||
|
||||
class QuotaCheckLimitDefinitionTestCase(base.DefinitionBaseTestCase):
|
||||
extension_module = quota_check_limit
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Add API extension ``quota-check-limit``. This is a shim extension that
|
||||
indicates if Neutron supports checking the resource usage before applying
|
||||
a new quota limit. A new API parameter ``check_limit`` is introduced; it
|
||||
can be used in the ``quota`` update request to enable this check.
|
Loading…
Reference in New Issue
Block a user