• Bare Metal Server

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

Modifying a BMS (Native OpenStack API)

Function

This interface is used to modify BMS information. Currently, only the name of the BMS can be changed.

URI

PUT /v2.1/{project_id}/servers/{server_id}

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

    server

    Dictionary data structure [1]

    Yes

    Specifies the BMS data structure.

    [1] server field data structure description

    Parameter

    Type

    Mandatory

    Description

    name

    String

    No

    Specifies the new BMS name.

  • Example request
    {
        "server": {
            "name": "new-server-test"
        }
    }

Response Message

  • Response parameters

    Parameter

    Type

    Description

    name

    String

    Specifies the BMS name.

    id

    String

    Specifies the unique ID of the BMS.

    status

    String

    Specifies the current status of the BMS.

    created

    String:DateTime

    Specifies the time when the BMS was created.

    updated

    String:DateTime

    Specifies the time when the BMS was last updated.

    flavor

    Dictionary data structure [2]

    Specifies the BMS flavor information.

    image

    Dictionary data structure [3]

    Specifies the BMS image.

    tenant_id

    String

    Specifies the ID of the tenant to which the BMS belongs.

    user_id

    String

    Specifies the ID of the user to which the BMS belongs.

    metadata

    Dictionary data structure [4]

    Specifies the data information about the editable key-value pair of the BMS.

    hostId

    String

    Specifies the host ID of the BMS.

    addresses

    Dictionary data structure [6]

    Specifies the BMS network address.

    links

    List data structure [5]

    Specifies the shortcut links of the BMS.

    accessIPv4

    String

    This is a reserved attribute.

    accessIPv6

    String

    This is a reserved attribute.

    OS-DCF:diskConfig

    String

    Specifies the disk configuration mode. This is an extended attribute.

    progress

    Integer

    This is a reserved attribute.

    [2] flavor field data structure description

    Parameter

    Type

    Description

    id

    String

    Specifies the flavor ID.

    links

    List data structure [5]

    Specifies the shortcut link of the BMS flavor.

    [3] image field data structure description

    Parameter

    Type

    Description

    id

    String

    Specifies the ID of the BMS image.

    links

    List data structure [5]

    Specifies the shortcut links of the BMS image.

    [4] 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.

    [5] links field data structure description

    Parameter

    Type

    Description

    rel

    String

    Specifies the shortcut link marker name.

    href

    String

    Specifies the corresponding shortcut link.

    [6] address field data structure description

    Parameter

    Type

    Description

    VPC ID

    List data structure [7]

    Specifies the ID of the VPC used by the BMS (the VPC name is a variable).

    The value in the data structure is assigned private IP addresses in the VPC.

    [7] VPC ID field data structure description

    Parameter

    Type

    Description

    addr

    String

    Specifies the IP address.

    version

    String

    Specifies the version of the IP address.

  • Example response
    {
        "server": {
            "tenant_id": "c685484a8cc2416b97260938705deb65",
            "image": {
                "links": [
                    {
                        "rel": "bookmark",
                        "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/images/1a6635d8-afea-4f2b-abb6-27a202bad319"
                    }
                ],
                "id": "1a6635d8-afea-4f2b-abb6-27a202bad319"
            },
            "accessIPv4": "",
            "addresses": {
                "08a7715f-7de6-4ff9-a343-95ba4209f24a": [
                    {
                        "addr": "192.168.0.107",
                        "version": 4
                    }
                ]
            },
            "metadata": {
                "op_svc_userid": "1311c433dd9b408886f57d695c229cbe"
            },
            "accessIPv6": "",
            "created": "2017-05-24T06:14:05Z",
            "hostId": "e9c3ee0fcc58ab6085cf30df70b5544eab958858fb50d925f023e53e",
            "flavor": {
                "links": [
                    {
                        "rel": "bookmark",
                        "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/flavors/physical.83.medium"
                    }
                ],
                "id": "physical.83.medium"
            },
            "OS-DCF:diskConfig": "MANUAL",
            "user_id": "1311c433dd9b408886f57d695c229cbe",
            "name": "new-server-test",
            "progress": 0,
            "links": [
                {
                    "rel": "self",
                    "href": "https://openstack.example.com/v2/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd"
                },
                {
                    "rel": "bookmark",
                    "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd"
                }
            ],
            "id": "95bf2490-5428-432c-ad9b-5e3406f869dd",
            "updated": "2017-05-25T03:40:25Z",
            "status": "ACTIVE"
        }
    }

Returned Values

See section Common Returned Values.