This API is used to update ECS metadata.
An ECS must be in active, stopped, paused, or suspended state, which is specified by OS-EXT-STS:vm_state.
POST /v1/{project_id}/cloudservers/{server_id}/metadata
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. |
server_id |
Yes |
Specifies the ECS ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
metadata |
Yes |
Object |
Specifies the user-defined metadata key-value pair. The data structure can be empty. If the value is empty, data is not updated. For a metadata tag: It contains a maximum of 255 Unicode characters and cannot be left blank. A tag can contain uppercase letters (A-Z), lowercase letters (a-z), digits (0-9), hyphens (-), underscores (_), colons (:), and periods (.). For a metadata value: It contains a maximum of 255 Unicode characters. |
Parameter |
Type |
Description |
---|---|---|
metadata |
Object |
Specifies the user-defined metadata key-value pair. |
POST https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/metadata
{ "metadata": { "key": "value" } }
{ "metadata":{ "key":"value" } }