El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Changing a BMS Name

Updated on 2024-10-22 GMT+08:00

Function

This API is used to change the name of a BMS.

Constraints

The new name must meet the following requirements:

Contain 1 to 63 characters, consisting of letters (case-insensitive), digits, underscores (_), hyphens (-), and periods (.).

NOTE:

This API can only be used to change the BMS name. The hostname will not be changed. The new name takes effect after the BMS is restarted.

URI

PUT /v1/{project_id}/baremetalservers/{server_id}

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the project ID, see Obtaining a Project ID.

server_id

Yes

Specifies the BMS ID.

You can obtain the BMS ID from the BMS console or by calling the Querying BMSs (Discarded).

Request Parameters

Parameter

Mandatory

Type

Description

server

Yes

Object

Specifies the BMS data structure. For details, see Table 2.

Table 2 server field data structure description

Parameter

Mandatory

Type

Description

name

Yes

String

Specifies the new BMS name.

Example Request

Changing the name of a BMS (ID: 95bf2490-5428-432c-ad9b-5e3406f869dd) to new-server-test
1
PUT https://{BMS Endpoint}/v1/c685484a8cc2416b97260938705deb65/baremetalservers/95bf2490-5428-432c-ad9b-5e3406f869dd
1
2
3
4
5
6
{
  "server":
    {
      "name": "new-server-test"
    }
}

Response Parameters

Parameter

Type

Description

server

Object

Specifies BMS information. For details, see Table 3.

Table 3 server field data structure description

Parameter

Type

Description

name

String

Specifies the BMS name.

id

String

Specifies the unique ID of the BMS.

status

String

Specifies the BMS status.

  • ACTIVE: Running, Stopping, Deleting
  • BUILD: Creating
  • ERROR: Faulty
  • HARD_REBOOT: Forcibly Restarting
  • REBOOT: Restarting
  • SHUTOFF: Stopped, Starting, Deleting, Rebuilding, Reinstalling OS, OS Reinstallation Failed, Frozen

created

String

Specifies the time when the BMS was created.

The timestamp format is YYYY-MM-DDTHH:MM:SSZ (ISO 8601), for example, 2019-05-22T03:30:52Z.

updated

String

Specifies the time when the BMS was last updated.

The timestamp format is YYYY-MM-DDTHH:MM:SSZ (ISO 8601), for example, 2019-05-22T04:30:52Z.

flavor

Object

Specifies the BMS flavor. For details, see Table 6.

image

Object

Specifies the BMS image. For details, see Table 7.

tenant_id

String

Specifies the ID of the tenant owning the BMS. The value is in UUID format.

This parameter specifies the same meaning as project_id.

key_name

String

Specifies the SSH key name.

user_id

String

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

metadata

Object

Specifies the BMS metadata.

The structure is Map<String, Object>.

For details, see Table 9.

hostId

String

Specifies the host ID of the BMS.

addresses

Object

Specifies BMS network addresses.

The structure is Map<String, Object>.

For details, see Table 10.

security_groups

Array of objects

Specifies the security groups to which the BMS belongs. For details, see Table 12.

links

Array of objects

Specifies shortcut links of the BMS. For details, see Table 8.

OS-DCF:diskConfig

String

Specifies the disk configuration method. This is an extended attribute. The value can be:

  • MANUAL: The API uses the partitioning scheme in the image and the file system to create a BMS. If the target flavor has a large disk, the API does not partition the remaining disk space.
  • AUTO: The API uses a single partition with the same size as the disk of the target flavor to create a BMS. The API automatically adjusts the file system to adapt to the entire partition.

OS-EXT-AZ:availability_zone

String

Specifies the AZ where the BMS is located.

OS-EXT-SRV-ATTR:host

String

Specifies the hostname of the BMS. This is an extended attribute.

OS-EXT-SRV-ATTR:hypervisor_hostname

String

Specifies the hostname of the hypervisor.

OS-EXT-SRV-ATTR:instance_name

String

Specifies the BMS alias. This is an extended attribute.

OS-EXT-STS:power_state

Integer

Specifies the BMS power status. This is an extended attribute. Examples:

  • 0: indicates NO STATE.
  • 1: indicates RUNNING.
  • 4: indicates SHUTDOWN.

OS-EXT-STS:task_state

String

Specifies the BMS task status. This is an extended attribute. Examples:

  • rebooting: The BMS is being restarted.
  • reboot_started: The BMS is normally restarted.
  • reboot_started_hard: The BMS is forcibly restarted.
  • powering-off: The BMS is being powered off.
  • powering-on: The BMS is being powered on.
  • rebuilding: The BMS is being rebuilt.
  • scheduling: The BMS is being scheduled.
  • deleting: The BMS is being deleted.

