Adding os-services in blockstorage api
Change-Id: I6ded5a930c4d43288053014cb77a946732f37f12
diff --git a/openstack/blockstorage/extensions/os-services/requests.go b/openstack/blockstorage/extensions/os-services/requests.go
new file mode 100644
index 0000000..487e679
--- /dev/null
+++ b/openstack/blockstorage/extensions/os-services/requests.go
@@ -0,0 +1,13 @@
+package os_services
+
+import (
+ gophercloud "gerrit.mcp.mirantis.net/debian/gophercloud.git"
+ "gerrit.mcp.mirantis.net/debian/gophercloud.git/pagination"
+)
+
+// List returns a Pager that allows you to iterate over a collection of Network.
+func List(client *gophercloud.ServiceClient) pagination.Pager {
+ return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page {
+ return OsServicePage{pagination.SinglePageBase(r)}
+ })
+}
diff --git a/openstack/blockstorage/extensions/os-services/results.go b/openstack/blockstorage/extensions/os-services/results.go
new file mode 100644
index 0000000..3c6bb04
--- /dev/null
+++ b/openstack/blockstorage/extensions/os-services/results.go
@@ -0,0 +1,24 @@
+package os_services
+
+import "gerrit.mcp.mirantis.net/debian/gophercloud.git/pagination"
+
+type OsService struct {
+ ID string `json:"id"`
+ Host string `json:"host"`
+ State string `json:"state"`
+ Status string `json:"status"`
+ Zone string `json:"zone"`
+ Binary string `json:"binary"`
+}
+
+type OsServicePage struct {
+ pagination.SinglePageBase
+}
+
+func ExtractOsServices(r pagination.Page) ([]OsService, error) {
+ var s struct {
+ OsServices []OsService `json:"services"`
+ }
+ err := (r.(OsServicePage)).ExtractInto(&s)
+ return s.OsServices, err
+}
diff --git a/openstack/blockstorage/extensions/os-services/urls.go b/openstack/blockstorage/extensions/os-services/urls.go
new file mode 100644
index 0000000..26d87ba
--- /dev/null
+++ b/openstack/blockstorage/extensions/os-services/urls.go
@@ -0,0 +1,7 @@
+package os_services
+
+import gophercloud "gerrit.mcp.mirantis.net/debian/gophercloud.git"
+
+func listURL(c *gophercloud.ServiceClient) string {
+ return c.ServiceURL("os-services")
+}