[minor_change] Add pagination support for aci_rest module (DCNE-101)#711
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #711 +/- ##
===========================================
- Coverage 95.67% 35.72% -59.95%
===========================================
Files 270 267 -3
Lines 12405 12225 -180
Branches 1874 1849 -25
===========================================
- Hits 11868 4367 -7501
- Misses 406 7858 +7452
+ Partials 131 0 -131
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
plugins/modules/aci_rest.py
Outdated
| aci.path = "{0}?page={1}&page-size={2}".format(aci.path, page, page_size) | ||
| aci.url = update_qsl(aci.url, {"page": page, "page-size": page_size}) |
There was a problem hiding this comment.
There seems to be a issue when doing setting url and path in this way when path contains other filters. As an example if path is "/api/class/fvSubnet.json?order-by=fvSubnet.descr" and you would add page information as above it would display the url as "https://173.36.219.82/api/class/fvSubnet.json?order-by=fvSubnet.descr?page=0&page-size=3" but would sent correctly to https://173.36.219.82:443/api/class/fvSubnet.json?order-by=fvSubnet.descr&page=0&page-size=3
as temp workaround tested that leveraging the update_qsl() function will display it correctly
| aci.path = "{0}?page={1}&page-size={2}".format(aci.path, page, page_size) | |
| aci.url = update_qsl(aci.url, {"page": page, "page-size": page_size}) | |
| aci.path = update_qsl(aci.path, {"page": page, "page-size": page_size}) | |
| aci.url = update_qsl(aci.url, {"page": page, "page-size": page_size}) |
I do think however we should rootcause this, because it is likely that similar behaviour is present for rsp-subtree
There was a problem hiding this comment.
I´ll look into this. thanks.
Co-authored-by: Sabari Jaganathan <sajagana@cisco.com>
|
Thank you for your contribution! |
This change adds "page_size" and "page" optional paremeters to the aci_rest module in order to support pagination.
if the
page_sizeparameter is set on a GET request, it controls the amount of objects to be returned on each page by the APIC response, then thepageparameter controls which page is returned to the module.If the
pageparameter is not set, it returns the first page by default (0)