OS-EXT-STS:vm_state

String

Specifies the BMS status. This is an extended attribute. Examples:

  • active: The BMS is running.
  • stopped: The BMS is stopped.

OS-SRV-USG:launched_at

String

Specifies the time when the BMS was started. This is an extended attribute.

The timestamp format is ISO 8601, for example, 2019-05-25T03:40:25.000000.

OS-SRV-USG:terminated_at

String

Specifies the time when the BMS was stopped. This is an extended attribute.

The timestamp format is ISO 8601, for example, 2019-06-25T03:40:25.000000.

os-extended-volumes:volumes_attached

Array of objects

Specifies the EVS disks attached to the BMS. For details, see Table 13.

accessIPv4

String

This is a reserved attribute.

accessIPv6

String

This is a reserved attribute.

fault

Object

Specifies the cause of a BMS fault. For details, see Table 14.

config_drive

String

This is a reserved attribute.

progress

Integer

This is a reserved attribute.

description

String

Specifies BMS information.

host_status

String

Specifies the status of the host that accommodates the BMS.

  • UP: The nova-compute status is normal.
  • UNKNOWN: The nova-compute status is unknown.
  • DOWN: the nova-compute status is abnormal.
  • MAINTENANCE: The nova-compute is in the maintenance state.
  • Empty string: The BMS does not have host information.

OS-EXT-SRV-ATTR:hostname

String

Specifies the hostname of the BMS.

OS-EXT-SRV-ATTR:reservation_id

String

Specifies the reserved BMS IDs in a batch creation situation.

When BMSs are created in a batch, they have the same reservation_id.

OS-EXT-SRV-ATTR:launch_index

Integer

Specifies the BMS startup sequence in a batch creation situation.

OS-EXT-SRV-ATTR:kernel_id

String

Specifies the UUID of the kernel image when the AMI image is used. In other scenarios, leave this parameter blank.

OS-EXT-SRV-ATTR:ramdisk_id

String

Specifies the UUID of the Ramdisk image when the AMI image is used. In other scenarios, leave this parameter blank.

OS-EXT-SRV-ATTR:root_device_name

String

Specifies the device name of the BMS system disk, for example, /dev/sdb.

OS-EXT-SRV-ATTR:user_data

String

Specifies the user_data specified during BMS creation. The value is encoded using Base64 or an empty string.

locked

Boolean

Specifies whether the BMS is locked.

  • true: The BMS is locked.
  • false: The BMS is not locked.

tags

Array of strings

Specifies tags of the BMS.

sys_tags

Array of objects

Specifies system tags of the BMS. For details, see Table 4.

enterprise_project_id

String

Specifies the enterprise project ID.

os:scheduler_hints

Object

Specifies the BMS scheduling information. For details, see Table 5.

Table 4 sys_tags field data structure description

Parameter

Type

Description

key

String

Specifies the system tag key.

value

String

Specifies the system tag value.

Table 5 os:scheduler_hints field data structure description

Parameter

Type

Description

group

Array of strings

Specifies the BMS group ID in UUID format.

Table 6 flavor field data structure description

Parameter

Type

Description

id

String

Specifies the flavor ID.

links

Array of objects

Specifies shortcut links of the flavor. For details, see Table 8.

Table 7 image field data structure description

Parameter

Type

Description

id

String

Specifies the image ID of the BMS.

links

Array of objects

Specifies shortcut links of the BMS image. For details, see Table 8.

Table 8 links field data structure description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name. The value can be:

  • self: resource link that contains the version number. It is used when immediate tracing is required.
  • bookmark: resource link that can be stored for a long time.

href

String

Specifies the corresponding shortcut link.

Table 9 metadata field data structure description

Parameter

Type

Description

key

String

Specifies the key and value pair of the metadata.

Each key or value contains a maximum of 255 characters.

Table 10 addresses field data structure description

Parameter

Type

Description

vpc_id

Array of objects

Specifies the VPC used by the BMS.

  • key: indicates the ID of the VPC used by the BMS.
  • value: indicates the VPC details. For details, see Table 11.
Table 11 address field data structure description

Parameter

Type

Description

addr

String

Specifies the IP address.

version

Integer

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

  • 4: The type of the IP address is IPv4.
  • 6: The type of the IP address is IPv6.

OS-EXT-IPS-MAC:mac_addr

String

Specifies the MAC address. This is an extended attribute.

OS-EXT-IPS:type

String

Specifies the IP address assignment mode. This is an extended attribute.

OS-EXT-IPS:port_id

String

Specifies the port ID corresponding to the IP address.

