Add Local IP constants needed for policy checks

Additionally adds required small fixes to API def

Partial-Bug: #1930200
Change-Id: I1ec3185becf03bdc208b0af8c00d2794113a88d5
This commit is contained in:
Oleg Bondarev 2021-09-29 17:22:38 +08:00
parent 4eb64ecf32
commit 1d4da16374
3 changed files with 9 additions and 4 deletions

View File

@ -108,6 +108,10 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
'parent': {'collection_name': COLLECTION_NAME,
'member_name': RESOURCE_NAME},
'parameters': {
'local_ip_id': {
'allow_post': False,
'allow_put': False,
'is_visible': True},
'local_ip_address': {
'allow_post': False,
'allow_put': False,
@ -140,9 +144,7 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
'allow_put': False,
'validate': {'type:string': db_const.PROJECT_ID_FIELD_SIZE},
'required_by_policy': True,
'is_filter': True,
'is_sort_key': True,
'is_visible': True},
'is_visible': False},
}
}
}

View File

@ -26,6 +26,7 @@ FLOATINGIPPOOL = "FLOATINGIPPOOL"
NETWORK_SEGMENT_RANGE = "NETWORK_SEGMENT_RANGE"
CONNTRACKHELPER = "CONNTRACKHELPER"
PLACEMENT_REPORT = "placement_report"
LOCAL_IP = "LOCAL_IP"
# TODO(johnsom) Remove after these stop being used. Neutron-LBaaS is now
# retired (train) and these should no longer be necessary.

View File

@ -13,6 +13,7 @@
# under the License.
from neutron_lib.api.definitions import l3
from neutron_lib.api.definitions import local_ip
from neutron_lib.plugins import constants as plugin_const
@ -26,5 +27,6 @@ from neutron_lib.plugins import constants as plugin_const
# registered the service plugin name in neutron-lib.
EXT_PARENT_RESOURCE_MAPPING = {
l3.FLOATINGIP: plugin_const.L3,
l3.ROUTER: plugin_const.CONNTRACKHELPER
l3.ROUTER: plugin_const.CONNTRACKHELPER,
local_ip.RESOURCE_NAME: plugin_const.LOCAL_IP
}