Base a pagination.PageResult on gophercloud.Result.
diff --git a/openstack/blockstorage/v1/apiversions/requests.go b/openstack/blockstorage/v1/apiversions/requests.go
index 63ed76a..a56f249 100644
--- a/openstack/blockstorage/v1/apiversions/requests.go
+++ b/openstack/blockstorage/v1/apiversions/requests.go
@@ -9,7 +9,7 @@
// List lists all the Cinder API versions available to end-users.
func List(c *gophercloud.ServiceClient) pagination.Pager {
- return pagination.NewPager(c, listURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
+ return pagination.NewPager(c, listURL(c), func(r pagination.PageResult) pagination.Page {
return APIVersionPage{pagination.SinglePageBase(r)}
})
}
diff --git a/openstack/blockstorage/v1/snapshots/requests.go b/openstack/blockstorage/v1/snapshots/requests.go
index 792e7dd..49b637a 100644
--- a/openstack/blockstorage/v1/snapshots/requests.go
+++ b/openstack/blockstorage/v1/snapshots/requests.go
@@ -134,7 +134,7 @@
url += query
}
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
+ createPage := func(r pagination.PageResult) pagination.Page {
return ListResult{pagination.SinglePageBase(r)}
}
return pagination.NewPager(client, url, createPage)
diff --git a/openstack/blockstorage/v1/volumes/requests.go b/openstack/blockstorage/v1/volumes/requests.go
index ae97419..2b3aaeb 100644
--- a/openstack/blockstorage/v1/volumes/requests.go
+++ b/openstack/blockstorage/v1/volumes/requests.go
@@ -153,7 +153,7 @@
}
url += query
}
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
+ createPage := func(r pagination.PageResult) pagination.Page {
return ListResult{pagination.SinglePageBase(r)}
}
return pagination.NewPager(client, url, createPage)
diff --git a/openstack/blockstorage/v1/volumetypes/requests.go b/openstack/blockstorage/v1/volumetypes/requests.go
index 7253a87..c1c3dd5 100644
--- a/openstack/blockstorage/v1/volumetypes/requests.go
+++ b/openstack/blockstorage/v1/volumetypes/requests.go
@@ -78,7 +78,7 @@
// List returns all volume types.
func List(client *gophercloud.ServiceClient) pagination.Pager {
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
+ createPage := func(r pagination.PageResult) pagination.Page {
return ListResult{pagination.SinglePageBase(r)}
}
diff --git a/openstack/common/extensions/requests.go b/openstack/common/extensions/requests.go
index 79ea63d..f1b9c22 100755
--- a/openstack/common/extensions/requests.go
+++ b/openstack/common/extensions/requests.go
@@ -20,7 +20,7 @@
// List returns a Pager which allows you to iterate over the full collection of extensions.
// It does not accept query parameters.
func List(c *gophercloud.ServiceClient) pagination.Pager {
- return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
+ return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page {
return ExtensionPage{pagination.SinglePageBase(r)}
})
}
diff --git a/openstack/compute/v2/flavors/requests.go b/openstack/compute/v2/flavors/requests.go
index 6a2017f..b77a79a 100644
--- a/openstack/compute/v2/flavors/requests.go
+++ b/openstack/compute/v2/flavors/requests.go
@@ -53,8 +53,8 @@
}
url += query
}
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- return FlavorPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ createPage := func(r pagination.PageResult) pagination.Page {
+ return FlavorPage{pagination.LinkedPageBase{PageResult: r}}
}
return pagination.NewPager(client, url, createPage)
diff --git a/openstack/compute/v2/images/requests.go b/openstack/compute/v2/images/requests.go
index 4c9bc7a..4f93ffa 100644
--- a/openstack/compute/v2/images/requests.go
+++ b/openstack/compute/v2/images/requests.go
@@ -51,8 +51,8 @@
url += query
}
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- return ImagePage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ createPage := func(r pagination.PageResult) pagination.Page {
+ return ImagePage{pagination.LinkedPageBase{PageResult: r}}
}
return pagination.NewPager(client, url, createPage)
diff --git a/openstack/compute/v2/servers/requests.go b/openstack/compute/v2/servers/requests.go
index 490cd6b..4e20036 100644
--- a/openstack/compute/v2/servers/requests.go
+++ b/openstack/compute/v2/servers/requests.go
@@ -69,8 +69,8 @@
url += query
}
- createPageFn := func(r pagination.LastHTTPResponse) pagination.Page {
- return ServerPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ createPageFn := func(r pagination.PageResult) pagination.Page {
+ return ServerPage{pagination.LinkedPageBase{PageResult: r}}
}
return pagination.NewPager(client, url, createPageFn)
diff --git a/openstack/identity/v2/extensions/delegate.go b/openstack/identity/v2/extensions/delegate.go
index cee275f..fd6e80e 100644
--- a/openstack/identity/v2/extensions/delegate.go
+++ b/openstack/identity/v2/extensions/delegate.go
@@ -44,7 +44,7 @@
// List returns a Pager which allows you to iterate over the full collection of extensions.
// It does not accept query parameters.
func List(c *gophercloud.ServiceClient) pagination.Pager {
- return common.List(c).WithPageCreator(func(r pagination.LastHTTPResponse) pagination.Page {
+ return common.List(c).WithPageCreator(func(r pagination.PageResult) pagination.Page {
return ExtensionPage{
ExtensionPage: common.ExtensionPage{SinglePageBase: pagination.SinglePageBase(r)},
}
diff --git a/openstack/identity/v2/tenants/requests.go b/openstack/identity/v2/tenants/requests.go
index 5ffeaa7..5a359f5 100644
--- a/openstack/identity/v2/tenants/requests.go
+++ b/openstack/identity/v2/tenants/requests.go
@@ -16,8 +16,8 @@
// List enumerates the Tenants to which the current token has access.
func List(client *gophercloud.ServiceClient, opts *ListOpts) pagination.Pager {
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- return TenantPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ createPage := func(r pagination.PageResult) pagination.Page {
+ return TenantPage{pagination.LinkedPageBase{PageResult: r}}
}
url := listURL(client)
diff --git a/openstack/identity/v3/endpoints/requests.go b/openstack/identity/v3/endpoints/requests.go
index 345ec19..f05cae7 100644
--- a/openstack/identity/v3/endpoints/requests.go
+++ b/openstack/identity/v3/endpoints/requests.go
@@ -94,8 +94,8 @@
q["per_page"] = strconv.Itoa(opts.Page)
}
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- return EndpointPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ createPage := func(r pagination.PageResult) pagination.Page {
+ return EndpointPage{pagination.LinkedPageBase{PageResult: r}}
}
u := listURL(client) + utils.BuildQuery(q)
diff --git a/openstack/identity/v3/services/requests.go b/openstack/identity/v3/services/requests.go
index 5673eda..a3eefea 100644
--- a/openstack/identity/v3/services/requests.go
+++ b/openstack/identity/v3/services/requests.go
@@ -52,8 +52,8 @@
}
u := listURL(client) + utils.BuildQuery(q)
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- return ServicePage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ createPage := func(r pagination.PageResult) pagination.Page {
+ return ServicePage{pagination.LinkedPageBase{PageResult: r}}
}
return pagination.NewPager(client, u, createPage)
diff --git a/openstack/networking/v2/apiversions/requests.go b/openstack/networking/v2/apiversions/requests.go
index b653f51..9fb6de1 100644
--- a/openstack/networking/v2/apiversions/requests.go
+++ b/openstack/networking/v2/apiversions/requests.go
@@ -7,7 +7,7 @@
// ListVersions lists all the Neutron API versions available to end-users
func ListVersions(c *gophercloud.ServiceClient) pagination.Pager {
- return pagination.NewPager(c, apiVersionsURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
+ return pagination.NewPager(c, apiVersionsURL(c), func(r pagination.PageResult) pagination.Page {
return APIVersionPage{pagination.SinglePageBase(r)}
})
}
@@ -15,7 +15,7 @@
// ListVersionResources lists all of the different API resources for a particular
// API versions. Typical resources for Neutron might be: networks, subnets, etc.
func ListVersionResources(c *gophercloud.ServiceClient, v string) pagination.Pager {
- return pagination.NewPager(c, apiInfoURL(c, v), func(r pagination.LastHTTPResponse) pagination.Page {
+ return pagination.NewPager(c, apiInfoURL(c, v), func(r pagination.PageResult) pagination.Page {
return APIVersionResourcePage{pagination.SinglePageBase(r)}
})
}
diff --git a/openstack/networking/v2/extensions/layer3/floatingips/requests.go b/openstack/networking/v2/extensions/layer3/floatingips/requests.go
index feb23b3..a0a17fd 100644
--- a/openstack/networking/v2/extensions/layer3/floatingips/requests.go
+++ b/openstack/networking/v2/extensions/layer3/floatingips/requests.go
@@ -35,8 +35,8 @@
return pagination.Pager{Err: err}
}
u := rootURL(c) + q.String()
- return pagination.NewPager(c, u, func(r pagination.LastHTTPResponse) pagination.Page {
- return FloatingIPPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page {
+ return FloatingIPPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/extensions/layer3/routers/requests.go b/openstack/networking/v2/extensions/layer3/routers/requests.go
index dfdd606..52afc4f 100755
--- a/openstack/networking/v2/extensions/layer3/routers/requests.go
+++ b/openstack/networking/v2/extensions/layer3/routers/requests.go
@@ -37,8 +37,8 @@
return pagination.Pager{Err: err}
}
u := rootURL(c) + q.String()
- return pagination.NewPager(c, u, func(r pagination.LastHTTPResponse) pagination.Page {
- return RouterPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page {
+ return RouterPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/extensions/lbaas/members/requests.go b/openstack/networking/v2/extensions/lbaas/members/requests.go
index bb4da36..c13f0fe 100644
--- a/openstack/networking/v2/extensions/lbaas/members/requests.go
+++ b/openstack/networking/v2/extensions/lbaas/members/requests.go
@@ -38,8 +38,8 @@
return pagination.Pager{Err: err}
}
u := rootURL(c) + q.String()
- return pagination.NewPager(c, u, func(r pagination.LastHTTPResponse) pagination.Page {
- return MemberPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page {
+ return MemberPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/extensions/lbaas/monitors/requests.go b/openstack/networking/v2/extensions/lbaas/monitors/requests.go
index 5d4c696..9f8ac9a 100644
--- a/openstack/networking/v2/extensions/lbaas/monitors/requests.go
+++ b/openstack/networking/v2/extensions/lbaas/monitors/requests.go
@@ -44,8 +44,8 @@
}
u := rootURL(c) + q.String()
- return pagination.NewPager(c, u, func(r pagination.LastHTTPResponse) pagination.Page {
- return MonitorPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page {
+ return MonitorPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/extensions/lbaas/pools/requests.go b/openstack/networking/v2/extensions/lbaas/pools/requests.go
index 42be1fd..6e5b87a 100644
--- a/openstack/networking/v2/extensions/lbaas/pools/requests.go
+++ b/openstack/networking/v2/extensions/lbaas/pools/requests.go
@@ -39,8 +39,8 @@
return pagination.Pager{Err: err}
}
u := rootURL(c) + q.String()
- return pagination.NewPager(c, u, func(r pagination.LastHTTPResponse) pagination.Page {
- return PoolPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page {
+ return PoolPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/extensions/lbaas/vips/requests.go b/openstack/networking/v2/extensions/lbaas/vips/requests.go
index 606bcc5..6c4ee3d 100644
--- a/openstack/networking/v2/extensions/lbaas/vips/requests.go
+++ b/openstack/networking/v2/extensions/lbaas/vips/requests.go
@@ -56,8 +56,8 @@
return pagination.Pager{Err: err}
}
u := rootURL(c) + q.String()
- return pagination.NewPager(c, u, func(r pagination.LastHTTPResponse) pagination.Page {
- return VIPPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page {
+ return VIPPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/extensions/security/groups/requests.go b/openstack/networking/v2/extensions/security/groups/requests.go
index 67e95ca..6b33e06 100644
--- a/openstack/networking/v2/extensions/security/groups/requests.go
+++ b/openstack/networking/v2/extensions/security/groups/requests.go
@@ -32,8 +32,8 @@
return pagination.Pager{Err: err}
}
u := rootURL(c) + q.String()
- return pagination.NewPager(c, u, func(r pagination.LastHTTPResponse) pagination.Page {
- return SecGroupPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page {
+ return SecGroupPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/extensions/security/rules/requests.go b/openstack/networking/v2/extensions/security/rules/requests.go
index 34c9466..f243572 100644
--- a/openstack/networking/v2/extensions/security/rules/requests.go
+++ b/openstack/networking/v2/extensions/security/rules/requests.go
@@ -39,8 +39,8 @@
return pagination.Pager{Err: err}
}
u := rootURL(c) + q.String()
- return pagination.NewPager(c, u, func(r pagination.LastHTTPResponse) pagination.Page {
- return SecGroupRulePage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page {
+ return SecGroupRulePage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/networks/requests.go b/openstack/networking/v2/networks/requests.go
index 51c294f..a82eeb2 100644
--- a/openstack/networking/v2/networks/requests.go
+++ b/openstack/networking/v2/networks/requests.go
@@ -73,8 +73,8 @@
url += query
}
- return pagination.NewPager(c, url, func(r pagination.LastHTTPResponse) pagination.Page {
- return NetworkPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page {
+ return NetworkPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/ports/requests.go b/openstack/networking/v2/ports/requests.go
index 4e477d3..78aebae 100644
--- a/openstack/networking/v2/ports/requests.go
+++ b/openstack/networking/v2/ports/requests.go
@@ -73,8 +73,8 @@
url += query
}
- return pagination.NewPager(c, url, func(r pagination.LastHTTPResponse) pagination.Page {
- return PortPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page {
+ return PortPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/networking/v2/subnets/requests.go b/openstack/networking/v2/subnets/requests.go
index e913e61..17c5b82 100644
--- a/openstack/networking/v2/subnets/requests.go
+++ b/openstack/networking/v2/subnets/requests.go
@@ -72,8 +72,8 @@
url += query
}
- return pagination.NewPager(c, url, func(r pagination.LastHTTPResponse) pagination.Page {
- return SubnetPage{pagination.LinkedPageBase{LastHTTPResponse: r}}
+ return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page {
+ return SubnetPage{pagination.LinkedPageBase{PageResult: r}}
})
}
diff --git a/openstack/objectstorage/v1/containers/requests.go b/openstack/objectstorage/v1/containers/requests.go
index 004ef82..50542f4 100644
--- a/openstack/objectstorage/v1/containers/requests.go
+++ b/openstack/objectstorage/v1/containers/requests.go
@@ -52,8 +52,8 @@
}
}
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- p := ContainerPage{pagination.MarkerPageBase{LastHTTPResponse: r}}
+ createPage := func(r pagination.PageResult) pagination.Page {
+ p := ContainerPage{pagination.MarkerPageBase{PageResult: r}}
p.MarkerPageBase.Owner = p
return p
}
diff --git a/openstack/objectstorage/v1/containers/results.go b/openstack/objectstorage/v1/containers/results.go
index 3a6d3be..ec3c1e0 100644
--- a/openstack/objectstorage/v1/containers/results.go
+++ b/openstack/objectstorage/v1/containers/results.go
@@ -67,7 +67,7 @@
// ExtractNames is a function that takes a ListResult and returns the containers' names.
func ExtractNames(page pagination.Page) ([]string, error) {
casted := page.(ContainerPage)
- ct := casted.Header.Get("Content-Type")
+ ct := casted.Headers.Get("Content-Type")
switch {
case strings.HasPrefix(ct, "application/json"):
diff --git a/openstack/objectstorage/v1/objects/requests.go b/openstack/objectstorage/v1/objects/requests.go
index be4d107..49dc9f5 100644
--- a/openstack/objectstorage/v1/objects/requests.go
+++ b/openstack/objectstorage/v1/objects/requests.go
@@ -59,8 +59,8 @@
}
}
- createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- p := ObjectPage{pagination.MarkerPageBase{LastHTTPResponse: r}}
+ createPage := func(r pagination.PageResult) pagination.Page {
+ p := ObjectPage{pagination.MarkerPageBase{PageResult: r}}
p.MarkerPageBase.Owner = p
return p
}
diff --git a/openstack/objectstorage/v1/objects/results.go b/openstack/objectstorage/v1/objects/results.go
index 7bd2861..45a1048 100644
--- a/openstack/objectstorage/v1/objects/results.go
+++ b/openstack/objectstorage/v1/objects/results.go
@@ -64,7 +64,7 @@
// ExtractNames is a function that takes a page of objects and returns only their names.
func ExtractNames(page pagination.Page) ([]string, error) {
casted := page.(ObjectPage)
- ct := casted.Header.Get("Content-Type")
+ ct := casted.Headers.Get("Content-Type")
switch {
case strings.HasPrefix(ct, "application/json"):
parsed, err := ExtractInfo(page)