Segment ignore sorting parameters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Medium
|
Hongbin Lu |
Bug Description
Send a request to get a list of network segments sorted by name but the response doesn't seem to be sorted (below is an example). Segment should support sorting to align with other API resources.
$ curl -g -s -X GET "http://
{
"segments": [
{
"name": null,
"network_id": "02dd8479-
"
"
"
"id": "0a046acf-
"
},
{
"name": "segment1",
"network_id": "a650210a-
"
"
"
"id": "d0cc2af3-
"
},
{
"name": "segment2",
"network_id": "a650210a-
"
"
"
"id": "5a0e733b-
"
},
{
"name": null,
"network_id": "ad93b454-
"
"
"
"id": "6131da02-
"
}
]
}
Changed in neutron: | |
assignee: | nobody → Hongbin Lu (hongbin.lu) |
Changed in neutron: | |
status: | New → Confirmed |
Tested and confirmed this bug with system built from master. Requesting sort by descending order:
$ curl -g -s -X GET "http:// localhost: 9696/v2. 0/segments? sort_dir= desc&sort_ key=name" -H "Content-type: application/json" -H "X-Auth-Token: $TOKEN" | jq d281-4fd0- 8ff0-481f1356bc 0b", segmentation_ id": 2016, network_ type": "vlan", physical_ network" : "physnet1", 0ab5-4b94- b7ea-b0266d022f 8d", description" : null d281-4fd0- 8ff0-481f1356bc 0b", segmentation_ id": 2016, network_ type": "vlan", physical_ network" : "physnet2", 4b76-4e1a- bb70-f51c46386c 2f", description" : null 2aa9-4dbf- b1f5-22234f33cd df", segmentation_ id": 1021, network_ type": "vxlan", physical_ network" : null, 0f90-4c97- 90b9-15b25f3209 08", description" : null c8fa-4d9e- b701-2b8cf67617 e2", segmentation_ id": null, network_ type": "flat", physical_ network" : "public", 60de-420c- 8f3a-5653a7acde dc", description" : null
{
"segments": [
{
"name": "segment1",
"network_id": "8445c42e-
"
"
"
"id": "44a4ff93-
"
},
{
"name": "segment2",
"network_id": "8445c42e-
"
"
"
"id": "ae421d4d-
"
},
{
"name": null,
"network_id": "96efc697-
"
"
"
"id": "97258b18-
"
},
{
"name": null,
"network_id": "ba67524e-
"
"
"
"id": "44a28675-
"
}
]
}
Returns the same as ascending order:
$ curl -g -s -X GET "http:// localhost: 9696/v2. 0/segments? sort_dir= asc&sort_ key=name" -H "Content-type: application/json" -H "X-Auth-Token: $TOKEN" | jq d281-4fd0- 8ff0-481f1356bc 0b", segmentation_ id": 2016, network_ type": "vlan", physical_ network" : "physnet1", 0ab5-4b94- b7ea-b0266d022f 8d", description" : null d281-4fd0- 8ff0-481f1356bc 0b", segmentation_ id": 2016, network_ type": "vlan", physical_ network" : "physnet2", 4b76-4e1a- bb70-f51c46386c 2f", description" : null 2aa9-4dbf- b1f5-22234f33cd df", segmentation_ id": 1021, network_ type": "vxlan", physical_ network" : null, 0f90-4c97- 90b9-15b25f3209 08", description" : null c8fa-4d9e- b701-2b8cf67617 e2", segmentation_ id": null, network_ type": "flat", physical_ network" : "public", 60de-420c- 8f3a-5653a7acde dc", description" : null
{
"segments": [
{
"name": "segment1",
"network_id": "8445c42e-
"
"
"
"id": "44a4ff93-
"
},
{
"name": "segment2",
"network_id": "8445c42e-
"
"
"
"id": "ae421d4d-
"
},
{
"name": null,
"network_id": "96efc697-
"
"
"
"id": "97258b18-
"
},
{
"name": null,
"network_id": "ba67524e-
"
"
"
"id": "44a28675-
"
}
]
}
While the sorting extension is enabled:
$ neutron ext-list | grep sorting
| sorting | Sorting support