Add Orchestration + ObjectStore HTTP operations
diff --git a/openstack/orchestration/v1/stacks/requests.go b/openstack/orchestration/v1/stacks/requests.go
index 68ba787..0dd6af2 100644
--- a/openstack/orchestration/v1/stacks/requests.go
+++ b/openstack/orchestration/v1/stacks/requests.go
@@ -111,11 +111,7 @@
return res
}
- // Send request to API
- _, res.Err = c.Request("POST", createURL(c), gophercloud.RequestOpts{
- JSONBody: &reqBody,
- JSONResponse: &res.Body,
- })
+ _, res.Err = c.Post(createURL(c), reqBody, &res.Body, nil)
return res
}
@@ -220,11 +216,7 @@
return res
}
- // Send request to API
- _, res.Err = c.Request("POST", adoptURL(c), gophercloud.RequestOpts{
- JSONBody: &reqBody,
- JSONResponse: &res.Body,
- })
+ _, res.Err = c.Post(adoptURL(c), reqBody, &res.Body, nil)
return res
}
@@ -300,11 +292,7 @@
// Get retreives a stack based on the stack name and stack ID.
func Get(c *gophercloud.ServiceClient, stackName, stackID string) GetResult {
var res GetResult
-
- // Send request to API
- _, res.Err = c.Request("GET", getURL(c, stackName, stackID), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- })
+ _, res.Err = c.Get(getURL(c, stackName, stackID), &res.Body, nil)
return res
}
@@ -385,17 +373,14 @@
return res
}
- // Send request to API
- _, res.Err = c.Request("PUT", updateURL(c, stackName, stackID), gophercloud.RequestOpts{
- JSONBody: &reqBody,
- })
+ _, res.Err = c.Put(updateURL(c, stackName, stackID), reqBody, nil, nil)
return res
}
// Delete deletes a stack based on the stack name and stack ID.
func Delete(c *gophercloud.ServiceClient, stackName, stackID string) DeleteResult {
var res DeleteResult
- _, res.Err = c.Request("DELETE", deleteURL(c, stackName, stackID), gophercloud.RequestOpts{})
+ _, res.Err = c.Delete(deleteURL(c, stackName, stackID), nil)
return res
}
@@ -490,10 +475,8 @@
}
// Send request to API
- _, res.Err = c.Request("POST", previewURL(c), gophercloud.RequestOpts{
- JSONBody: &reqBody,
- JSONResponse: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Post(previewURL(c), reqBody, &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
}
@@ -502,9 +485,7 @@
// resources intact, and returns data describing the stack and its resources.
func Abandon(c *gophercloud.ServiceClient, stackName, stackID string) AbandonResult {
var res AbandonResult
-
- // Send request to API
- _, res.Err = c.Request("DELETE", abandonURL(c, stackName, stackID), gophercloud.RequestOpts{
+ _, res.Err = c.Delete(abandonURL(c, stackName, stackID), &gophercloud.RequestOpts{
JSONResponse: &res.Body,
OkCodes: []int{200},
})