From 6e4abc9422cdb197b003061a0fe4b060b4ee4c33 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 6 Aug 2018 10:20:00 +0200 Subject: [PATCH] Add 'is_filter' and 'is_sort_key' to fip pf attributes This patch adds flags to indicate which of the FIP port forwarding's atributes can be used to filtering and as a sort key. Change-Id: Ie3b50c7f3e3a82b565e8e16acc6ba3e0ea9dc471 Partially-Implements: blueprint port-forwarding Partial-Bug: #1491317 --- .../definitions/floating_ip_port_forwarding.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/neutron_lib/api/definitions/floating_ip_port_forwarding.py b/neutron_lib/api/definitions/floating_ip_port_forwarding.py index 461fa615f..cefc8ffd4 100644 --- a/neutron_lib/api/definitions/floating_ip_port_forwarding.py +++ b/neutron_lib/api/definitions/floating_ip_port_forwarding.py @@ -80,7 +80,9 @@ SUB_RESOURCE_ATTRIBUTE_MAP = { 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, - 'primary_key': True}, + 'primary_key': True, + 'is_sort_key': True, + 'is_filter': True}, PROJECT_ID: {'allow_post': True, 'allow_put': False, 'validate': { @@ -90,7 +92,9 @@ SUB_RESOURCE_ATTRIBUTE_MAP = { EXTERNAL_PORT: { 'allow_post': True, 'allow_put': True, 'validate': {'type:port_range': None}, - 'is_visible': True}, + 'is_visible': True, + 'is_sort_key': True, + 'is_filter': True}, INTERNAL_PORT: { 'allow_post': True, 'allow_put': True, 'validate': {'type:port_range': None}, @@ -103,11 +107,15 @@ SUB_RESOURCE_ATTRIBUTE_MAP = { PROTOCOL: {'allow_post': True, 'allow_put': True, 'validate': {'type:values': PROTOCOLS}, 'is_visible': True, - 'convert_to': converters.convert_to_protocol}, + 'convert_to': converters.convert_to_protocol, + 'is_sort_key': True, + 'is_filter': True}, INTERNAL_PORT_ID: {'allow_post': True, 'allow_put': True, 'validate': {'type:uuid': None}, - 'is_visible': True}, + 'is_visible': True, + 'is_sort_key': True, + 'is_filter': True}, } } }