From 4c9bfc15b7c8ae3bf7091223f97fe8c714da3311 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Thu, 19 Aug 2021 13:39:12 +0000 Subject: [PATCH] Add network_ip_availability pagging and sorting support Add "network_ip_availability" pagging and sorting support, defining "network_id" as primary key. This primary key is unique per register retrieved and is needed by ``neutron.api.v2.base.Controller`` to create the pagination helper. This patch modifies an existing API extension instead of creating a new one. However: - This modification does not affect the Neutron behaviour without a code change in the "network_ip_availability" extension enabling the pagging support. The Neutron code change implies a bump in the neutron-lib version. - Adding a new extension to modify the current one is overengineering. Partial-Bug: #1940518 Change-Id: I4fa575f726fc0a7b7066f749e3b3f90ecc520087 --- neutron_lib/api/definitions/network_ip_availability.py | 3 ++- ...ork-ip-availability-pagging-support-cc01592cd477fd02.yaml | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/network-ip-availability-pagging-support-cc01592cd477fd02.yaml diff --git a/neutron_lib/api/definitions/network_ip_availability.py b/neutron_lib/api/definitions/network_ip_availability.py index 3aa74defa..e610de5e2 100644 --- a/neutron_lib/api/definitions/network_ip_availability.py +++ b/neutron_lib/api/definitions/network_ip_availability.py @@ -27,7 +27,8 @@ RESOURCE_ATTRIBUTE_MAP = { RESOURCE_PLURAL: { 'network_id': { 'allow_post': False, 'allow_put': False, - 'is_visible': True, 'is_filter': True + 'is_visible': True, 'is_filter': True, + 'primary_key': True, 'is_sort_key': True }, 'network_name': { 'allow_post': False, 'allow_put': False, diff --git a/releasenotes/notes/network-ip-availability-pagging-support-cc01592cd477fd02.yaml b/releasenotes/notes/network-ip-availability-pagging-support-cc01592cd477fd02.yaml new file mode 100644 index 000000000..8cc1aae9d --- /dev/null +++ b/releasenotes/notes/network-ip-availability-pagging-support-cc01592cd477fd02.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added pagging and sorting support for ``network-ip-availability`` API + extension. The primary key is ``network_id``.