Setting Server Metadata

Server metadata is stored in the metadata dictionary, which is a part of each image description. It doesn't have to be set to anything, but it is often used to add a more detailed description of the image's purpose than a terse name of the image.

Server metadata can be set at server creation time or later. When you want to do it after you create your server, you need to use the PUT method and a URL with a three-part path, /servers/id/metadata.

The id part is the numeric id of the server. For example, if you wanted to set the owner metadata key of the server whose id is 1, the path would be /servers/1/metadata.

If you were to use curl to set metadata keys, this is how you'd do it:

$ curl -X PUT -H "X-Auth-Token:999888777666" -H "Accept: application/json" -d '{"metadata":{"owner":"joe","group":"www"}}' http://localhost:8774/v1.1/openstack/servers/1/metadata


loading table of contents...