Table 12 security_groups field data structure description

Parameter

Type

Description

name

String

  • If no security group is specified during BMS creation, the default value is used.
  • When creating a BMS, you need to specify the ID of an existing security group (in UUID format).
Table 13 os-extended-volumes:volumes_attached field data structure description

Parameter

Type

Description

id

String

Specifies the EVS disk ID.

delete_on_termination

Boolean

Specifies whether to delete the disk when deleting the BMS.

  • true: Yes
  • false: No
Table 14 fault field data structure description

Parameter

Type

Description

message

String

Specifies the fault information.

code

Integer

Specifies the fault code.

details

String

Specifies the fault details.

created

String

Specifies the time when a fault occurred.

The timestamp format is YYYY-MM-DDTHH:MM:SSZ (ISO 8601), for example, 2019-05-22T03:30:52Z.

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{ 
     "server": { 
         "tenant_id": "c685484a8cc2416b97260938705deb65", 
         "addresses": { 
             "08a7715f-7de6-4ff9-a343-95ba4209f24a": [  
                 { 
                     "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:0e:c4:77", 
                     "OS-EXT-IPS:type": "fixed",
                     "OS-EXT-IPS:port_id": "0c111191-9785-49e6-8b42-66ef2802bd8f",
                     "addr": "192.168.0.107", 
                     "version": 4 
                 } 
             ] 
         }, 
         "metadata": { 
             "op_svc_userid": "1311c433dd9b408886f57d695c229cbe" 
         }, 
         "OS-EXT-STS:task_state": null, 
         "OS-DCF:diskConfig": "MANUAL", 
         "OS-EXT-AZ:availability_zone": "az-dc-1", 
         "links": [ 
             { 
                 "rel": "self", 
                 "href": "https://bms.az0.dc1.domainname.com/v2.1/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd" 
             }, 
             { 
                 "rel": "bookmark", 
                 "href": "https://bms.az0.dc1.domainname.com/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd" 
             } 
         ], 
         "OS-EXT-STS:power_state": 1, 
         "id": "95bf2490-5428-432c-ad9b-5e3406f869dd", 
         "os-extended-volumes:volumes_attached": [ 
             { 
                 "id": "dfa375b5-9856-44ad-a937-a4802b6434c3" 
             }, 
             { 
                 "id": "bb9f1b27-843b-4561-b62e-ca18eeaec417" 
             }, 
             { 
                 "id": "86e801c3-acc6-465d-890c-d43ba493f553" 
             }, 
             { 
                 "id": "0994d3ac-3c6a-495c-a439-c597a4f08fa6" 
             } 
         ], 
         "OS-EXT-SRV-ATTR:host": "bms.az-dc-1", 
         "image": { 
             "links": [ 
                 { 
                     "rel": "bookmark", 
                     "href": "https://bms.az0.dc1.domainname.com/c685484a8cc2416b97260938705deb65/images/1a6635d8-afea-4f2b-abb6-27a202bad319" 
                 } 
             ], 
             "id": "1a6635d8-afea-4f2b-abb6-27a202bad319" 
         }, 
         "OS-SRV-USG:terminated_at": null, 
         "accessIPv4": "", 
         "accessIPv6": "", 
         "created": "2017-05-24T06:14:05Z", 
         "hostId": "e9c3ee0fcc58ab6085cf30df70b5544eab958858fb50d925f023e53e", 
         "OS-EXT-SRV-ATTR:hypervisor_hostname": "nova004@2", 
         "key_name": "$key_name", 
         "flavor": { 
             "links": [ 
                 { 
                     "rel": "bookmark", 
                     "href": "https://bms.az0.dc1.domainname.com/c685484a8cc2416b97260938705deb65/flavors/physical.83.medium" 
                 } 
             ], 
             "id": "physical.83.medium" 
         }, 
         "security_groups": [ 
             { 
                 "name": "0011b620-4982-42e4-ad12-47c95ca495c4" 
             } 
         ], 
         "config_drive": "", 
         "OS-EXT-STS:vm_state": "active", 
         "OS-EXT-SRV-ATTR:instance_name": "instance-0000ebd3", 
         "user_id": "1311c433dd9b408886f57d695c229cbe", 
         "name": "bms-83", 
         "progress": 0, 
         "OS-SRV-USG:launched_at": "2017-05-25T03:40:25.066078", 
         "updated": "2017-05-25T03:40:25Z", 
         "status": "ACTIVE" 
     } 
 }

Returned Values

Normal values

Returned Values

Description

200

The request has been successfully processed.

For details about other returned values, see Status Codes.

Error Codes

See Error Codes.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback