Add Orchestration + ObjectStore HTTP operations
diff --git a/openstack/orchestration/v1/buildinfo/requests.go b/openstack/orchestration/v1/buildinfo/requests.go
index 6068867..9e03e5c 100644
--- a/openstack/orchestration/v1/buildinfo/requests.go
+++ b/openstack/orchestration/v1/buildinfo/requests.go
@@ -5,8 +5,6 @@
// Get retreives data for the given stack template.
func Get(c *gophercloud.ServiceClient) GetResult {
var res GetResult
- _, res.Err = c.Request("GET", getURL(c), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- })
+ _, res.Err = c.Get(getURL(c), &res.Body, nil)
return res
}
diff --git a/openstack/orchestration/v1/stackevents/requests.go b/openstack/orchestration/v1/stackevents/requests.go
index 4f486bc..53c3916 100644
--- a/openstack/orchestration/v1/stackevents/requests.go
+++ b/openstack/orchestration/v1/stackevents/requests.go
@@ -196,9 +196,8 @@
// Get retreives data for the given stack resource.
func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName, eventID string) GetResult {
var res GetResult
- _, res.Err = c.Request("GET", getURL(c, stackName, stackID, resourceName, eventID), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Get(getURL(c, stackName, stackID, resourceName, eventID), &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
}
diff --git a/openstack/orchestration/v1/stackresources/requests.go b/openstack/orchestration/v1/stackresources/requests.go
index b63ef68..ee9c3c2 100644
--- a/openstack/orchestration/v1/stackresources/requests.go
+++ b/openstack/orchestration/v1/stackresources/requests.go
@@ -70,9 +70,8 @@
var res GetResult
// Send request to API
- _, res.Err = c.Request("GET", getURL(c, stackName, stackID, resourceName), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Get(getURL(c, stackName, stackID, resourceName), &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
}
@@ -82,9 +81,8 @@
var res MetadataResult
// Send request to API
- _, res.Err = c.Request("GET", metadataURL(c, stackName, stackID, resourceName), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Get(metadataURL(c, stackName, stackID, resourceName), &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
}
@@ -105,9 +103,8 @@
var res SchemaResult
// Send request to API
- _, res.Err = c.Request("GET", schemaURL(c, resourceType), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Get(schemaURL(c, resourceType), &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
}
@@ -117,9 +114,8 @@
var res TemplateResult
// Send request to API
- _, res.Err = c.Request("GET", templateURL(c, resourceType), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Get(templateURL(c, resourceType), &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
}
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},
})
diff --git a/openstack/orchestration/v1/stacktemplates/requests.go b/openstack/orchestration/v1/stacktemplates/requests.go
index d9050b1..ad1e468 100644
--- a/openstack/orchestration/v1/stacktemplates/requests.go
+++ b/openstack/orchestration/v1/stacktemplates/requests.go
@@ -51,10 +51,8 @@
return res
}
- _, res.Err = c.Request("POST", validateURL(c), gophercloud.RequestOpts{
- JSONBody: reqBody,
- JSONResponse: &res.Body,
- OkCodes: []int{200},
+ _, res.Err = c.Post(validateURL(c), reqBody, &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
return res
}