Turns out /endpoints *is* paginated with links.
diff --git a/openstack/identity/v3/endpoints/requests.go b/openstack/identity/v3/endpoints/requests.go
index b5b38fc..97cc3cf 100644
--- a/openstack/identity/v3/endpoints/requests.go
+++ b/openstack/identity/v3/endpoints/requests.go
@@ -125,7 +125,7 @@
u := getListURL(client) + utils.BuildQuery(q)
- var respBody []Endpoint
+ var respBody EndpointList
_, err := perigee.Request("GET", u, perigee.Options{
MoreHeaders: client.Provider.AuthenticatedHeaders(),
Results: &respBody,
@@ -135,7 +135,7 @@
return nil, err
}
- return &EndpointList{Endpoints: respBody}, nil
+ return &respBody, nil
}
// Update changes an existing endpoint with new data.
diff --git a/openstack/identity/v3/endpoints/requests_test.go b/openstack/identity/v3/endpoints/requests_test.go
index 7fa660c..f5705a0 100644
--- a/openstack/identity/v3/endpoints/requests_test.go
+++ b/openstack/identity/v3/endpoints/requests_test.go
@@ -92,30 +92,36 @@
testhelper.TestHeader(t, r, "X-Auth-Token", tokenID)
fmt.Fprintf(w, `
- [
- {
- "id": "12",
- "interface": "public",
- "links": {
- "self": "https://localhost:5000/v3/endpoints/12"
+ {
+ "endpoints": [
+ {
+ "id": "12",
+ "interface": "public",
+ "links": {
+ "self": "https://localhost:5000/v3/endpoints/12"
+ },
+ "name": "the-endiest-of-points",
+ "region": "underground",
+ "service_id": "asdfasdfasdfasdf",
+ "url": "https://1.2.3.4:9000/"
},
- "name": "the-endiest-of-points",
- "region": "underground",
- "service_id": "asdfasdfasdfasdf",
- "url": "https://1.2.3.4:9000/"
- },
- {
- "id": "13",
- "interface": "internal",
- "links": {
- "self": "https://localhost:5000/v3/endpoints/13"
- },
- "name": "shhhh",
- "region": "underground",
- "service_id": "asdfasdfasdfasdf",
- "url": "https://1.2.3.4:9001/"
+ {
+ "id": "13",
+ "interface": "internal",
+ "links": {
+ "self": "https://localhost:5000/v3/endpoints/13"
+ },
+ "name": "shhhh",
+ "region": "underground",
+ "service_id": "asdfasdfasdfasdf",
+ "url": "https://1.2.3.4:9001/"
+ }
+ ],
+ "links": {
+ "next": null,
+ "previous": null
}
- ]
+ }
`)
})
diff --git a/openstack/identity/v3/endpoints/results.go b/openstack/identity/v3/endpoints/results.go
index a7bff83..3243cd8 100644
--- a/openstack/identity/v3/endpoints/results.go
+++ b/openstack/identity/v3/endpoints/results.go
@@ -14,6 +14,8 @@
// EndpointList contains a page of Endpoint results.
type EndpointList struct {
+ gophercloud.PaginationLinks `json:"links"`
+
service *gophercloud.ServiceClient
- Endpoints []Endpoint
+ Endpoints []Endpoint `json:"endpoints"`
}