-
Notifications
You must be signed in to change notification settings - Fork 583
nova: List request always uses detailed server listing #2553
Copy link
Copy link
Closed
Description
There is no way to list servers without details, see https://docs.openstack.org/api-ref/compute/#list-servers vs https://docs.openstack.org/api-ref/compute/#list-servers-detailed
gophercloud/openstack/compute/v2/servers/requests.go
Lines 98 to 99 in 49ee5b4
| func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { | |
| url := listDetailURL(client) |
A simple comparison for 1k servers listing:
$ time curl -s https://nova:443/v2.1/servers -H "X-Auth-Token: ${OS_AUTH_TOKEN}" | jq -r '.servers|length'
985
real 0m1,907s
user 0m0,097s
sys 0m0,015s
$ time curl -s https://nove:443/v2.1/servers/detail -H "X-Auth-Token: ${OS_AUTH_TOKEN}" | jq -r '.servers|length'
985
real 0m20,425s
user 0m0,117s
sys 0m0,039s
simple servers listing takes 10 times faster results.
Proposal:
- implement a NEW
ListNoDetailfunction to list servers usinglistURL(client)call, keeping the backward compatibility for gophercloud - rename current
Listfunc toListDetailand implement a newListfunc using NO-detail URL. This will break backward compatibility. Nevertheless I prefer this solution, since other API calls do haveListDetailfunctions, e.g. nova images, flavors, manila shares and baremetals.
see also: kubernetes/cloud-provider-openstack#2089
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels