Use the new API in openstack/blockstorage.
diff --git a/openstack/blockstorage/v1/apiversions/requests.go b/openstack/blockstorage/v1/apiversions/requests.go
index 016bf37..f5a793c 100644
--- a/openstack/blockstorage/v1/apiversions/requests.go
+++ b/openstack/blockstorage/v1/apiversions/requests.go
@@ -3,8 +3,6 @@
import (
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
-
- "github.com/racker/perigee"
)
// List lists all the Cinder API versions available to end-users.
@@ -18,11 +16,9 @@
// type from the result, call the Extract method on the GetResult.
func Get(client *gophercloud.ServiceClient, v string) GetResult {
var res GetResult
- _, err := perigee.Request("GET", getURL(client, v), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
- Results: &res.Body,
+ _, res.Err = client.Request("GET", getURL(client, v), gophercloud.RequestOpts{
+ OkCodes: []int{200},
+ JSONResponse: &res.Body,
})
- res.Err = err
return res
}
diff --git a/openstack/blockstorage/v1/snapshots/requests.go b/openstack/blockstorage/v1/snapshots/requests.go
index 443f696..1b313a6 100644
--- a/openstack/blockstorage/v1/snapshots/requests.go
+++ b/openstack/blockstorage/v1/snapshots/requests.go
@@ -5,8 +5,6 @@
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
-
- "github.com/racker/perigee"
)
// CreateOptsBuilder allows extensions to add additional parameters to the
@@ -69,11 +67,10 @@
return res
}
- _, res.Err = perigee.Request("POST", createURL(client), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200, 201},
- ReqBody: &reqBody,
- Results: &res.Body,
+ _, res.Err = client.Request("POST", createURL(client), gophercloud.RequestOpts{
+ OkCodes: []int{200, 201},
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
})
return res
}
@@ -81,9 +78,8 @@
// Delete will delete the existing Snapshot with the provided ID.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202, 204},
+ _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{202, 204},
})
return res
}
@@ -92,10 +88,9 @@
// object from the response, call the Extract method on the GetResult.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", getURL(client, id), perigee.Options{
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, res.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{200},
+ JSONResponse: &res.Body,
})
return res
}
@@ -178,11 +173,10 @@
return res
}
- _, res.Err = perigee.Request("PUT", updateMetadataURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
- ReqBody: &reqBody,
- Results: &res.Body,
+ _, res.Err = client.Request("PUT", updateMetadataURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{200},
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
})
return res
}
diff --git a/openstack/blockstorage/v1/volumes/requests.go b/openstack/blockstorage/v1/volumes/requests.go
index f4332de..e620ca6 100644
--- a/openstack/blockstorage/v1/volumes/requests.go
+++ b/openstack/blockstorage/v1/volumes/requests.go
@@ -5,8 +5,6 @@
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
-
- "github.com/racker/perigee"
)
// CreateOptsBuilder allows extensions to add additional parameters to the
@@ -85,11 +83,10 @@
return res
}
- _, res.Err = perigee.Request("POST", createURL(client), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200, 201},
+ _, res.Err = client.Request("POST", createURL(client), gophercloud.RequestOpts{
+ OkCodes: []int{200, 201},
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
})
return res
}
@@ -97,9 +94,8 @@
// Delete will delete the existing Volume with the provided ID.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202, 204},
+ _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{202, 204},
})
return res
}
@@ -108,10 +104,9 @@
// from the response, call the Extract method on the GetResult.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", getURL(client, id), perigee.Options{
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ _, res.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -207,11 +202,10 @@
return res
}
- _, res.Err = perigee.Request("PUT", updateURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
- ReqBody: &reqBody,
- Results: &res.Body,
+ _, res.Err = client.Request("PUT", updateURL(client, id), gophercloud.RequestOpts{
+ OkCodes: []int{200},
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
})
return res
}
diff --git a/openstack/blockstorage/v1/volumetypes/requests.go b/openstack/blockstorage/v1/volumetypes/requests.go
index 87e20f6..6fedaa6 100644
--- a/openstack/blockstorage/v1/volumetypes/requests.go
+++ b/openstack/blockstorage/v1/volumetypes/requests.go
@@ -1,7 +1,6 @@
package volumetypes
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -45,11 +44,11 @@
return res
}
- _, res.Err = perigee.Request("POST", createURL(client), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200, 201},
- ReqBody: &reqBody,
- Results: &res.Body,
+ _, res.Err = client.Request("POST", createURL(client), gophercloud.RequestOpts{
+ MoreHeaders: client.AuthenticatedHeaders(),
+ OkCodes: []int{200, 201},
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
})
return res
}
@@ -57,7 +56,7 @@
// Delete will delete the volume type with the provided ID.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(client, id), perigee.Options{
+ _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{
MoreHeaders: client.AuthenticatedHeaders(),
OkCodes: []int{202},
})
@@ -68,10 +67,10 @@
// type from the result, call the Extract method on the GetResult.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
- _, err := perigee.Request("GET", getURL(client, id), perigee.Options{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
- Results: &res.Body,
+ _, err := client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
+ MoreHeaders: client.AuthenticatedHeaders(),
+ OkCodes: []int{200},
+ JSONResponse: &res.Body,
})
res.Err = err
return res