l3-ndp-proxy: Add `is_filter` to API definition
The L3 NDP proxy API definition was partially updated when ``is_filter`` was introduced. The ``name`` attribute already declared ``is_filter``, but ``id``, ``project_id``, ``router_id``, ``port_id``, ``ip_address``, and ``description`` did not. With filter-validation enabled, list operations using query filters on those attributes return HTTP 400. Add ``is_filter: True`` to the six remaining scalar attributes and reformat the attribute map to match the multi-line style used in other updated API definitions. Related-Bug: #2167310 Assisted-By: Composer 2.5 Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com> Change-Id: I5dfacb08d0e0786f877ac53f02855354e15c3717
This commit is contained in:
1 parent
83fe70910d
commit
0d08f22527
2 files changed
+71
-42
No files matched your search
@@ -66,48 +66,68 @@ DESCRIPTION = 'description'
|
||||
# The resource attribute map for the extension.
|
||||
RESOURCE_ATTRIBUTE_MAP: ResourceAttributeMap = {
|
||||
COLLECTION_NAME: {
|
||||
ID: {'allow_post': False,
|
||||
'allow_put': False,
|
||||
'validate': {'type:uuid': None},
|
||||
'is_visible': True,
|
||||
'is_sort_key': True,
|
||||
'primary_key': True},
|
||||
NAME: {'allow_post': True,
|
||||
'allow_put': True,
|
||||
'validate': {'type:name_string': db_const.NAME_FIELD_SIZE},
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'is_visible': True, 'default': ''},
|
||||
PROJECT_ID: {'allow_post': True,
|
||||
'allow_put': False,
|
||||
'required_by_policy': True,
|
||||
'validate': {
|
||||
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
||||
'is_sort_key': True,
|
||||
'is_visible': True},
|
||||
ROUTER_ID: {'allow_post': True,
|
||||
'allow_put': False,
|
||||
'validate': {'type:uuid': None},
|
||||
'is_sort_key': True,
|
||||
'is_visible': True},
|
||||
PORT_ID: {'allow_post': True,
|
||||
'allow_put': False,
|
||||
'validate': {'type:uuid': None},
|
||||
'is_sort_key': True,
|
||||
'is_visible': True},
|
||||
IP_ADDRESS: {'allow_post': True,
|
||||
'allow_put': False,
|
||||
'default': None,
|
||||
'validate': {
|
||||
'type:ip_address_or_none': None},
|
||||
'is_sort_key': True,
|
||||
'is_visible': True},
|
||||
DESCRIPTION: {'allow_post': True,
|
||||
'allow_put': True,
|
||||
'default': '',
|
||||
'validate': {'type:string':
|
||||
db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
||||
'is_visible': True}
|
||||
ID: {
|
||||
'allow_post': False,
|
||||
'allow_put': False,
|
||||
'validate': {'type:uuid': None},
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'is_visible': True,
|
||||
'primary_key': True
|
||||
},
|
||||
NAME: {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'validate': {'type:name_string': db_const.NAME_FIELD_SIZE},
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'is_visible': True,
|
||||
'default': ''
|
||||
},
|
||||
PROJECT_ID: {
|
||||
'allow_post': True,
|
||||
'allow_put': False,
|
||||
'required_by_policy': True,
|
||||
'validate': {
|
||||
'type:string': db_const.PROJECT_ID_FIELD_SIZE},
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'is_visible': True
|
||||
},
|
||||
ROUTER_ID: {
|
||||
'allow_post': True,
|
||||
'allow_put': False,
|
||||
'validate': {'type:uuid': None},
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'is_visible': True
|
||||
},
|
||||
PORT_ID: {
|
||||
'allow_post': True,
|
||||
'allow_put': False,
|
||||
'validate': {'type:uuid': None},
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'is_visible': True
|
||||
},
|
||||
IP_ADDRESS: {
|
||||
'allow_post': True,
|
||||
'allow_put': False,
|
||||
'default': None,
|
||||
'validate': {'type:ip_address_or_none': None},
|
||||
'is_filter': True,
|
||||
'is_sort_key': True,
|
||||
'is_visible': True
|
||||
},
|
||||
DESCRIPTION: {
|
||||
'allow_post': True,
|
||||
'allow_put': True,
|
||||
'default': '',
|
||||
'validate': {'type:string':
|
||||
db_const.LONG_DESCRIPTION_FIELD_SIZE},
|
||||
'is_filter': True,
|
||||
'is_visible': True
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Added ``is_filter`` to the remaining scalar attributes in the L3 NDP
|
||||
proxy API definition (``id``, ``project_id``, ``router_id``, ``port_id``,
|
||||
``ip_address``, and ``description``). The ``name`` attribute already
|
||||
declared ``is_filter``, but the others did not, which caused list
|
||||
operations with query filters to return HTTP 400 when the
|
||||
filter-validation extension is enabled.
|
||||
Reference in new issue
Block a user