sort_key does not work for 'name' param on v2 snapshot API GET
Bug #1659504 reported by
Ghanshyam Mann
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Undecided
|
wangxiyuan |
Bug Description
v2 snapshots POST/GET/PUT all works with 'name' in request as well as in response. But only sort things does not work on 'name' it expect only 'display_name'.
Seems like DB layer have only 'display_name' no 'name').
It is little bit odd where 'name' is being published everywhere on API and user does not know what 'display_name' is in v2 APIs but user is being force to sort with 'display_name' only and 'name' sort_key does not work. This seems odd APIs behavior.
All other APIs and filter etc translation logic to convert 'name' to 'display_name' is there- https:/
For sort also same should be done at least.
Changed in cinder: | |
assignee: | nobody → wangxiyuan (wangxiyuan) |
To post a comment you must log in.
This seems to be working as expected to me. What commands give an unexpected output?
$ OS_VOLUME_ API_VERSION= 2 cinder snapshot-list ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ 2107-4028- 86ec-7b887ba50a 44 | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | c | 1 | 1a8c-46e2- 8000-4e1fb1fad8 1a | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | a | 1 | a94f-4bd5- 8ac7-7c77054ca1 17 | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | b | 1 | ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+
+------
| ID | Volume ID | Status | Name | Size |
+------
| 65b6128d-
| 85db0ec0-
| ccc396a7-
+------
$ OS_VOLUME_ API_VERSION= 2 cinder snapshot-list --sort name:asc ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ 1a8c-46e2- 8000-4e1fb1fad8 1a | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | a | 1 | a94f-4bd5- 8ac7-7c77054ca1 17 | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | b | 1 | 2107-4028- 86ec-7b887ba50a 44 | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | c | 1 | ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+
+------
| ID | Volume ID | Status | Name | Size |
+------
| 85db0ec0-
| ccc396a7-
| 65b6128d-
+------
$ OS_VOLUME_ API_VERSION= 2 cinder snapshot-list --sort name:desc ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ 2107-4028- 86ec-7b887ba50a 44 | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | c | 1 | a94f-4bd5- 8ac7-7c77054ca1 17 | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | b | 1 | 1a8c-46e2- 8000-4e1fb1fad8 1a | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | a | 1 | ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+
+------
| ID | Volume ID | Status | Name | Size |
+------
| 65b6128d-
| ccc396a7-
| 85db0ec0-
+------
$ OS_VOLUME_ API_VERSION= 3.20 cinder snapshot-list --sort name:asc ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------+ ------+ ------+ 1a8c-46e2- 8000-4e1fb1fad8 1a | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | a | 1 | a94f-4bd5- 8ac7-7c77054ca1 17 | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | b | 1 | 2107-4028- 86ec-7b887ba50a 44 | c225f384- d02b-449d- bf7f-c1b3918d06 60 | available | c | 1 |
+------
| ID | Volume ID | Status | Name | Size |
+------
| 85db0ec0-
| ccc396a7-
| 65b6128d-
+--...