diff options
author | Arun S A G <sagarun@gmail.com> | 2019-10-14 16:00:34 -0700 |
---|---|---|
committer | Arun S A G <sagarun@gmail.com> | 2019-10-18 11:37:41 -0700 |
commit | e36f72d36da53ff5439d0e5a19561bed9e792b06 (patch) | |
tree | 8eae9acc30e8d93ff3bc0d39599307c9650e3a7a /ironic/api/controllers/v1/volume_target.py | |
parent | a2ae57c457962e6fa5e590c0de19f4d457637881 (diff) | |
download | ironic-e36f72d36da53ff5439d0e5a19561bed9e792b06.tar.gz |
Do not ignore 'fields' query parameter when building next url
When an user calls the GET on an ironic resource it returns
MAX_LIMIT number of resources at a time along with a next url.
The default MAX_LIMIT is 1000.
If the user requested specific set of fields from ironic API
using the fields query parameter (eg: /v1/resource?fields=f1,f2,f3)
The next url returned by the API ignores fields query parameter.
This results in fields missing from the results after MAX_LIMIT
is reached.
This change fixes this problem by passing the fields as parameter
to collections.get_next method and using the fields argument to
build the query parameter.
Change-Id: I62b59e8148171c72de0ccf63a1517e754b520c76
Story: 2006721
Task: 37093
Diffstat (limited to 'ironic/api/controllers/v1/volume_target.py')
-rw-r--r-- | ironic/api/controllers/v1/volume_target.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ironic/api/controllers/v1/volume_target.py b/ironic/api/controllers/v1/volume_target.py index 28349670f..63afd35af 100644 --- a/ironic/api/controllers/v1/volume_target.py +++ b/ironic/api/controllers/v1/volume_target.py @@ -217,7 +217,8 @@ class VolumeTargetCollection(collection.Collection): for p in rpc_targets] if detail: kwargs['detail'] = detail - collection.next = collection.get_next(limit, url=url, **kwargs) + collection.next = collection.get_next(limit, url=url, fields=fields, + **kwargs) for target in collection.targets: target.sanitize(fields) return collection |