• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Lifecycle Management
  6. Modifying ECS Information

Modifying ECS Information

Function

This API is used to modify ECS information. Only the name and description of an ECS can be modified.

URI

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

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

server_id

Yes

Specifies the ECS ID.

Request

Request parameters

Table 2 describes the request parameters.
Table 2 Request parameters

Parameter

Mandatory

Type

Description

server

Yes

Dictionary data structure

Specifies the ECS data structure. For details, see Table 3.

Table 3 server field description

Parameter

Mandatory

Type

Description

name

No

String

Specifies the name of the modified ECS.

The length is greater than 0 and less than 256

description

No

String

Describes the ECS. The value contains a maximum of 255 bytes.

This field is newly added in version 2.19.

Response

Response parameters

Table 4 describes the response parameters.

Table 4 Response parameters

Parameter

Type

Description

servers

List data structure

Specifies ECSs.

Table 5 servers field description

Parameter

Type

Description

tenant_id

String

Specifies the tenant or project ID.

image

String

Specifies the image ID.

accessIPv4

String

Reserved

addresses

List data structure

Specifies the network addresses of an ECS. For details, see Table 6.

metadata

List data structure

Specifies the ECS metadata.

accessIPv6

String

Reserved

created

String:DateTime

Specifies the time when the ECS was created. The time is in the format of "2019-05-22T03:19:19Z".

hostId

String

Specifies the host ID of the ECS.

flavor

List data structure

Specifies the ECS flavor.

OS-DCF:diskConfig

String

Specifies the disk configuration mode. This is an extended attribute. This field is valid for the ECS started using an image.

user_id

String

Specifies the ID of the user to which an ECS belongs.

name

String

Specifies the name of the modified ECS.

progress

Integer

Reserved

links

List data structure

Specifies ECS shortcut links. For details, see Table 9.

id

String

Specifies the unique ID of an ECS.

updated

String:DateTime

Specifies the time when the ECS was updated last time.

The time is in the format of "2019-05-22T03:19:19Z".

status

String

Specifies the ECS status.

Options:

ACTIVE, BUILD, ERROR, HARD_REBOOT, MIGRATING, REBOOT, RESIZE, REVERT_RESIZE, SHELVED, SHELVED_OFFLOADED, SHUTOFF, UNKNOWN, and VERIFY_RESIZE

Table 6 addresses field description

Parameter

Type

Description

Name of the network where the ECS accesses

List data structure

Specifies the network information of the ECS.

  • key indicates the network name, for example, demo_net.
  • value indicates the detailed network information.

For details, see Table 7.

Table 7 Data structure of the network which an ECS accesses

Parameter

Type

Description

addr

String

Specifies the IP address.

version

Integer

Specifies the type of an IP address. The value of this parameter can be 4 or 6.

  • 4: The type of the IP address is IPv4.
  • 6: The type of the IP address is IPv6.
Table 8 flavor field description

Parameter

Type

Description

id

String

Specifies the ECS ID.

links

List data structure

Specifies shortcut links for ECS types. For details, see Table 9.

Table 9 links field description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name.

href

String

Specifies the shortcut link.

Examples

  • Example request
    {
        "server": {
            "name": "new-server-test"
        }
    }
  • Example response
    {
        "server": {
        "tenant_id": "7910a6e50b80402ba028c8d96c1b31fe",
        "image": "",
            "accessIPv4": "", 
        "addresses": {
          "03be5c1e-e05d-4905-a105-c3bd9b730bdc": [
            {
              "addr": "192.168.0.72",
              "version": 4
            }
          ]
        },
        "metadata": {},
            "accessIPv6": "", 
        "created": "2018-05-17T03:15:48Z",
        "hostId": "7dc82f6b1d406200fc63e395cf4829cbffcb49de0e9c75c5773f201f",
            "flavor": {
          "links": [
            {
              "rel": "bookmark",
              "href": "https://None/7910a6e50b80402ba028c8d96c1b31fe/flavors/c3.1U1G"
            }
          ],
          "id": "c3.1U1G"
        },
        "OS-DCF:diskConfig": "MANUAL",
        "user_id": "d698a78532ca430f8daec1858f2b500e",
            "name": "new-server-test", 
            "progress": 0, 
        "links": [
          {
            "rel": "self",
            "href": "https://None/v2/7910a6e50b80402ba028c8d96c1b31fe/servers/1a19ef4f-be0a-4526-bf2f-14b4464d536a"
          },
          {
            "rel": "bookmark",
            "href": "https://None/7910a6e50b80402ba028c8d96c1b31fe/servers/1a19ef4f-be0a-4526-bf2f-14b4464d536a"
          }
        ],
        "id": "1a19ef4f-be0a-4526-bf2f-14b4464d536a",
        "updated": "2018-05-21T00:36:27Z",
        "status": "ACTIVE"
      }
    }

Returned Values

See General Request Returned Values.