Convert Orchestration and the new Compute extension.
diff --git a/openstack/orchestration/v1/buildinfo/requests.go b/openstack/orchestration/v1/buildinfo/requests.go
index c20b48c..379f34f 100644
--- a/openstack/orchestration/v1/buildinfo/requests.go
+++ b/openstack/orchestration/v1/buildinfo/requests.go
@@ -1,17 +1,13 @@
package buildinfo
-import (
- "github.com/racker/perigee"
- "github.com/rackspace/gophercloud"
-)
+import "github.com/rackspace/gophercloud"
// Get retreives data for the given stack template.
func Get(c *gophercloud.ServiceClient) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", getURL(c), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", getURL(c), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
diff --git a/openstack/orchestration/v1/stackevents/requests.go b/openstack/orchestration/v1/stackevents/requests.go
index 80808b1..37eab1e 100644
--- a/openstack/orchestration/v1/stackevents/requests.go
+++ b/openstack/orchestration/v1/stackevents/requests.go
@@ -1,7 +1,6 @@
package stackevents
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -10,10 +9,9 @@
func Find(c *gophercloud.ServiceClient, stackName string) FindResult {
var res FindResult
- _, res.Err = perigee.Request("GET", findURL(c, stackName), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", findURL(c, stackName), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -199,10 +197,9 @@
// Get retreives data for the given stack resource.
func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName, eventID string) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", getURL(c, stackName, stackID, resourceName, eventID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", getURL(c, stackName, stackID, resourceName, eventID), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
diff --git a/openstack/orchestration/v1/stackresources/requests.go b/openstack/orchestration/v1/stackresources/requests.go
index 0ca87b8..2a66edc 100644
--- a/openstack/orchestration/v1/stackresources/requests.go
+++ b/openstack/orchestration/v1/stackresources/requests.go
@@ -1,7 +1,6 @@
package stackresources
import (
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -11,10 +10,9 @@
var res FindResult
// Send request to API
- _, res.Err = perigee.Request("GET", findURL(c, stackName), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", findURL(c, stackName), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -73,10 +71,9 @@
var res GetResult
// Send request to API
- _, res.Err = perigee.Request("GET", getURL(c, stackName, stackID, resourceName), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", getURL(c, stackName, stackID, resourceName), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -86,10 +83,9 @@
var res MetadataResult
// Send request to API
- _, res.Err = perigee.Request("GET", metadataURL(c, stackName, stackID, resourceName), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", metadataURL(c, stackName, stackID, resourceName), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -110,10 +106,9 @@
var res SchemaResult
// Send request to API
- _, res.Err = perigee.Request("GET", schemaURL(c, resourceType), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", schemaURL(c, resourceType), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -123,10 +118,9 @@
var res TemplateResult
// Send request to API
- _, res.Err = perigee.Request("GET", templateURL(c, resourceType), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", templateURL(c, resourceType), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
diff --git a/openstack/orchestration/v1/stacks/requests.go b/openstack/orchestration/v1/stacks/requests.go
index 549aecf..c0388c3 100644
--- a/openstack/orchestration/v1/stacks/requests.go
+++ b/openstack/orchestration/v1/stacks/requests.go
@@ -3,7 +3,6 @@
import (
"errors"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -113,11 +112,10 @@
}
// Send request to API
- _, res.Err = perigee.Request("POST", createURL(c), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{201},
+ _, res.Err = c.Request("POST", createURL(c), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{201},
})
return res
}
@@ -224,11 +222,10 @@
}
// Send request to API
- _, res.Err = perigee.Request("POST", adoptURL(c), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{201},
+ _, res.Err = c.Request("POST", adoptURL(c), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{201},
})
return res
}
@@ -307,10 +304,9 @@
var res GetResult
// Send request to API
- _, res.Err = perigee.Request("GET", getURL(c, stackName, stackID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", getURL(c, stackName, stackID), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -393,10 +389,9 @@
}
// Send request to API
- _, res.Err = perigee.Request("PUT", updateURL(c, stackName, stackID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- OkCodes: []int{202},
+ _, res.Err = c.Request("PUT", updateURL(c, stackName, stackID), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ OkCodes: []int{202},
})
return res
}
@@ -406,9 +401,8 @@
var res DeleteResult
// Send request to API
- _, res.Err = perigee.Request("DELETE", deleteURL(c, stackName, stackID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ _, res.Err = c.Request("DELETE", deleteURL(c, stackName, stackID), gophercloud.RequestOpts{
+ OkCodes: []int{204},
})
return res
}
@@ -504,11 +498,10 @@
}
// Send request to API
- _, res.Err = perigee.Request("POST", previewURL(c), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: &reqBody,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("POST", previewURL(c), gophercloud.RequestOpts{
+ JSONBody: &reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -519,10 +512,9 @@
var res AbandonResult
// Send request to API
- _, res.Err = perigee.Request("DELETE", abandonURL(c, stackName, stackID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("DELETE", abandonURL(c, stackName, stackID), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
diff --git a/openstack/orchestration/v1/stacktemplates/requests.go b/openstack/orchestration/v1/stacktemplates/requests.go
index 5f8aba9..f57e226 100644
--- a/openstack/orchestration/v1/stacktemplates/requests.go
+++ b/openstack/orchestration/v1/stacktemplates/requests.go
@@ -3,17 +3,15 @@
import (
"fmt"
- "github.com/racker/perigee"
"github.com/rackspace/gophercloud"
)
// Get retreives data for the given stack template.
func Get(c *gophercloud.ServiceClient, stackName, stackID string) GetResult {
var res GetResult
- _, res.Err = perigee.Request("GET", getURL(c, stackName, stackID), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("GET", getURL(c, stackName, stackID), gophercloud.RequestOpts{
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}
@@ -54,11 +52,10 @@
return res
}
- _, res.Err = perigee.Request("POST", validateURL(c), perigee.Options{
- MoreHeaders: c.AuthenticatedHeaders(),
- ReqBody: reqBody,
- Results: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Request("POST", validateURL(c), gophercloud.RequestOpts{
+ JSONBody: reqBody,
+ JSONResponse: &res.Body,
+ OkCodes: []int{200},
})
return res
}