CreateMetadata -> ResetMetadata
diff --git a/openstack/compute/v2/servers/fixtures.go b/openstack/compute/v2/servers/fixtures.go
index e116a27..0164605 100644
--- a/openstack/compute/v2/servers/fixtures.go
+++ b/openstack/compute/v2/servers/fixtures.go
@@ -522,8 +522,8 @@
})
}
-// HandleMetadataCreateSuccessfully sets up the test server to respond to a metadata Create request.
-func HandleMetadataCreateSuccessfully(t *testing.T) {
+// HandleMetadataResetSuccessfully sets up the test server to respond to a metadata Create request.
+func HandleMetadataResetSuccessfully(t *testing.T) {
th.Mux.HandleFunc("/servers/1234asdf/metadata", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "PUT")
th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
diff --git a/openstack/compute/v2/servers/requests.go b/openstack/compute/v2/servers/requests.go
index 5298391..79d7998 100644
--- a/openstack/compute/v2/servers/requests.go
+++ b/openstack/compute/v2/servers/requests.go
@@ -594,17 +594,17 @@
return result
}
-// CreateMetadataOptsBuilder allows extensions to add additional parameters to the
-// Create request.
-type CreateMetadataOptsBuilder interface {
- ToMetadataCreateMap() (map[string]interface{}, error)
+// ResetMetadataOptsBuilder allows extensions to add additional parameters to the
+// Reset request.
+type ResetMetadataOptsBuilder interface {
+ ToMetadataResetMap() (map[string]interface{}, error)
}
// MetadataOpts is a map that contains key-value pairs.
type MetadataOpts map[string]string
-// ToMetadataCreateMap assembles a body for a Create request based on the contents of a MetadataOpts.
-func (opts MetadataOpts) ToMetadataCreateMap() (map[string]interface{}, error) {
+// ToMetadataResetMap assembles a body for a Reset request based on the contents of a MetadataOpts.
+func (opts MetadataOpts) ToMetadataResetMap() (map[string]interface{}, error) {
return map[string]interface{}{"metadata": opts}, nil
}
@@ -613,13 +613,13 @@
return map[string]interface{}{"metadata": opts}, nil
}
-// CreateMetadata will create multiple new key-value pairs for the given server ID.
+// ResetMetadata will create multiple new key-value pairs for the given server ID.
// Note: Using this operation will erase any already-existing metadata and create
// the new metadata provided. To keep any already-existing metadata, use the
// UpdateMetadatas or UpdateMetadata function.
-func CreateMetadata(client *gophercloud.ServiceClient, id string, opts CreateMetadataOptsBuilder) CreateMetadataResult {
- var res CreateMetadataResult
- metadata, err := opts.ToMetadataCreateMap()
+func ResetMetadata(client *gophercloud.ServiceClient, id string, opts ResetMetadataOptsBuilder) ResetMetadataResult {
+ var res ResetMetadataResult
+ metadata, err := opts.ToMetadataResetMap()
if err != nil {
res.Err = err
return res
diff --git a/openstack/compute/v2/servers/requests_test.go b/openstack/compute/v2/servers/requests_test.go
index 0343700..017e793 100644
--- a/openstack/compute/v2/servers/requests_test.go
+++ b/openstack/compute/v2/servers/requests_test.go
@@ -235,14 +235,14 @@
th.AssertDeepEquals(t, expected, actual)
}
-func TestCreateMetadata(t *testing.T) {
+func TestResetMetadata(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
- HandleMetadataCreateSuccessfully(t)
+ HandleMetadataResetSuccessfully(t)
expected := map[string]string{"foo": "bar", "this": "that"}
- actual, err := CreateMetadata(client.ServiceClient(), "1234asdf", MetadataOpts{
+ actual, err := ResetMetadata(client.ServiceClient(), "1234asdf", MetadataOpts{
"foo": "bar",
"this": "that",
}).Extract()
diff --git a/openstack/compute/v2/servers/results.go b/openstack/compute/v2/servers/results.go
index d758fd3..3a145f8 100644
--- a/openstack/compute/v2/servers/results.go
+++ b/openstack/compute/v2/servers/results.go
@@ -178,8 +178,8 @@
MetadataResult
}
-// CreateMetadataResult temporarily contains the response from a metadata Create call.
-type CreateMetadataResult struct {
+// ResetMetadataResult temporarily contains the response from a metadata Reset call.
+type ResetMetadataResult struct {
MetadataResult
}