Description

Replaces items that match the specified keys and does not modify items not specified in the request

Specify the key and value for the metadata. The metadatas you are not choosing this time will be remained.

Request URL

Compute API v2.0

POST /v2/​{tenant_id}​/servers/​{server_id}​/metadata

Request Paramters

Parameter Value Style Description
X-Auth-Token User Token header
tenant_id URI
server_id Server ID URI
instance_name_tag Server Name Tag plain

Request Json

{
    "metadata": {
        "instance_name_tag": "gmo-vm001"
    }
}

Normal response codes

200

Example

curl -i -X POST \
-H "Accept: application/json" \
-H "X-Auth-Token: 35941e7df872405d84e5b026dba8323c" \
-d '{"metadata": {"instance_name_tag": "gmo-vm001"}}' \
https://compute.tyo1.cloud.z.com/v2/1864e71d2deb46f6b47526b69c65a45d/servers/e25b3611-96df-4514-a54b-7729aec48dc1/metadata
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 57
X-Compute-Request-Id: req-0f1d296a-dc60-4dfe-8e9d-da95fff32093
Date: Mon, 09 Feb 2015 07:54:30 GMT

{
    "metadata": {
        "backup_id": "",
        "backup_set": "0",
        "backup_status": "active",
        "instance_name_tag": "gmo-vm001",
        "properties": "{\"vnc_keymap\":\"ja\",\"hw_video_model\":\"vga\",\"hw_vif_model\":\"virtio\",\"hw_disk_bus\":\"virtio\",\"cdrom_path\":\"\"}"
    }
}