rehome qos bw limit direction api def
This patch rehomes the qos bandwidth limit direction extension's API definition into neutron-lib. This definition extends an existing sub-resource and thus requires the unit test changes in commit Ib91004490dc3ca71b7caafe5cc3cb07417be1e4c For sample consumption see commit I4cea734dd713f00d6e4c416a50c4dde620dc644d Change-Id: I823f567ddf9c895eb3cf94e95ae34a382d67f51d
This commit is contained in:
parent
36bb16b941
commit
2dc9675f0f
@ -56,6 +56,7 @@ from neutron_lib.api.definitions import portbindings_extended
|
||||
from neutron_lib.api.definitions import project_id
|
||||
from neutron_lib.api.definitions import provider_net
|
||||
from neutron_lib.api.definitions import qos
|
||||
from neutron_lib.api.definitions import qos_bw_limit_direction
|
||||
from neutron_lib.api.definitions import qos_default
|
||||
from neutron_lib.api.definitions import qos_rule_type_details
|
||||
from neutron_lib.api.definitions import revisionifmatch
|
||||
@ -124,6 +125,7 @@ _ALL_API_DEFINITIONS = {
|
||||
project_id,
|
||||
provider_net,
|
||||
qos,
|
||||
qos_bw_limit_direction,
|
||||
qos_default,
|
||||
qos_rule_type_details,
|
||||
revisionifmatch,
|
||||
|
52
neutron_lib/api/definitions/qos_bw_limit_direction.py
Normal file
52
neutron_lib/api/definitions/qos_bw_limit_direction.py
Normal file
@ -0,0 +1,52 @@
|
||||
# Copyright (c) 2017 OVH SAS
|
||||
# All rights reserved.
|
||||
#
|
||||
# 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 qos as qos_apidef
|
||||
from neutron_lib import constants
|
||||
|
||||
|
||||
DIRECTION = 'direction'
|
||||
|
||||
ALIAS = 'qos-bw-limit-direction'
|
||||
LABEL = ''
|
||||
IS_SHIM_EXTENSION = False
|
||||
IS_STANDARD_ATTR_EXTENSION = False
|
||||
NAME = 'Direction for QoS bandwidth limit rule'
|
||||
API_PREFIX = ''
|
||||
DESCRIPTION = ("Allow to configure QoS bandwidth limit rule with specific "
|
||||
"direction: ingress or egress")
|
||||
UPDATED_TIMESTAMP = '2017-04-10T10:00:00-00:00'
|
||||
RESOURCE_ATTRIBUTE_MAP = {}
|
||||
SUB_RESOURCE_ATTRIBUTE_MAP = {
|
||||
# NOTE(boden): parameters is required here as BANDWIDTH_LIMIT_RULES is a
|
||||
# sub-resource extension itself
|
||||
qos_apidef.BANDWIDTH_LIMIT_RULES: {
|
||||
'parameters': {
|
||||
DIRECTION: {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'is_visible': True,
|
||||
'default': constants.EGRESS_DIRECTION,
|
||||
'validate': {
|
||||
'type:values': constants.VALID_DIRECTIONS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ACTION_MAP = {}
|
||||
REQUIRED_EXTENSIONS = [qos_apidef.ALIAS]
|
||||
OPTIONAL_EXTENSIONS = []
|
||||
ACTION_STATUS = {}
|
@ -0,0 +1,24 @@
|
||||
# Copyright (c) 2017 OVH SAS
|
||||
# All rights reserved.
|
||||
#
|
||||
# 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 qos
|
||||
from neutron_lib.api.definitions import qos_bw_limit_direction
|
||||
from neutron_lib.tests.unit.api.definitions import base
|
||||
|
||||
|
||||
class QoSBwLimitDirectionDefinitionTestCase(base.DefinitionBaseTestCase):
|
||||
extension_module = qos_bw_limit_direction
|
||||
extension_subresources = (qos.BANDWIDTH_LIMIT_RULES,)
|
||||
extension_attributes = (qos_bw_limit_direction.DIRECTION,)
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- The ``qos-bw-limit-direction`` extension's API definition is now available
|
||||
in ``neutron_lib.api.definitions.qos_bw_limit_direction``.
|
Loading…
Reference in New Issue
Block a user