• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. API Reference
  4. API
  5. BMS Status Management (Native OpenStack APIs)
  6. Updating BMS Metadata (Native OpenStack API)

Updating BMS Metadata (Native OpenStack API)

Function

This interface is used to update BMS metadata.

  • If the metadata does not contain the target field, the field is automatically added to the field.
  • If the metadata contains the target field, the field value is automatically updated.

Constraints

The BMS OS-EXT-STS:vm_state attribute (BMS status) must be active, stopped, paused, or suspended.

URI

POST /v2.1/{project_id}/servers/{server_id}/metadata

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

server_id

Yes

Specifies the BMS ID.

Request Message

  • Request parameters

    Parameter

    Type

    Mandatory

    Description

    metadata

    Dictionary data structure [1]

    Yes

    Specifies the user-defined metadata key and value pair.

    [1] metadata field data structure description

    Parameter

    Type

    Mandatory

    Description

    User-defined field key and value pair

    String

    Yes

    Specifies the user-defined metadata key and value pair.

    • The maximum size for each metadata key and value pair is 255 bytes.
    • The key does not support the following special characters:

      :`~!@#$%^&*()=+<,>?/'";{[]}|\

    • The value does not support the following special characters:

      \"

  • Example request
    {
        "metadata": {
            "key": "value"
        }
        }

Response Message

  • Response parameters

    Parameter

    Type

    Description

    metadata

    Dictionary data structure [2]

    Specifies the user-defined metadata key and value pair.

    [2] metadata field data structure description

    Parameter

    Type

    Description

    User-defined field key and value pair

    String

    Specifies the key and value pair of the metadata.

    • The maximum size for each metadata key and value pair is 255 bytes.
    • The value does not support the following special characters:

      \"

  • Example response
    {
        "metadata": {
            "key": "value"
        }
        }

Returned Values

See section Common Returned Values.