Metadata -> Metadatum; Metadatas -> Metadata
diff --git a/acceptance/openstack/compute/v2/servers_test.go b/acceptance/openstack/compute/v2/servers_test.go
index 5fd69f2..5aa479b 100644
--- a/acceptance/openstack/compute/v2/servers_test.go
+++ b/acceptance/openstack/compute/v2/servers_test.go
@@ -418,33 +418,33 @@
t.Fatal(err)
}
- metadata, err := servers.UpdateMetadatas(client, server.ID, servers.MetadatasOpts{
+ metadata, err := servers.UpdateMetadata(client, server.ID, servers.MetadataOpts{
"foo": "bar",
"this": "that",
}).Extract()
th.AssertNoErr(t, err)
- t.Logf("UpdateMetadatas result: %+v\n", metadata)
+ t.Logf("UpdateMetadata result: %+v\n", metadata)
- err = servers.DeleteMetadata(client, server.ID, "foo").ExtractErr()
+ err = servers.DeleteMetadatum(client, server.ID, "foo").ExtractErr()
th.AssertNoErr(t, err)
- metadata, err = servers.CreateMetadata(client, server.ID, servers.MetadataOpts{
+ metadata, err = servers.CreateMetadatum(client, server.ID, servers.MetadatumOpts{
"foo": "baz",
}).Extract()
th.AssertNoErr(t, err)
- t.Logf("CreateMetadata result: %+v\n", metadata)
+ t.Logf("CreateMetadatum result: %+v\n", metadata)
- metadata, err = servers.Metadata(client, server.ID, "foo").Extract()
+ metadata, err = servers.Metadatum(client, server.ID, "foo").Extract()
th.AssertNoErr(t, err)
- t.Logf("Metadata result: %+v\n", metadata)
+ t.Logf("Metadatum result: %+v\n", metadata)
th.AssertEquals(t, "baz", metadata["foo"])
- metadata, err = servers.Metadatas(client, server.ID).Extract()
+ metadata, err = servers.Metadata(client, server.ID).Extract()
th.AssertNoErr(t, err)
- t.Logf("Metadatas result: %+v\n", metadata)
+ t.Logf("Metadata result: %+v\n", metadata)
- metadata, err = servers.CreateMetadatas(client, server.ID, servers.MetadatasOpts{}).Extract()
+ metadata, err = servers.CreateMetadata(client, server.ID, servers.MetadataOpts{}).Extract()
th.AssertNoErr(t, err)
- t.Logf("CreateMetadatas result: %+v\n", metadata)
+ t.Logf("CreateMetadata result: %+v\n", metadata)
th.AssertDeepEquals(t, map[string]string{}, metadata)
}
diff --git a/openstack/compute/v2/servers/fixtures.go b/openstack/compute/v2/servers/fixtures.go
index ed03b5c..e116a27 100644
--- a/openstack/compute/v2/servers/fixtures.go
+++ b/openstack/compute/v2/servers/fixtures.go
@@ -470,8 +470,8 @@
})
}
-// HandleMetadataGetSuccessfully sets up the test server to respond to a metadata Get request.
-func HandleMetadataGetSuccessfully(t *testing.T) {
+// HandleMetadatumGetSuccessfully sets up the test server to respond to a metadatum Get request.
+func HandleMetadatumGetSuccessfully(t *testing.T) {
th.Mux.HandleFunc("/servers/1234asdf/metadata/foo", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "GET")
th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
@@ -483,8 +483,8 @@
})
}
-// HandleMetadataCreateSuccessfully sets up the test server to respond to a server creation request.
-func HandleMetadataCreateSuccessfully(t *testing.T) {
+// HandleMetadatumCreateSuccessfully sets up the test server to respond to a metadatum Create request.
+func HandleMetadatumCreateSuccessfully(t *testing.T) {
th.Mux.HandleFunc("/servers/1234asdf/metadata/foo", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "PUT")
th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
@@ -500,8 +500,8 @@
})
}
-// HandleMetadataDeleteSuccessfully sets up the test server to respond to a metadata Delete request.
-func HandleMetadataDeleteSuccessfully(t *testing.T) {
+// HandleMetadatumDeleteSuccessfully sets up the test server to respond to a metadatum Delete request.
+func HandleMetadatumDeleteSuccessfully(t *testing.T) {
th.Mux.HandleFunc("/servers/1234asdf/metadata/foo", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "DELETE")
th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
@@ -510,8 +510,8 @@
})
}
-// HandleMetadatasGetSuccessfully sets up the test server to respond to a metadatas Get request.
-func HandleMetadatasGetSuccessfully(t *testing.T) {
+// HandleMetadataGetSuccessfully sets up the test server to respond to a metadata Get request.
+func HandleMetadataGetSuccessfully(t *testing.T) {
th.Mux.HandleFunc("/servers/1234asdf/metadata", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "GET")
th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
@@ -522,8 +522,8 @@
})
}
-// HandleMetadatasCreateSuccessfully sets up the test server to respond to a metadatas Create request.
-func HandleMetadatasCreateSuccessfully(t *testing.T) {
+// HandleMetadataCreateSuccessfully sets up the test server to respond to a metadata Create request.
+func HandleMetadataCreateSuccessfully(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)
@@ -540,8 +540,8 @@
})
}
-// HandleMetadatasUpdateSuccessfully sets up the test server to respond to a metadatas Update request.
-func HandleMetadatasUpdateSuccessfully(t *testing.T) {
+// HandleMetadataUpdateSuccessfully sets up the test server to respond to a metadata Update request.
+func HandleMetadataUpdateSuccessfully(t *testing.T) {
th.Mux.HandleFunc("/servers/1234asdf/metadata", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "POST")
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 7023bcf..5298391 100644
--- a/openstack/compute/v2/servers/requests.go
+++ b/openstack/compute/v2/servers/requests.go
@@ -594,110 +594,37 @@
return result
}
-// CreateMetadatasOptsBuilder allows extensions to add additional parameters to the
+// CreateMetadataOptsBuilder allows extensions to add additional parameters to the
// Create request.
-type CreateMetadatasOptsBuilder interface {
- ToMetadatasCreateMap() (map[string]interface{}, error)
+type CreateMetadataOptsBuilder interface {
+ ToMetadataCreateMap() (map[string]interface{}, error)
}
-// MetadatasOpts is a map that contains key-value pairs.
-type MetadatasOpts map[string]string
+// MetadataOpts is a map that contains key-value pairs.
+type MetadataOpts map[string]string
-// ToMetadatasCreateMap assembles a body for a Create request based on the contents of a MetadatasOpts.
-func (opts MetadatasOpts) ToMetadatasCreateMap() (map[string]interface{}, error) {
+// ToMetadataCreateMap assembles a body for a Create request based on the contents of a MetadataOpts.
+func (opts MetadataOpts) ToMetadataCreateMap() (map[string]interface{}, error) {
return map[string]interface{}{"metadata": opts}, nil
}
-// UpdateMetadatasOptsBuilder allows extensions to add additional parameters to the
-// Create request.
-type UpdateMetadatasOptsBuilder interface {
- ToMetadatasUpdateMap() (map[string]interface{}, error)
-}
-
-// ToMetadatasUpdateMap assembles a body for an Update request based on the contents of a MetadatasOpts.
-func (opts MetadatasOpts) ToMetadatasUpdateMap() (map[string]interface{}, error) {
+// ToMetadataUpdateMap assembles a body for an Update request based on the contents of a MetadataOpts.
+func (opts MetadataOpts) ToMetadataUpdateMap() (map[string]interface{}, error) {
return map[string]interface{}{"metadata": opts}, nil
}
-// CreateMetadatas will create multiple new key-value pairs for the given server ID.
+// CreateMetadata 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 CreateMetadatas(client *gophercloud.ServiceClient, id string, opts CreateMetadatasOptsBuilder) CreateMetadatasResult {
- var res CreateMetadatasResult
- metadatas, err := opts.ToMetadatasCreateMap()
- if err != nil {
- res.Err = err
- return res
- }
- _, res.Err = perigee.Request("PUT", metadatasURL(client, id), perigee.Options{
- ReqBody: metadatas,
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- })
- return res
-}
-
-// Metadatas requests all the metadata for the given server ID.
-func Metadatas(client *gophercloud.ServiceClient, id string) GetMetadatasResult {
- var res GetMetadatasResult
- _, res.Err = perigee.Request("GET", metadatasURL(client, id), perigee.Options{
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- })
- return res
-}
-
-// UpdateMetadatas updates (or creates) all the metadata specified by opts for the given server ID.
-// This operation does not affect already-existing metadata that is not specified
-// by opts.
-func UpdateMetadatas(client *gophercloud.ServiceClient, id string, opts UpdateMetadatasOptsBuilder) UpdateMetadatasResult {
- var res UpdateMetadatasResult
- metadatas, err := opts.ToMetadatasUpdateMap()
- if err != nil {
- res.Err = err
- return res
- }
- _, res.Err = perigee.Request("POST", metadatasURL(client, id), perigee.Options{
- ReqBody: metadatas,
- Results: &res.Body,
- MoreHeaders: client.AuthenticatedHeaders(),
- })
- return res
-}
-
-// MetadataOptsBuilder allows extensions to add additional parameters to the
-// Create request.
-type MetadataOptsBuilder interface {
- ToMetadataCreateMap() (map[string]interface{}, string, error)
-}
-
-// MetadataOpts is a map of length one that contains a key-value pair.
-type MetadataOpts map[string]string
-
-// ToMetadataCreateMap assembles a body for a Create request based on the contents of a MetadatasOpts.
-func (opts MetadataOpts) ToMetadataCreateMap() (map[string]interface{}, string, error) {
- if len(opts) != 1 {
- return nil, "", errors.New("CreateMetadata operation must have 1 and only 1 key-value pair.")
- }
- metadata := map[string]interface{}{"meta": opts}
- var key string
- for k := range metadata["meta"].(MetadataOpts) {
- key = k
- }
- return metadata, key, nil
-}
-
-// CreateMetadata will create or update the key-value pair with the given key for the given server ID.
-func CreateMetadata(client *gophercloud.ServiceClient, id string, opts MetadataOptsBuilder) CreateMetadataResult {
+func CreateMetadata(client *gophercloud.ServiceClient, id string, opts CreateMetadataOptsBuilder) CreateMetadataResult {
var res CreateMetadataResult
- metadata, key, err := opts.ToMetadataCreateMap()
+ metadata, err := opts.ToMetadataCreateMap()
if err != nil {
res.Err = err
return res
}
-
- _, res.Err = perigee.Request("PUT", metadataURL(client, id, key), perigee.Options{
+ _, res.Err = perigee.Request("PUT", metadataURL(client, id), perigee.Options{
ReqBody: metadata,
Results: &res.Body,
MoreHeaders: client.AuthenticatedHeaders(),
@@ -705,20 +632,93 @@
return res
}
-// Metadata requests the key-value pair with the given key for the given server ID.
-func Metadata(client *gophercloud.ServiceClient, id, key string) GetMetadataResult {
+// Metadata requests all the metadata for the given server ID.
+func Metadata(client *gophercloud.ServiceClient, id string) GetMetadataResult {
var res GetMetadataResult
- _, res.Err = perigee.Request("GET", metadataURL(client, id, key), perigee.Options{
+ _, res.Err = perigee.Request("GET", metadataURL(client, id), perigee.Options{
Results: &res.Body,
MoreHeaders: client.AuthenticatedHeaders(),
})
return res
}
-// DeleteMetadata will delete the key-value pair with the given key for the given server ID.
-func DeleteMetadata(client *gophercloud.ServiceClient, id, key string) DeleteMetadataResult {
- var res DeleteMetadataResult
- _, res.Err = perigee.Request("DELETE", metadataURL(client, id, key), perigee.Options{
+// UpdateMetadataOptsBuilder allows extensions to add additional parameters to the
+// Create request.
+type UpdateMetadataOptsBuilder interface {
+ ToMetadataUpdateMap() (map[string]interface{}, error)
+}
+
+// UpdateMetadata updates (or creates) all the metadata specified by opts for the given server ID.
+// This operation does not affect already-existing metadata that is not specified
+// by opts.
+func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts UpdateMetadataOptsBuilder) UpdateMetadataResult {
+ var res UpdateMetadataResult
+ metadata, err := opts.ToMetadataUpdateMap()
+ if err != nil {
+ res.Err = err
+ return res
+ }
+ _, res.Err = perigee.Request("POST", metadataURL(client, id), perigee.Options{
+ ReqBody: metadata,
+ Results: &res.Body,
+ MoreHeaders: client.AuthenticatedHeaders(),
+ })
+ return res
+}
+
+// MetadatumOptsBuilder allows extensions to add additional parameters to the
+// Create request.
+type MetadatumOptsBuilder interface {
+ ToMetadatumCreateMap() (map[string]interface{}, string, error)
+}
+
+// MetadatumOpts is a map of length one that contains a key-value pair.
+type MetadatumOpts map[string]string
+
+// ToMetadatumCreateMap assembles a body for a Create request based on the contents of a MetadataumOpts.
+func (opts MetadatumOpts) ToMetadatumCreateMap() (map[string]interface{}, string, error) {
+ if len(opts) != 1 {
+ return nil, "", errors.New("CreateMetadatum operation must have 1 and only 1 key-value pair.")
+ }
+ metadatum := map[string]interface{}{"meta": opts}
+ var key string
+ for k := range metadatum["meta"].(MetadatumOpts) {
+ key = k
+ }
+ return metadatum, key, nil
+}
+
+// CreateMetadatum will create or update the key-value pair with the given key for the given server ID.
+func CreateMetadatum(client *gophercloud.ServiceClient, id string, opts MetadatumOptsBuilder) CreateMetadatumResult {
+ var res CreateMetadatumResult
+ metadatum, key, err := opts.ToMetadatumCreateMap()
+ if err != nil {
+ res.Err = err
+ return res
+ }
+
+ _, res.Err = perigee.Request("PUT", metadatumURL(client, id, key), perigee.Options{
+ ReqBody: metadatum,
+ Results: &res.Body,
+ MoreHeaders: client.AuthenticatedHeaders(),
+ })
+ return res
+}
+
+// Metadatum requests the key-value pair with the given key for the given server ID.
+func Metadatum(client *gophercloud.ServiceClient, id, key string) GetMetadatumResult {
+ var res GetMetadatumResult
+ _, res.Err = perigee.Request("GET", metadatumURL(client, id, key), perigee.Options{
+ Results: &res.Body,
+ MoreHeaders: client.AuthenticatedHeaders(),
+ })
+ return res
+}
+
+// DeleteMetadatum will delete the key-value pair with the given key for the given server ID.
+func DeleteMetadatum(client *gophercloud.ServiceClient, id, key string) DeleteMetadatumResult {
+ var res DeleteMetadatumResult
+ _, res.Err = perigee.Request("DELETE", metadatumURL(client, id, key), perigee.Options{
Results: &res.Body,
MoreHeaders: client.AuthenticatedHeaders(),
})
diff --git a/openstack/compute/v2/servers/requests_test.go b/openstack/compute/v2/servers/requests_test.go
index 34b0c57..0343700 100644
--- a/openstack/compute/v2/servers/requests_test.go
+++ b/openstack/compute/v2/servers/requests_test.go
@@ -189,14 +189,48 @@
th.AssertEquals(t, "1234567890", adminPass)
}
+func TestGetMetadatum(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ HandleMetadatumGetSuccessfully(t)
+
+ expected := map[string]string{"foo": "bar"}
+ actual, err := Metadatum(client.ServiceClient(), "1234asdf", "foo").Extract()
+ th.AssertNoErr(t, err)
+ th.AssertDeepEquals(t, expected, actual)
+}
+
+func TestCreateMetadatum(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ HandleMetadatumCreateSuccessfully(t)
+
+ expected := map[string]string{"foo": "bar"}
+ actual, err := CreateMetadatum(client.ServiceClient(), "1234asdf", MetadatumOpts{"foo": "bar"}).Extract()
+ th.AssertNoErr(t, err)
+ th.AssertDeepEquals(t, expected, actual)
+}
+
+func TestDeleteMetadatum(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ HandleMetadatumDeleteSuccessfully(t)
+
+ err := DeleteMetadatum(client.ServiceClient(), "1234asdf", "foo").ExtractErr()
+ th.AssertNoErr(t, err)
+}
+
func TestGetMetadata(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
HandleMetadataGetSuccessfully(t)
- expected := map[string]string{"foo": "bar"}
- actual, err := Metadata(client.ServiceClient(), "1234asdf", "foo").Extract()
+ expected := map[string]string{"foo": "bar", "this": "that"}
+ actual, err := Metadata(client.ServiceClient(), "1234asdf").Extract()
th.AssertNoErr(t, err)
th.AssertDeepEquals(t, expected, actual)
}
@@ -207,42 +241,8 @@
HandleMetadataCreateSuccessfully(t)
- expected := map[string]string{"foo": "bar"}
- actual, err := CreateMetadata(client.ServiceClient(), "1234asdf", MetadataOpts{"foo": "bar"}).Extract()
- th.AssertNoErr(t, err)
- th.AssertDeepEquals(t, expected, actual)
-}
-
-func TestDeleteMetadata(t *testing.T) {
- th.SetupHTTP()
- defer th.TeardownHTTP()
-
- HandleMetadataDeleteSuccessfully(t)
-
- err := DeleteMetadata(client.ServiceClient(), "1234asdf", "foo").ExtractErr()
- th.AssertNoErr(t, err)
-}
-
-func TestGetMetadatas(t *testing.T) {
- th.SetupHTTP()
- defer th.TeardownHTTP()
-
- HandleMetadatasGetSuccessfully(t)
-
expected := map[string]string{"foo": "bar", "this": "that"}
- actual, err := Metadatas(client.ServiceClient(), "1234asdf").Extract()
- th.AssertNoErr(t, err)
- th.AssertDeepEquals(t, expected, actual)
-}
-
-func TestCreateMetadatas(t *testing.T) {
- th.SetupHTTP()
- defer th.TeardownHTTP()
-
- HandleMetadatasCreateSuccessfully(t)
-
- expected := map[string]string{"foo": "bar", "this": "that"}
- actual, err := CreateMetadatas(client.ServiceClient(), "1234asdf", MetadatasOpts{
+ actual, err := CreateMetadata(client.ServiceClient(), "1234asdf", MetadataOpts{
"foo": "bar",
"this": "that",
}).Extract()
@@ -250,14 +250,14 @@
th.AssertDeepEquals(t, expected, actual)
}
-func TestUpdateMetadatas(t *testing.T) {
+func TestUpdateMetadata(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
- HandleMetadatasUpdateSuccessfully(t)
+ HandleMetadataUpdateSuccessfully(t)
expected := map[string]string{"foo": "baz", "this": "those"}
- actual, err := UpdateMetadatas(client.ServiceClient(), "1234asdf", MetadatasOpts{
+ actual, err := UpdateMetadata(client.ServiceClient(), "1234asdf", MetadataOpts{
"foo": "baz",
"this": "those",
}).Extract()
diff --git a/openstack/compute/v2/servers/results.go b/openstack/compute/v2/servers/results.go
index 10c003a..d758fd3 100644
--- a/openstack/compute/v2/servers/results.go
+++ b/openstack/compute/v2/servers/results.go
@@ -168,27 +168,7 @@
return response.Servers, err
}
-// MetadatasResult contains the result of a call for (potentially) multiple key-value pairs.
-type MetadatasResult struct {
- gophercloud.Result
-}
-
-// GetMetadatasResult temporarily contains the response from a metadatas Get call.
-type GetMetadatasResult struct {
- MetadatasResult
-}
-
-// CreateMetadatasResult temporarily contains the response from a metadatas Create call.
-type CreateMetadatasResult struct {
- MetadatasResult
-}
-
-// UpdateMetadatasResult temporarily contains the response from a metadatas Update call.
-type UpdateMetadatasResult struct {
- MetadatasResult
-}
-
-// MetadataResult contains the result of a call for individual a single key-value pair.
+// MetadataResult contains the result of a call for (potentially) multiple key-value pairs.
type MetadataResult struct {
gophercloud.Result
}
@@ -203,23 +183,29 @@
MetadataResult
}
-// DeleteMetadataResult temporarily contains the response from a metadata Delete call.
-type DeleteMetadataResult struct {
- gophercloud.ErrResult
+// UpdateMetadataResult temporarily contains the response from a metadata Update call.
+type UpdateMetadataResult struct {
+ MetadataResult
}
-// Extract interprets any MetadatasResult as a Metadatas, if possible.
-func (r MetadatasResult) Extract() (map[string]string, error) {
- if r.Err != nil {
- return nil, r.Err
- }
+// MetadatumResult contains the result of a call for individual a single key-value pair.
+type MetadatumResult struct {
+ gophercloud.Result
+}
- var response struct {
- Metadatas map[string]string `mapstructure:"metadata"`
- }
+// GetMetadatumResult temporarily contains the response from a metadatum Get call.
+type GetMetadatumResult struct {
+ MetadatumResult
+}
- err := mapstructure.Decode(r.Body, &response)
- return response.Metadatas, err
+// CreateMetadatumResult temporarily contains the response from a metadatum Create call.
+type CreateMetadatumResult struct {
+ MetadatumResult
+}
+
+// DeleteMetadatumResult temporarily contains the response from a metadatum Delete call.
+type DeleteMetadatumResult struct {
+ gophercloud.ErrResult
}
// Extract interprets any MetadataResult as a Metadata, if possible.
@@ -229,9 +215,23 @@
}
var response struct {
- Metadata map[string]string `mapstructure:"meta"`
+ Metadata map[string]string `mapstructure:"metadata"`
}
err := mapstructure.Decode(r.Body, &response)
return response.Metadata, err
}
+
+// Extract interprets any MetadatumResult as a Metadatum, if possible.
+func (r MetadatumResult) Extract() (map[string]string, error) {
+ if r.Err != nil {
+ return nil, r.Err
+ }
+
+ var response struct {
+ Metadatum map[string]string `mapstructure:"meta"`
+ }
+
+ err := mapstructure.Decode(r.Body, &response)
+ return response.Metadatum, err
+}
diff --git a/openstack/compute/v2/servers/urls.go b/openstack/compute/v2/servers/urls.go
index a5e6576..4bc6586 100644
--- a/openstack/compute/v2/servers/urls.go
+++ b/openstack/compute/v2/servers/urls.go
@@ -30,10 +30,10 @@
return client.ServiceURL("servers", id, "action")
}
-func metadataURL(client *gophercloud.ServiceClient, id, key string) string {
+func metadatumURL(client *gophercloud.ServiceClient, id, key string) string {
return client.ServiceURL("servers", id, "metadata", key)
}
-func metadatasURL(client *gophercloud.ServiceClient, id string) string {
+func metadataURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL("servers", id, "metadata")
}
diff --git a/openstack/compute/v2/servers/urls_test.go b/openstack/compute/v2/servers/urls_test.go
index 1cdb210..17a1d28 100644
--- a/openstack/compute/v2/servers/urls_test.go
+++ b/openstack/compute/v2/servers/urls_test.go
@@ -55,14 +55,14 @@
th.CheckEquals(t, expected, actual)
}
-func TestMetadataURL(t *testing.T) {
- actual := metadataURL(endpointClient(), "foo", "bar")
+func TestMetadatumURL(t *testing.T) {
+ actual := metadatumURL(endpointClient(), "foo", "bar")
expected := endpoint + "servers/foo/metadata/bar"
th.CheckEquals(t, expected, actual)
}
-func TestMetadatasURL(t *testing.T) {
- actual := metadatasURL(endpointClient(), "foo")
+func TestMetadataURL(t *testing.T) {
+ actual := metadataURL(endpointClient(), "foo")
expected := endpoint + "servers/foo/metadata"
th.CheckEquals(t, expected, actual)
}