-
Notifications
You must be signed in to change notification settings - Fork 583
V3 blockstorage snapshot list is using the wrong endpoint #2403
Copy link
Copy link
Closed
TaminoWalter/gophercloud
#1Description
Currently used endpoint and the correct endpoint
The snapshot list of blockstorage v3 is using the following endpoint:
https://URL/v3/ADMIN_PROJECT_ID/snapshots?all_tenants=true
But this endpoint is missing some values (for example the project ID). To include all attributes of the snapshot the following endpoint should be used:
https://URL/v3/ADMIN_PROJECT_ID/snapshots/detail?all_tenants=true
Code cause for this issue
This is because a error in https://github.com/gophercloud/gophercloud/blob/master/openstack/blockstorage/v3/snapshots/urls.go. With the following code:
...
func createURL(c *gophercloud.ServiceClient) string {
return c.ServiceURL("snapshots")
}
...
func listURL(c *gophercloud.ServiceClient) string {
return createURL(c)
}
...
As comparison the url generation for the blockstorage volumes (which use the correct detail endpoint) https://github.com/gophercloud/gophercloud/blob/master/openstack/blockstorage/v3/volumes/urls.go
func listURL(c *gophercloud.ServiceClient) string {
return c.ServiceURL("volumes", "detail")
}
Potential fix for this issue
This can be fixed by using the same logic for the snapshots like used for the volumes. That would look something like this:
func listURL(c *gophercloud.ServiceClient) string {
return c.ServiceURL("snapshots", "detail")
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels