diff --git a/api-ref/source/v2/parameters.yaml b/api-ref/source/v2/parameters.yaml index d7ce26f26..142105eba 100644 --- a/api-ref/source/v2/parameters.yaml +++ b/api-ref/source/v2/parameters.yaml @@ -5895,8 +5895,9 @@ quota: 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. + (deprecated) 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 @@ -5923,6 +5924,13 @@ quota-floatingip-request: in: body required: false type: integer +quota-force: + description: | + A flag used in the ``quota`` update command. If enabled, the Quota engine + will not check the resource usage before applying the new quota limit. + in: body + required: false + type: object quota-network: description: | The number of networks allowed for each project. diff --git a/api-ref/source/v2/quotas.inc b/api-ref/source/v2/quotas.inc index 103f507a5..a602b2795 100644 --- a/api-ref/source/v2/quotas.inc +++ b/api-ref/source/v2/quotas.inc @@ -119,6 +119,7 @@ Request - subnet: quota-subnet-request - subnetpool: quota-subnetpool-request - check_limit: quota-check-limit + - force: quota-force Request Example --------------- diff --git a/api-ref/source/v2/samples/quotas/quotas-update-request.json b/api-ref/source/v2/samples/quotas/quotas-update-request.json index 31e7aa27c..690d13b7d 100644 --- a/api-ref/source/v2/samples/quotas/quotas-update-request.json +++ b/api-ref/source/v2/samples/quotas/quotas-update-request.json @@ -9,6 +9,7 @@ "security_group_rule": 100, "subnet": 10, "subnetpool": -1, - "check_limit": "True" + "check_limit": "True", + "force": "False" } } diff --git a/neutron_lib/api/definitions/__init__.py b/neutron_lib/api/definitions/__init__.py index dc82d0076..32efe2be7 100644 --- a/neutron_lib/api/definitions/__init__.py +++ b/neutron_lib/api/definitions/__init__.py @@ -120,6 +120,7 @@ from neutron_lib.api.definitions import qos_rule_type_details from neutron_lib.api.definitions import qos_rule_type_filter from neutron_lib.api.definitions import qos_rules_alias from neutron_lib.api.definitions import quota_check_limit +from neutron_lib.api.definitions import quota_check_limit_default 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 @@ -279,6 +280,7 @@ _ALL_API_DEFINITIONS = { qos_rule_type_filter, qos_rules_alias, quota_check_limit, + quota_check_limit_default, rbac_address_groups, rbac_address_scope, rbac_bgpvpn, diff --git a/neutron_lib/api/definitions/base.py b/neutron_lib/api/definitions/base.py index b317f1421..e40453baf 100644 --- a/neutron_lib/api/definitions/base.py +++ b/neutron_lib/api/definitions/base.py @@ -145,6 +145,7 @@ KNOWN_EXTENSIONS = ( 'qos-rules-alias', 'quotas', 'quota-check-limit', + 'quota-check-limit-default', 'port-hints', 'port-hint-ovs-tx-steering', 'port-numa-affinity-policy', diff --git a/neutron_lib/api/definitions/quota_check_limit_default.py b/neutron_lib/api/definitions/quota_check_limit_default.py new file mode 100644 index 000000000..df27d4816 --- /dev/null +++ b/neutron_lib/api/definitions/quota_check_limit_default.py @@ -0,0 +1,29 @@ +# Copyright 2024 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 + +ALIAS = 'quota-check-limit-default' +IS_SHIM_EXTENSION = True +IS_STANDARD_ATTR_EXTENSION = False +NAME = 'Quota engine limit check by default' +DESCRIPTION = ('By default, the Neutron quota engine checks the resource ' + 'usage before applying a new quota limit') +UPDATED_TIMESTAMP = '2024-08-21T16:00:00-00:00' +RESOURCE_ATTRIBUTE_MAP = {} +SUB_RESOURCE_ATTRIBUTE_MAP = {} +ACTION_MAP = {} +REQUIRED_EXTENSIONS = [quota_check_limit.ALIAS] +OPTIONAL_EXTENSIONS = [] +ACTION_STATUS = {} diff --git a/releasenotes/notes/add-quota-check-limit-default-api-extension-fa93ab98db487390.yaml b/releasenotes/notes/add-quota-check-limit-default-api-extension-fa93ab98db487390.yaml new file mode 100644 index 000000000..0ecde1e9f --- /dev/null +++ b/releasenotes/notes/add-quota-check-limit-default-api-extension-fa93ab98db487390.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Add API extension ``quota-check-limit-default``. This is a shim extension + that indicates if Neutron quota engine checks the resource usage before + updating any quota limit. That makes the extension ``quota-check-limit`` + to be the default Neutron quota engine behaviour and aligns it with other + projects. To enforce a quota limit without checking the resource usage, + now it is needed to pass the CLI parameter "--force".