Bare Metal Server (BMS) 8.3.0 Usage Guide (for Huawei Cloud Stack 8.3.0) 02

Дата выпуска:2023-10-27
Просмотры:1734
Загрузки:283
№ документа:EDOC1100326708
Bare Metal Server (BMS)
8.3.0
API Reference


Issue 02
Date 2023-10-26


HUAWEI CLOUD COMPUTING TECHNOLOGIES CO., LTD.


Copyright © Huawei Cloud Computing Technologies Co., Ltd. 2023. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any means without prior
written consent of Huawei Cloud Computing Technologies Co., Ltd.

Trademarks and Permissions

and other Huawei trademarks are the property of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.

Notice
The purchased products, services and features are stipulated by the contract made between Huawei
Cloud and the customer. All or part of the products, services and features described in this document may
not be within the purchase scope or the usage scope. Unless otherwise specified in the contract, all
statements, information, and recommendations in this document are provided "AS IS" without
warranties, guarantees or representations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.






Huawei Cloud Computing Technologies Co., Ltd.

Address: Huawei Cloud Data Center Jiaoxinggong Road
Qianzhong Avenue
Gui'an New District
Gui Zhou 550029
People's Republic of China

Website: https://www.huaweicloud.com/intl/en-us/


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. i
Bare Metal Server (BMS)
API Reference About This Document


About This Document

Overview
This document describes application programming interfaces (APIs) of the Bare
Metal Server (BMS) service.

Intended Audience
This document is intended for:
● Technical support engineers
● Secondary development engineers
● Maintenance engineers

Symbol Conventions
Symbols that may be referred to in this document are defined as follows.

Symbol Description

Indicates a hazard with a high level of risk which, if not
avoided, could result in death or serious injury.

Indicates a hazard with a medium level of risk which, if not
avoided, could result in death or serious injury.

Indicates a hazard with a low level of risk which, if not
avoided, could result in minor or moderate injury.

Indicates a potentially hazardous situation which, if not
avoided, could result in equipment damage, data loss,
performance deterioration, or other unanticipated results.
NOTICE is used to address practices not related to personal
injury.

Calls attention to important information, best practices, and
tips.
NOTE is used to address information not related to personal
injury, equipment damage, and environment deterioration.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. ii
Bare Metal Server (BMS)
API Reference About This Document



Change History

Issue Date Change Description

02 2023-10-26 This issue is the second official release.

01 2023-09-22 This issue is the first official release.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. iii
Bare Metal Server (BMS)
API Reference Contents


Contents


About This Document................................................................................................................ ii
1 Before You Start....................................................................................................................... 1
1.1 Overview.................................................................................................................................................................................... 1
1.2 API Calling Description.......................................................................................................................................................... 1
1.3 API Server Address.................................................................................................................................................................. 1
1.4 Constraints................................................................................................................................................................................. 2
1.5 Basic Concepts.......................................................................................................................................................................... 2
2 API Introduction.......................................................................................................................4
2.1 API Overview.............................................................................................................................................................................4
2.2 Fine-Grained Actions.............................................................................................................................................................. 4
3 API Calling.................................................................................................................................7
3.1 Making an API Request......................................................................................................................................................... 7
3.2 Authentication....................................................................................................................................................................... 10
3.3 Obtaining a Project ID.........................................................................................................................................................14
3.4 Response.................................................................................................................................................................................. 15
4 API Reference......................................................................................................................... 17
4.1 BMS Lifecycle Management..............................................................................................................................................17
4.1.1 Creating a BMS.................................................................................................................................................................. 17
4.1.2 Deleting a BMS.................................................................................................................................................................. 30
4.1.3 Querying BMSs (Community-Compatible API).......................................................................................................34
4.1.4 Querying Details About BMSs (Community-Compatible API).......................................................................... 38
4.2 BMS Status Management.................................................................................................................................................. 43
4.2.1 Stopping a BMS..................................................................................................................................................................43
4.2.2 Restarting a BMS............................................................................................................................................................... 47
4.2.3 Starting a BMS................................................................................................................................................................... 51
4.3 BMS Flavor Query.................................................................................................................................................................54
4.3.1 Querying BMS Flavors..................................................................................................................................................... 54
4.4 BMS NIC Management....................................................................................................................................................... 59
4.4.1 Creating a High-Speed Network.................................................................................................................................. 59
4.4.2 Querying High-Speed Networks.................................................................................................................................. 63
4.4.3 Modifying a High-Speed Network...............................................................................................................................67
4.4.4 Deleting a High-Speed Network.................................................................................................................................. 71

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. iv
Bare Metal Server (BMS)
API Reference Contents

4.4.5 Adding a NIC....................................................................................................................................................................... 73
4.4.6 Deleting a NIC.................................................................................................................................................................... 77
4.4.7 Querying NICs of a BMS (Community-Compatible API)..................................................................................... 81
4.4.8 Modifying a High-Speed Network (v2)..................................................................................................................... 84
4.4.9 Creating an IPv6 Subnet for a High-Speed Network............................................................................................ 88
4.4.10 Deleting an IPv6 Subnet from a High-Speed Network......................................................................................93
4.4.11 Querying Information About a Specified BMS NIC (Community-Compatible API).................................95
4.5 BMS Disk Management...................................................................................................................................................... 98
4.5.1 Attaching an EVS Disk..................................................................................................................................................... 98
4.5.2 Detaching an EVS Disk..................................................................................................................................................102
4.5.3 Attaching Shared EVS Disks in Batches...................................................................................................................105
4.5.4 Querying Disks of a BMS (Community-Compatible API)................................................................................. 109
4.5.5 Querying Information About a Disk Attached to a BMS (Community-Compatible API)...................... 111
4.6 BMS SSH Key Pair Management...................................................................................................................................113
4.6.1 Creating and Importing an SSH Key Pair (Community-Compatible API)................................................... 113
4.6.2 Querying SSH Key Pairs (Community-Compatible API).................................................................................... 117
4.6.3 Querying an SSH Key Pair (Community-Compatible API)................................................................................119
4.6.4 Deleting an SSH Key Pair (Community-Compatible API)................................................................................. 121
4.7 BMS Tag Management..................................................................................................................................................... 123
4.7.1 Creating Tags for a BMS (Community-Compatible API)...................................................................................123
4.7.2 Deleting Tags of a BMS (Community-Compatible API).................................................................................... 125
4.7.3 Querying Tags of a BMS (Community-Compatible API)...................................................................................127
4.7.4 Deleting a Specified Tag of a BMS (Community-Compatible API)............................................................... 129
4.7.5 Checking for a Specified Tag on a BMS (Community-Compatible API)...................................................... 131
4.7.6 Adding a Tag to a Specified BMS (Community-Compatible API).................................................................. 133
4.8 Job Status Query.................................................................................................................................................................135
4.8.1 Querying Job Status....................................................................................................................................................... 135
5 API Changes..........................................................................................................................140
5.1 Change History.................................................................................................................................................................... 140
5.1.1 Huawei Cloud Stack 8.3.0............................................................................................................................................ 140
5.2 Deprecation Plan................................................................................................................................................................ 140


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. v
Bare Metal Server (BMS)
API Reference 1 Before You Start


1 Before You Start


1.1 Overview
Bare Metal Server (BMS) is a way of provisioning dedicated physical servers for
tenants. It provides the excellent computing performance and data security
needed for core databases, key application systems, and high-performance
computing (HPC). With the high scalability offered by cloud resources, you can
apply for and use BMSs flexibly.
This document describes how to use application programming interfaces (APIs) to
perform operations on Bare Metal Servers (BMSs), such as creating, deleting, and
querying BMSs. For details about all supported operations, see 2.1 API Overview.

1.2 API Calling Description
BMS supports Representational State Transfer (REST) APIs, allowing you to call
APIs using HTTPS. For details about API calling, see 3 API Calling.

1.3 API Server Address
An API server address consists of the service name, region ID, and external domain
name. The format is as follows:
service_name.region0_id.external_global_domain_name. Table 1-1 describes
information about these parameters.

Table 1-1 API server address information
Parameter Description How to Obtain

service_name Case-insensitive service Use the default value
name abbreviation bms.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 1
Bare Metal Server (BMS)
API Reference 1 Before You Start

Parameter Description How to Obtain

region0_id Region ID Contact the
administrator to obtain
the region ID by
searching for region0_id
on the
"Basic_Parameters" sheet
in the
xxx_export_all_v2_EN.xl
sx file generated by HCC
Turnkey.

external_global_domain_ External domain name Contact the
name suffix administrator to obtain
this parameter value by
searching for
external_global_domain
_name on the
"Basic_Parameters" sheet
in the
xxx_export_all_v2_EN.xl
sx file generated by HCC
Turnkey.



1.4 Constraints

For detailed constraints, see the constraints described in each API.

1.5 Basic Concepts

● Account
An account is an entity that owns and pays for cloud resources. An account
can access all of its own resources without any restrictions.
● User
A user is one who utilizes cloud services, including employees, systems, and
applications. For authentication, each user must provide its identity
information and account name when using a password, token, or access key.
● Region
A region is a collection of resources divided by geographic location.
Permissions can be granted to users of specific regions.
● Availability zone (AZ)
An AZ is a physical region where resources use independent power supply and
networks. An AZ is generally an independent physical equipment room,
ensuring independence of the AZ. A region has multiple AZs. The failure of
one AZ does not affect other AZs in the region. AZs are connected over
Intranet.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 2
Bare Metal Server (BMS)
API Reference 1 Before You Start

● Resource space
A resource space is a collection of resources. Resource spaces are isolated
from each other and can be assigned to specific users.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 3
Bare Metal Server (BMS)
API Reference 2 API Introduction


2 API Introduction


2.1 API Overview

Table 2-1 provides an overview of BMS APIs.

Table 2-1 APIs

API Description

4.1 BMS Lifecycle Management APIs for creating, deleting, and querying
BMSs

4.2 BMS Status Management APIs for stopping, restarting, and
starting BMSs

4.3 BMS Flavor Query API for querying BMS flavors

4.4 BMS NIC Management APIs such as those for creating, querying,
and deleting high-speed networks

4.5 BMS Disk Management APIs such as those for attaching,
detaching, and querying EVS disks

4.6 BMS SSH Key Pair APIs such as those for creating, querying,
Management and deleting SSH key pairs of BMSs

4.7 BMS Tag Management APIs such as those for creating, querying,
and deleting BMS tags

4.8 Job Status Query API for querying the execution status of
a job



2.2 Fine-Grained Actions

This section describes how to use Identity and Access Management (IAM) for fine-
grained permissions control. By default, new IAM users do not have any

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 4
Bare Metal Server (BMS)
API Reference 2 API Introduction

permissions assigned. To assign permissions to these new users, add them to one
or more groups, and attach permissions policies or roles to these groups.
You can grant users permissions by using roles and policies. Roles are a type of
coarse-grained authorization mechanism that defines permissions related to user
responsibilities. Policies define API-based permissions for operations, allowing for
more fine-grained, secure access control of cloud resources.

NO TE

Policy-based authorization is useful if you want to allow or deny the access to an API.
If you use an IAM user under your account to call an API, the IAM user must have
the required permissions specifically assigned. The permissions required for calling
an API are determined by the actions supported by the API. Only users who have
been granted permissions allowing the actions can call the API successfully.

Supported Actions
There are system-defined policies that can be directly used. You can also create
custom policies and use them to supplement system-defined policies for more
refined access control. Operations supported by policies are specific to APIs. The
following are common concepts related to policies:
● Permissions: statements in a policy that allow or deny certain operations
● APIs: REST APIs that can be called in a custom policy
● Actions: specific operations that are allowed or denied in a custom policy
For details about actions supported in a custom policy, see Table 2-2.

Table 2-2 Fine-grained APIs

API Description

4.1.1 Creating a BMS API for creating one or more BMSs

4.1.2 Deleting a BMS API for deleting BMSs with specified
IDs

4.2.1 Stopping a BMS API for stopping one or more BMSs
with specified IDs

4.2.2 Restarting a BMS API for restarting one or more BMSs
with specified IDs

4.2.3 Starting a BMS API for starting one or more BMSs
with specified IDs

4.5.1 Attaching an EVS Disk API for attaching an EVS disk to a
created BMS

4.5.2 Detaching an EVS Disk API for detaching an EVS disk from a
BMS

4.5.3 Attaching Shared EVS Disks in API for batch attaching shared EVS
Batches disks to a created BMS

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 5
Bare Metal Server (BMS)
API Reference 2 API Introduction

API Description

4.4.5 Adding a NIC API for adding a NIC to a created BMS

4.4.6 Deleting a NIC API for deleting a NIC that has been
attached to a BMS


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 6
Bare Metal Server (BMS)
API Reference 3 API Calling


3 API Calling


3.1 Making an API Request
This section describes the structure of a REST API request, and uses the IAM API
for obtaining a user token as an example to demonstrate how to call an API. The
obtained token can then be used to authenticate the calling of other APIs.

Request URI
The format of a request URI is as follows:

{URI-scheme}://{Endpoint}/{resource-path}?{query-string}

Although a request URI is included in the request header, most programming
languages or frameworks require passing the request URI separately.

Table 3-1 Parameters in a URI

Parameter Description

URI-scheme Protocol used to transmit requests. All APIs use HTTPS.

Endpoint Domain name or IP address of the server bearing the REST
service endpoint. The endpoint varies between services in
different regions.

resource-path Path in which the resource requested by the API is located.
Obtain the path from the URI of an API. For example, the
value for resource-path of the "Obtaining a User Token"
API is /v3/auth/tokens.

query-string Query parameter, which is optional. Not all APIs have a
query parameter. Ensure that a question mark (?) is
included before each query parameter that is in the format
of Parameter name=Parameter value. For example, ?
limit=10 indicates that a maximum of 10 data records will
be displayed. Use ampersands (&) to separate multiple
query parameters.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 7
Bare Metal Server (BMS)
API Reference 3 API Calling



For example, you have obtained the endpoint (iam-apigateway-proxy.
{external_global_domain_name}) of a region and obtained the value /v3/auth/
tokens for resource-path in the URI of the API for obtaining a user token. Then,
construct the URI as follows:

https://iam-apigateway-proxy.{external_global_domain_name}/v3/auth/tokens

NO TE

To simplify the URI display, each API is provided only with resource-path and a request
method. This is because the URI-scheme value of all APIs is HTTPS, and the endpoints in a
region are the same.

Request Methods

HTTP-based request methods, which are also called operations or actions,
specifying the type of operations that you are requesting.

Table 3-2 HTTP-based methods

Method Description

GET Requests a server to return a specified resource.

PUT Requests a server to update a specified resource.

POST Requests a server to add a resource or perform a special
operation.

DELETE Requests a server to delete a specified resource (for
example, an object).

HEAD Requests a server for resource header.

PATCH Requests a server to update partial contents of a
specified resource.
If the requested resource does not exist, the server may
create the resource using the PATCH method.



For example, in the URI of the API for obtaining a user token, the request method
is POST. The request is as follows:

POST https://iam-apigateway-proxy.{external_global_domain_name}/v3/auth/tokens

Request Headers

You can also add additional header fields to a request, such as the fields required
by a specified URI or HTTP method. For example, add Content-Type that defines
a request body type to request for the authentication information.

Table 3-3 lists common request header fields.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 8
Bare Metal Server (BMS)
API Reference 3 API Calling

Table 3-3 Common request header fields
Name Description Mandatory Example Value

Content- Multipurpose Internet Yes application/json
Type Mail Extensions
(MIME) type of a
request body. Its
default value is
application/json.
Other values of this
field will be provided
for specific APIs if any.

X-Project-Id Project ID. No e9993fc787d*******
This field is ***aa340f9c0f4
mandatory for
requests that use
AK/SK
authentication in
the Dedicated
Cloud (DeC)
scenario or multi-
project scenario.

X-Auth- User token. No The following is
Token A user token is a This field is part of an
response to the API for mandatory for example token:
obtaining a user token token-based MIIPAgYJKoZIhvc-
(only this API does not authentication. NAQcCo...ggg1BBI
require authentication). INPXsidG9rZ
After a response is
returned, the value of
X-Subject-Token in the
response header is the
token value.



NO TE

In addition to supporting token-based authentication, cloud service APIs also support
authentication using the AK/SK. During AK/SK-based authentication, an SDK is used to sign
the request, and the Authorization (signature information) and X-Sdk-Date (time when
the request is sent) header fields are automatically added to the request.
The API used to obtain a user token does not require authentication. Therefore,
only the Content-Type field needs to be added to request headers for calling the
API. An example of such requests is as follows:

POST https://iam-apigateway-proxy.{external_global_domain_name}/v3/auth/tokens
Content-Type: application/json


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 9
Bare Metal Server (BMS)
API Reference 3 API Calling

Request Body
A request body conveys information other than the request header and is
generally sent in a structured format (for example, JSON or XML) defined by the
Content-Type field in the request header. If the request body contains Chinese
characters, these characters must be encoded in UTF-8.
Request bodies vary with APIs. Some APIs do not require a request body, such as
the APIs requested using the GET and DELETE methods.
For the API used to obtain a user token, obtain the request parameters and
parameter description in the API request. The following provides an example
request with a body included. Replace username, tenantname, ******** (login
password), and xxxxxxxxxxxxxxxxxx (project ID) with the actual values.

NO TE

The scope parameter specifies where a token takes effect. You can set scope to an account
or a project under an account. In the following example, the token takes effect only for the
resources in a specified project.
POST https://iam-apigateway-proxy.{external_global_domain_name}/v3/auth/tokens
Content-Type: application/json

{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"name": "username",
"password": "********",
"domain": {
"name": "tenantname"
}
}
}
},
"scope": {
"project": {
"id": "xxxxxxxxxxxxxxxxxx"
}
}
}
}
If all data required for the API request is available, you can send the request to call
an API through curl, Postman, or coding. For the API used to obtain a user token,
the value of the X-Subject-Token field in the response header is the desired user
token. You can use this token to authenticate the calling of other APIs.

3.2 Authentication
Requests for calling an API can be authenticated using either of the following
methods: AK/SK-based authentication is recommended because it is more secure
than token-based authentication.
● Token-based authentication: Requests are authenticated using a token.
● AK/SK-based authentication: Requests are authenticated by encrypting the
request body using an AK/SK pair.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 10
Bare Metal Server (BMS)
API Reference 3 API Calling

Token-based Authentication

NO TE

A token is valid for 24 hours. When using a token for authentication, cache it to avoid
frequent calling.
A token is used to acquire temporary permissions. During token-based API
authentication, the token is added to requests to get permissions for calling the
API.
When calling an API to obtain a user token, you must set auth.scope in the
request body to project.

{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"name": "username",
"password": "********",
"domain": {
"name": "domainname"
}
}
}
},
"scope": {
"project": {
"id": "xxxxxxxx"
}
}
}
}

For details about how to obtain xxxxxxxx for id, see Method 1: Obtaining the
Project ID on the Portal.
After a token is obtained, the X-Auth-Token header field must be added to
requests to specify the token when other APIs are called. For example, if the token
is ABCDEFJ...., add X-Auth-Token: ABCDEFJ.... in a request as follows:

GET https://iam-apigateway-proxy.{external_global_domain_name}/v3/auth/projects
Content-Type: application/json
X-Auth-Token: ABCDEFJ....

AK/SK-based Authentication

NO TE

AK/SK-based authentication supports API requests with a body not larger than 12 MB. For
API requests with a larger body, token-based authentication is recommended.
In AK/SK-based authentication, AK/SK is used to sign requests and the signature is
then added to the request headers for authentication.
● AK: access key ID, which is a unique identifier used together with a secret
access key to sign requests cryptographically.
● SK: secret access key. It is used together with an AK to sign requests, identify
request senders, and prevent requests from being modified.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 11
Bare Metal Server (BMS)
API Reference 3 API Calling

In AK/SK-based authentication, you can use an AK/SK pair to sign requests based
on the signature algorithm or use a dedicated signature SDK to sign requests.


NO TICE

Unlike the SDKs provided by services, the signature SDK is used only for signing.

The following uses a demo project to show how to sign a request and use an
HTTP client to send an HTTPS request. If you do not need the demo project,
obtain the API Gateway signature SDK from the administrator.

1. Generate an AK/SK pair. If an AK/SK pair has been generated, skip this step.
Find the downloaded AK/SK file, which is usually named credentials.csv.
a. Log in to ManageOne Operation Portal.
b. In the upper right corner of the page, click your account avatar and
choose My Settings from the drop-down list.
c. On the My Settings page, click the Manage Access Key tab.
d. Click Add Access Key to create an AK/SK pair.
e. Click OK to download the access key file.
f. Obtain the AK/SK pair from the credentials file.


NO TICE

● Each user can create up to two access keys.
● For security purposes, access keys are automatically downloaded only
when they are generated for the first time and cannot be obtained
from the management console later. Keep them properly.

2. Obtain and decompress the demo code.
3. Import the demo project into Eclipse.

Figure 3-1 Selecting an existing project


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 12
Bare Metal Server (BMS)
API Reference 3 API Calling

Figure 3-2 Selecting the decompressed demo code


Figure 3-3 Structure of the demo project


4. Sign the request.
The request signing method is integrated in the java-sdk-core-x.x.x.jar file
imported in 3. The request needs to be signed before it is sent. The signature
will then be added as part of the HTTP header to the request.
The demo code is classified into the following classes to demonstrate how to
sign and send the HTTP request:
– AccessService: an abstract class that merges the GET, POST, PUT, and
DELETE methods into the access method.
– Demo: execution entry that simulates GET, POST, PUT, and DELETE
requests.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 13
Bare Metal Server (BMS)
API Reference 3 API Calling

– AccessServiceImpl: implementation of the access method which includes
the code required for communication with API Gateway.
a. Edit the main method in the Demo.java file, and replace the bold text
with actual values.
If you use other methods such as POST, PUT, and DELETE, see the
corresponding comment.
Specify region, serviceName, ak/sk, and url as the actual values. In this
demo, the URLs for accessing VPC resources are used.
//TODO: Replace region with the name of the region in which the service to be accessed is
located.
private static final String region = "";

//TODO: Replace vpc with the name of the service you want to access. For example, ecs, vpc,
iam, and elb.
private static final String serviceName = "";

public static void main(String[] args) throws UnsupportedEncodingException
{
//TODO: Replace the AK and SK with those obtained on the My Credential page.
String ak = "ZIRRKMTWP******1WKNKB";
String sk = "Us0mdMNHk******YrRCnW0ecfzl";

//TODO: To specify a project ID (multi-project scenarios), add the X-Project-Id header.
//TODO: To access a global service, such as IAM, DNS, CDN, and TMS, add the X-Domain-Id
header to specify an account ID.
//TODO: To add a header, find "Add special headers" in the AccessServiceImple.java file.

//TODO: Test the API
String url = "https://{Endpoint}/v1/{project_id}/vpcs";
get(ak, sk, url);

//TODO: When creating a VPC, replace {project_id} in postUrl with the actual value.
//String postUrl = "https://serviceEndpoint/v1/{project_id}/cloudservers";
//String postbody ="{\"vpc\": {\"name\": \"vpc\",\"cidr\": \"192.168.0.0/16\"}}";
//post(ak, sk, postUrl, postbody);

//TODO: When querying a VPC, replace {project_id} in url with the actual value.
//String url = "https://serviceEndpoint/v1/{project_id}/vpcs/{vpc_id}";
//get(ak, sk, url);

//TODO: When updating a VPC, replace {project_id} and {vpc_id} in putUrl with the actual
values.
//String putUrl = "https://serviceEndpoint/v1/{project_id}/vpcs/{vpc_id}";
//String putbody ="{\"vpc\":{\"name\": \"vpc1\",\"cidr\": \"192.168.0.0/16\"}}";
//put(ak, sk, putUrl, putbody);

//TODO: When deleting a VPC, replace {project_id} and {vpc_id} in deleteUrl with the actual
values.
//String deleteUrl = "https://serviceEndpoint/v1/{project_id}/vpcs/{vpc_id}";
//delete(ak, sk, deleteUrl);
}
b. Compile and run the code to make an API call.
In the Package Explorer area on the left, right-click Demo.java, and
choose Run AS > Java Application from the shortcut menu to run the
demo code.
You can view API calling logs on the console.

3.3 Obtaining a Project ID
To call an API, enter a project ID (project_id or tenant_id) in some URLs. The
meanings of project_id and tenant_id in services at the IaaS layer are the same.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 14
Bare Metal Server (BMS)
API Reference 3 API Calling

This is for compatibility with the community. To obtain a project ID, perform the
following steps:

Method 1: Obtaining the Project ID on the Portal

Step 1 Log in to ManageOne as a VDC administrator or VDC operator using a browser.

URL in non-B2B scenarios: https://Domain name of ManageOne Operation Portal,
for example, https://console.demo.com.

URL in B2B scenarios: https://Domain name of ManageOne Operation Portal for
Tenants, for example, https://tenant.demo.com.

URL of the unified portal: https://Domain name of the ManageOne unified portal,
for example, https://console.demo.com/moserviceaccesswebsite/unifyportal#/
home. On the homepage, choose Self-service Cloud Service Center to go to
ManageOne Operation Portal.

You can log in using a password or a USB key.
● Login using a password: Enter the username and password.
The password is that of the VDC administrator or VDC operator.
● Login using a USB key: Insert a USB key with preset user certificates, select
the required device and certificate, and enter a PIN.

Step 2 Click in the upper left corner and select a region and resource space.

Step 3 Click the login account in the upper right corner of the page and choose My
Settings.

Step 4 Click the Resource Spaces tab and obtain the project ID.

----End

Method 2: Obtaining the Project ID by Calling the API
Construct an HTTP request to obtain project information. The URL is GET https://
iam-apigateway-proxy.{external_global_domain_name}/v3/auth/projects.

Request example:

GET /v3/auth/projects HTTP/1.1
Host: iam-apigateway-proxy.public.example.com
X-Auth-Token: {Obtained token}
Content-Type: application/json

3.4 Response

Status Code
After sending a request, you will receive a response that includes a status code,
response header, and response body.

A status code is a group of digits, ranging from 1xx to 5xx. It indicates the status
of a request.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 15
Bare Metal Server (BMS)
API Reference 3 API Calling

For example, if status code 201 is returned for calling the API used to obtain a
user token, the request is successful.

Response Header

Similar to a request, a response also has a header, for example, Content-Type.

Figure 3-4 shows the response header fields for the API used to obtain a user
token. The value of the X-Subject-Token header field is the desired user token.
You can use this token to authenticate the calling of other APIs.

Figure 3-4 Header fields of the response to the request for obtaining a user token


Response Body

A response body conveys information other than the response header and is
generally sent in a structured format (for example, JSON or XML) defined by the
Content-Type field in the response header.

The following is part of the response body for the API used to obtain a user token:

{
"token": {
"expires_at": "2019-02-13T06:52:13.855000Z",
"methods": [
"password"
],
"catalog": [
{
"endpoints": [
{
"region_id": "az-01",
......

If an error occurs during API calling, an error code and error description will be
displayed. The following shows an error response body:

{
"error_msg": "The format of message is error",
"error_code": "AS.0001"
}

In the preceding information, error_code is an error code, and error_msg
describes the error.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 16
Bare Metal Server (BMS)
API Reference 4 API Reference


4 API Reference


4.1 BMS Lifecycle Management

4.1.1 Creating a BMS

Function
This API is used to create one or more BMSs. When creating multiple BMSs, you
cannot specify subnet IP addresses for NICs. However, you can select
Automatically Assign for EIP to bind EIPs to the BMSs. For details about how to
query BMSs, see "Lifecycle Management" > "Querying Details About ECSs" in
Elastic Cloud Server (ECS) 8.3.0 API Reference (for Huawei Cloud Stack 8.3.0) in
Elastic Cloud Server (ECS) 8.3.0 Usage Guide (for Huawei Cloud Stack 8.3.0), and
add the query parameter tags=__type_baremetal. For details about how to query
details about a certain BMS, see "Lifecycle Management" > "Querying Details
About an ECS" in Elastic Cloud Server (ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0 Usage Guide (for Huawei Cloud
Stack 8.3.0).

URI
POST /v1/{project_id}/baremetalservers

Table 4-1 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 17
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-2 Request header parameters
Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.


Table 4-3 Request body parameters
Parameter Mandatory Type Description

server No create_server BMS.
object




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 18
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-4 create_server
Parameter Mandatory Type Description

name Yes String BMS name, Value range:1. The
value can contain 1 to 64
characters, including only
Chinese characters, letters (a
to z and A to Z), digits (0 to
9), underscores (_), and
hyphens (-).2. If the number
of created bare metal server
(the value of count) is greater
than 1, the system
automatically adds a mark
similar to - 0000 to the name
of each BMS during the
creation. Therefore, the name
contains 1 to 59 characters.
Minimum: 1
Maximum: 64

availability_zo Yes String AZ where the BMS is located.
ne For details, see section "Query
the list of specified conditional
resource tags (technical
preview)" in Huawei Cloud
Stack 8.3.0 API Reference, and
add the query parameters
resource_type=availability_zon
e and virtual_capability=Ironic.

flavorRef Yes String ID of the flavor used for
creating a BMS. For details,
see section "Querying Details
About BMS Flavors."

imageRef Yes String ID of the image used for
creating a BMS. For details,
see "Image" > "Querying
Images" in Image
Management Service (IMS)
8.3.0 API Reference (for
Huawei Cloud Stack 8.3.0) in
Image Management Service
(IMS) 8.3.0 Usage Guide (for
Huawei Cloud Stack 8.3.0),
and add the query parameters
status=active and
virtual_env_type=Ironic to the
URL.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 19
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

vpcid Yes String ID of the VPC to which the
BMS belongs. For details, see
"VPC" > "VPC combination
interface" > "Query VPC list"
in Virtual Private Cloud (VPC)
8.3.0 API Reference (for
Huawei Cloud Stack 8.3.0) in
Virtual Private Cloud (VPC)
8.3.0 Usage Guide (for Huawei
Cloud Stack 8.3.0).

nics Yes Array of BMS NIC.
bms_nic
objects

publicip No publicip Method of configuring an EIP
object for the BMS, which can be one
of the following: Do Not Use
(If this option is selected, the
EIP field is unavailable.);
Automatically Assign; Specify.

security_grou Yes Array of Security group information.
ps sec_group For details, see "VPC" >
objects "Security Group" > "Query
security group list" in Virtual
Private Cloud (VPC) 8.3.0 API
Reference (for Huawei Cloud
Stack 8.3.0) in Virtual Private
Cloud (VPC) 8.3.0 Usage
Guide (for Huawei Cloud
Stack 8.3.0).

metadata Yes metadata Metadata service storage
object information of a BMS. This
field can be left empty, that is,
{}. You can add the
op_svc_userid parameter, that
is, the user ID.

data_volumes No Array of EVS disks for the BMS to be
data_volume created.
s objects

count No Integer Number of BMSs to be
created. The default value is 1.
Minimum: 1
Maximum: 200
Default: 1

extendparam No extendparam Supplementary information
object about the BMS to be created.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 20
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

key_name No String Key pair name. For details, see
"SSH Key Management" >
"Querying SSH Key Pairs" in
Elastic Cloud Server (ECS)
8.3.0 API Reference (for
Huawei Cloud Stack 8.3.0) in
Elastic Cloud Server (ECS)
8.3.0 Usage Guide (for Huawei
Cloud Stack 8.3.0). The BMS
image must support Cloud-
Init.

tags No Array of List of BMS tags. The format is
strings key.value. The value of key
must be unique. The length of
a single element in the list
cannot exceed 80 characters.
An element cannot start with
SYS_ or a period (.), and
cannot contain a comma (,) or
slash (/).
Maximum: 80


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 21
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

user_data No String User data to be injected
during BMS creation. Texts,
text files, or GZIP files can be
injected. For more information
about the user data to be
injected, see "Compute
Services" > "Bare Metal Server
(BMS)" > "Configuration
Before BMS Creation" >
"(Optional) Creating a User
Data Injection Script" in
Huawei Cloud Stack 8.3.0
Resource Provisioning
Guide.Constraints:1. The
content to be injected must be
encoded using Base64.2. The
maximum size of the content
to be injected (before
encoding) is 32 KB.3. If
key_name is not specified, the
data injected by user_data is
the password of the root user
for logging in to the BMS by
default.4. This parameter is
mandatory when you create a
Linux BMS using the password
authentication mode. Its value
is the initial password of the
root user. It is recommended
that the password must: 1.
Contain 8 to 26 characters. 2.
Contain at least three of the
following character types:
uppercase letters, lowercase
letters, digits, and special
characters (`~!@#$%^&*()-_=
+|[{}];:'",<.>/?). Example: If a
plaintext password (risky), for
example, password, is used,
the data to be injected is as
follows:#!/bin/bashecho
'root:password' | chpasswdIf a
ciphertext password is used,
the data to be injected is as
follows:#!/bin/bashecho 'root:
$6$V6azyeLwcD3CHlpY
$BN3VVq18fmCkj66B4zdHLWe
vqcxlig/
GpOkLcOhab9smJoLKYm/
Tf9Hcwa6DpiPDhdHfGEAPajF


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 22
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

mLZa0YDd910' | chpasswd -
eIn the preceding information,
$6$V6azyeLwcD3CHlpY
$BN3VVq18fmCkj66B4zdHLWe
vqcxlig/
GpOkLcOhab9smJoLKYm/
Tf9Hcwa6DpiPDhdHfGEAPajF
mLZa0YDd910 indicates the
ciphertext password.The
generation method is as
follows: 1. Run the following
command to generate a salt
value: [root@test linux]#
python -c "import crypt,
getpass, pwd;print
crypt.mksalt()" Example
command output:
$6$V6azyeLwcD3CHlpY 2. Run
the following command to
generate a ciphertext
password based on the salt
value: [root@test linux]#
python -c "import crypt,
getpass, pwd;print
crypt.crypt('password','$6$V6a
zyeLwcD3CHlpY')" Example
command output:
$6$V6azyeLwcD3CHlpY
$BN3VVq18fmCkj66B4zdHLWe
vqcxlig/
GpOkLcOhab9smJoLKYm/
Tf9Hcwa6DpiPDhdHfGEAPajF
mLZa0YDd910




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 23
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-5 bms_nic
Parameter Mandatory Type Description

subnet_id Yes String Subnet ID, high-speed network
ID, or RoCE network ID. If it is
a VPC subnet, see "VPC" >
"Subnet combination
interface" > "Query subnet
list" in Virtual Private Cloud
(VPC) 8.3.0 API Reference (for
Huawei Cloud Stack 8.3.0) in
Virtual Private Cloud (VPC)
8.3.0 Usage Guide (for Huawei
Cloud Stack 8.3.0), and add
the query parameter vpc to
the URL to query subnets of
the specified VPC. The subnet
and the BMS must belong to
the same VPC. If it is a high-
speed network, query the
created high-speed networks
by following the instructions
provided in section "Querying
High-Speed Networks." If it is
a RoCE network, see
"Network" > "Querying a
Network (OpenStack
Community Compatible API)"
in Virtual Private Cloud (VPC)
8.3.0 API Reference (for
Huawei Cloud Stack 8.3.0) in
Virtual Private Cloud (VPC)
8.3.0 Usage Guide (for Huawei
Cloud Stack 8.3.0).

ip_address No String Subnet IPv4 address. If IPv4 is
used, select an unused IPv4
address from the subnet
indicated by subnet_id. If this
parameter is left blank or is
set to an empty string, an
unused IP address will be
automatically assigned.

ip_address_v6 No String Subnet IPv6 address. If IPv6 is
used, select an unused IPv6
address from the subnet
indicated by subnet_id. If this
parameter is left blank or is
set to an empty string, an
unused IP address will be
automatically assigned.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 24
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

nictype No String NIC type.


Table 4-6 publicip
Parameter Mandatory Type Description

id No String ID of the existing EIP assigned
to the BMS. The status of the
assigned EIP must be DOWN.
If Automatically Assign is
selected for EIP, this parameter
is not required. For details, see
"Composite interface" >
"Query Elastic IP list" in Elastic
IP (EIP) 8.3.0 API Reference
(for Huawei Cloud Stack 8.3.0)
in Elastic IP (EIP) 8.3.0 Usage
Guide (for Huawei Cloud
Stack 8.3.0).

eip No eip object Parameters for creating an EIP
that will be automatically
assigned to the BMS.


Table 4-7 eip
Parameter Mandatory Type Description

iptype Yes String EIP type. For details, see
"Composite interface" >
"Query Elastic IP type list" in
Elastic IP (EIP) 8.3.0 API
Reference (for Huawei Cloud
Stack 8.3.0) in Elastic IP (EIP)
8.3.0 Usage Guide (for Huawei
Cloud Stack 8.3.0).

bandwidth No bandwidth Bandwidth of an IP address,
object which needs to be added
when the EIP is automatically
allocated. The EIP-QoS
network service must be
installed in the environment.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 25
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-8 bandwidth
Parameter Mandatory Type Description

size Yes Integer Bandwidth size in Mbit/s.
Minimum: 1
Maximum: 1000

sharetype Yes String Bandwidth sharing type.
Enumerated values: PER
(indicating exclusive
bandwidth) and WHOLE
(indicating shared bandwidth).
Default: PER

name No String Bandwidth name.

bwId No String ID of the shared bandwidth. If
the shared bandwidth is used,
add it.


Table 4-9 sec_group
Parameter Mandatory Type Description

id Yes String Security group ID.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 26
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-10 metadata

Parameter Mandatory Type Description

admin_pass No String Password of Administrator for
logging in to the BMS created
using a Windows image.
Example: passwordA password
must meet the following
requirements: 1. Contain 8 to
26 characters. 2. Contain at
least three of the following
character types: uppercase
letters, lowercase letters,
digits, and special characters
(`~!@#$%^&*()-_=+|
[{}];:'",<.>/?). 3. Cannot
contain the username, the
username spelled backwards,
or more than two consecutive
characters in the username.
Minimum: 8
Maximum: 26



Table 4-11 data_volumes

Parameter Mandatory Type Description

volumetype Yes String EVS disk type. For details, see
section "Query the list of
specified conditional resource
tags (technical preview)" in
Huawei Cloud Stack 8.3.0 API
Reference, and add the query
parameters
resource_type=volume_type
and availability_zone to
ensure that the EVS disk type
and the BMS are in the same
AZ.

size Yes Integer EVS disk size in GB.

shareable Yes Boolean Whether the EVS disk can be
shared.

extendparam No Map<String,St Extended field of the EVS disk.
ring>

metadata No Map<String,St Metadata of the EVS disk.
ring>



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 27
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-12 extendparam
Parameter Mandatory Type Description

regionID No String ID of the region where the
BMS is located.

enterprise_pro No String Enterprise project to which the
ject_id BMS belongs.


Response Parameters
Status code: 200

Table 4-13 Response body parameters
Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).


Status code: 400

Table 4-14 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.


Table 4-15 error
Parameter Type Description

message String Job error message.

code String Job error code.


Example Requests
{
"server" : {
"availability_zone" : "bms.az",
"name" : "bms-test",

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 28
Bare Metal Server (BMS)
API Reference 4 API Reference

"imageRef" : "11c4948a-40ac-4ebf-adb2-3f4619ef0a6f",
"flavorRef" : "physical.123",
"data_volumes" : [ {
"volumetype" : "bms_iscsi",
"size" : 5,
"shareable" : false,
"extendparam" : {
"resourceSpecCode" : "",
"resourceType" : ""
}
}, {
"volumetype" : "bms_iscsi",
"size" : 5,
"shareable" : true,
"extendparam" : {
"resourceSpecCode" : "",
"resourceType" : ""
}
} ],
"vpcid" : "00feb70c-606b-4ff0-b799-cb759d60531b",
"nics" : [ {
"subnet_id" : "aae51c94-168b-4a8c-b5ff-add4b689efa2",
"ip_address" : "",
"ip_address_v6" : ""
}, {
"subnet_id" : "35e29af1-985f-4fa2-8da7-c032a42f85c0",
"ip_address" : "",
"ip_address_v6" : ""
} ],
"count" : 1,
"extendparam" : {
"regionID" : "bms-region-1",
"enterprise_project_id" : "0"
},
"metadata" : {
"op_svc_userid" : "cb59c02e4057473f82ee2b4e8abf4479"
},
"tags" : [ "key1.value1", "key2.value2" ],
"publicip" : {
"eip" : {
"iptype" : "eip_network",
"bandwidth" : {
"name" : "bms-test-bandwidth",
"size" : 5,
"sharetype" : "PER",
"productid" : ""
}
}
},
"user_data" : "IyEgL2Jpbi9iYXNoCmVjaG8gdXNlcl90ZXN0ID4+IC9ob21lL3Rlc3QudHh0",
"security_groups" : [ {
"id" : "16165005-5dca-4cf5-89cc-de55885e0934"
} ]
}
}

Example Responses
Status code: 200
The job is delivered.

{
"job_id" : "80a596e0-31e4-49b7-b290-868f441e892c"
}
Status code: 400
The server failed to process the request.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 29
Bare Metal Server (BMS)
API Reference 4 API Reference

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes
Status Description
Code

200 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.1.2 Deleting a BMS

Function
This API is used to delete BMSs with specified IDs. BMSs can be deleted in batches
or one by one.

URI
POST /v1/{project_id}/baremetalservers/delete

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 30
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-16 Path Parameters

Parameter Mandatory Type Description

project_id Yes String Project ID.



Request Parameters

Table 4-17 Request header parameters

Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.



Table 4-18 Request body parameters

Parameter Mandatory Type Description

servers Yes Array of IDs of BMSs to be deleted. For
server objects details, see "Lifecycle
Management" > "Querying
Details About ECSs" in Elastic
Cloud Server (ECS) 8.3.0 API
Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud
Server (ECS) 8.3.0 Usage
Guide (for Huawei Cloud
Stack 8.3.0), and add the
query parameter
tags=__type_baremetal to the
URL.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 31
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

delete_publici Yes Boolean Whether to delete the EIP
p bound to the BMS when it is
deleted. true indicates that the
EIP is deleted. false indicates
that the system only unbinds
the EIP from the BMS and
reserves the EIP.

delete_volum Yes Boolean Whether to delete EVS disks
e attached to the BMS when it
is deleted. true indicates that
EVS disks are deleted. false
indicates that the system only
detaches EVS disks from the
BMS and reserves the EVS
disks.


Table 4-19 server
Parameter Mandatory Type Description

id Yes String ID of the BMS to be deleted.


Response Parameters
Status code: 200

Table 4-20 Response body parameters
Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).


Status code: 400


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 32
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-21 Response body parameters

Parameter Type Description

error error object Message returned if a job submission error
occurs.



Table 4-22 error

Parameter Type Description

message String Job error message.

code String Job error code.



Example Requests
{
"servers" : [ {
"id" : "616fb98f-46ca-475e-917e-2563e5a8cd19"
} ],
"delete_publicip" : false,
"delete_volume" : false
}

Example Responses

Status code: 200

The job is delivered.

{
"job_id" : "70a599e0-31e7-49b7-b260-868f441e862b"
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 33
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

204 No content.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.1.3 Querying BMSs (Community-Compatible API)

Function
This API is used to query BMSs. It is compatible with the v2 API. When calling
community-compatible APIs, use the ECS service endpoint.

URI
GET /v2.1/{project_id}/servers

Table 4-23 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 34
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-24 Query Parameters
Parameter Mandatory Type Description

all_tenants No Integer Whether to query BMSs of all
tenants. This parameter is
available only to
administrators. The value can
be 0 (do not query BMSs of all
tenants) or 1 (query BMSs of
all tenants).

changes-since No String Timestamp when the BMS
status was updated last time.
The timestamp format is UTC.

flavor No String BMS flavor ID

image No String Image ID. When image is used
as a filter criterion, other filter
criteria and paging criteria are
not supported. If both image
and other criteria are
specified, the image filter
criterion is used. If the query
criteria do not contain the
image filter criterion, there is
no restriction on the API
function.

limit No Integer Upper limit on the number of
returned results.

marker No String Marker that points to the BMS
ID. The query will start from
the next ID.

name No String BMS name.

not-tags No String Queries BMSs whose tags do
not contain the specified
value.

reservation_id No String ID returned when BMSs are
created in batches. This
parameter is used to query
BMSs created in batches.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 35
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

status No String BMS status. The value can be
ACTIVE, BUILD, DELETED,
ERROR, HARD_REBOOT,
MIGRATING, REBOOT, RESIZE,
REVERT_RESIZE, SHELVED,
SHELVED_OFFLOADED,
SHUTOFF, UNKNOWN, or
VERIFY_RESIZE. Only the
administrator can query
deleted BMSs by setting the
value to DELETED.
Enumeration values:
● ACTIVE
● BUILD
● DELETED
● ERROR
● HARD_REBOOT
● MIGRATING
● REBOOT
● RESIZE
● REVERT_RESIZE
● SHELVED
● SHELVED_OFFLOADED
● SHUTOFF
● UNKNOWN
● VERIFY_RESIZE

tags Yes String BMS tags. The default value of
tags is __type_baremetal.
Default: __type_baremetal



Request Parameters

Table 4-25 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 36
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
Status code: 200

Table 4-26 Response body parameters
Parameter Type Description

servers Array of BMS list.
server objects


Table 4-27 server
Parameter Type Description

id String ID of the BMS to be deleted.


Example Requests
None

Example Responses
Status code: 200
The request is successful.

{
"servers" : [ {
"id" : "b3a7db10-38c8-407c-9ee9-8f4d078f3c07",
"links" : [ {
"href" : "https://compute.localdomain.com:8001/v2.1/servers/b3a7db10-38c8-407c-9ee9-8f4d078f3c07",
"rel" : "self"
}, {
"href" : "https://compute.localdomain.com:8001/servers/b3a7db10-38c8-407c-9ee9-8f4d078f3c07",

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 37
Bare Metal Server (BMS)
API Reference 4 API Reference

"rel" : "bookmark"
} ],
"name" : "vm_yqb1"
}, {
"id" : "24f6b74e-0a33-490e-86e9-f9f79ca8bb3c",
"links" : [ {
"href" : "https://compute.localdomain.com:8001/v2.1/servers/24f6b74e-0a33-490e-86e9-f9f79ca8bb3c",
"rel" : "self"
}, {
"href" : "https://compute.localdomain.com:8001/servers/24f6b74e-0a33-490e-86e9-f9f79ca8bb3c",
"rel" : "bookmark"
} ],
"name" : "lxd"
} ]
}

Status Codes

Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.



4.1.4 Querying Details About BMSs (Community-Compatible
API)

Function

This API is used to query details about BMSs. When calling community-compatible
APIs, use the ECS service endpoint.

URI

GET /v2.1/{project_id}/servers/detail

Table 4-28 Path Parameters

Parameter Mandatory Type Description

project_id Yes String Project ID.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 38
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-29 Query Parameters
Parameter Mandatory Type Description

all_tenants No Integer Whether to query BMSs of all
tenants. This parameter is
available only to
administrators. The value can
be 0 (do not query BMSs of all
tenants) or 1 (query BMSs of
all tenants).

changes-since No String Timestamp when the BMS
status was updated last time.
The timestamp format is UTC.

flavor No String BMS flavor ID.

image No String Image ID. When image is used
as a filter criterion, other filter
criteria and paging criteria are
not supported. If both image
and other criteria are
specified, the image filter
criterion is used. If the query
criteria do not contain the
image filter criterion, there is
no restriction on the API
function.

limit No Integer Upper limit on the number of
returned results.

marker No String Marker that points to the BMS
ID. The query will start from
the next ID.

name No String BMS name.

not-tags No String Queries BMSs whose tags do
not contain the specified
value.

reservation_id No String ID returned when BMSs are
created in batches. This
parameter is used to query
BMSs created in batches.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 39
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

status No String BMS status. The value can be
ACTIVE, BUILD, DELETED,
ERROR, HARD_REBOOT,
MIGRATING, REBOOT, RESIZE,
REVERT_RESIZE, SHELVED,
SHELVED_OFFLOADED,
SHUTOFF, UNKNOWN, or
VERIFY_RESIZE. Only the
administrator can query
deleted BMSs by setting the
value to DELETED.
Enumeration values:
● ACTIVE
● BUILD
● DELETED
● ERROR
● HARD_REBOOT
● MIGRATING
● REBOOT
● RESIZE
● REVERT_RESIZE
● SHELVED
● SHELVED_OFFLOADED
● SHUTOFF
● UNKNOWN
● VERIFY_RESIZE

tags Yes String BMS tags. The default value of
tags is __type_baremetal.
Default: __type_baremetal



Request Parameters

Table 4-30 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 40
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
Status code: 200

Table 4-31 Response body parameters
Parameter Type Description

servers Array of BMS list.
servers_detai
l objects

servers_links link object Link of the next page in pagination query.


Table 4-32 servers_detail
Parameter Type Description

OS- String Disk configuration mode, which is an extended
DCF:diskConfi attribute. This field is valid for the BMS started
g using an image. Value: AUTO: This API uses a
single partition to build a BMS with the target
disk size. The API automatically adjusts the file
system to adapt to the entire partition.
MANUAL: This API uses the partitioning
scheme in the source image and the file
system to build the BMS. If the target disk size
is large, the API does not partition the
remaining disk space.
Enumeration values:
● AUTO
● MANUAL


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 41
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Type Description

OS-EXT- String AZ ID, which is an extended attribute.
AZ:availability
_zone

OS-EXT-SRV- String Name of the host on which the BMS is
ATTR:host deployed, which is an extended attribute.

OS-EXT-SRV- String BMS hostname.
ATTR:hostna
me

OS-EXT-SRV- String Hypervisor hostname.
ATTR:hypervis
or_hostname

OS-EXT-SRV- String BMS ID.
ATTR:instance
_name

OS-EXT-SRV- String System drive letter of the BMS.
ATTR:root_de
vice_name

OS-EXT-SRV- String BMS user data information.
ATTR:user_dat
a


Table 4-33 link
Parameter Type Description

rel String Shortcut link marker name.

href String Shortcut link.


Example Requests
None

Example Responses
Status code: 200
The request is successful.

{
"servers" : [ {
"addresses" : {
"68269e6e-4a27-441b-8029-35373ad50bd9" : [ {
"addr" : "192.168.0.3",
"version" : 4
} ]

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 42
Bare Metal Server (BMS)
API Reference 4 API Reference

},
"created" : "2012-09-07T16:56:37Z",
"flavor" : {
"id" : "1",
"links" : [ {
"href" : "http://openstack.example.com/openstack/flavors/1",
"rel" : "bookmark"
} ]
},
"hostId" : "16d193736a5cfdb60c697ca27ad071d6126fa13baeb670fc9d10645e",
"id" : "05184ba3-00ba-4fbc-b7a2-03b62b884931",
"image" : "",
"links" : [ {
"href" : "http://openstack.example.com/v2/openstack/servers/05184ba3-00ba-4fbc-
b7a2-03b62b884931",
"rel" : "self"
}, {
"href" : "http://openstack.example.com/openstack/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931",
"rel" : "bookmark"
} ],
"metadata" : { },
"name" : "new-server-test",
"progress" : 0,
"status" : "ACTIVE",
"tenant_id" : "openstack",
"updated" : "2012-09-07T16:56:37Z",
"user_id" : "fake"
} ]
}

Status Codes
Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.


4.2 BMS Status Management

4.2.1 Stopping a BMS

Function
This API is used to stop one or more BMSs with specified IDs.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 43
Bare Metal Server (BMS)
API Reference 4 API Reference

URI
POST /v1/{project_id}/baremetalservers/action

Table 4-34 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.


Request Parameters

Table 4-35 Request header parameters
Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.


Table 4-36 Request body parameters
Parameter Mandatory Type Description

os-stop Yes os-stop Operation of stopping a BMS.
object




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 44
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-37 os-stop
Parameter Mandatory Type Description

servers Yes Array of IDs of BMSs to be stopped.
server_reboot
objects

type No String Stop type, which can be HARD
or SOFT. HARD indicates
forcible stop, and SOFT
indicates graceful stop. If this
parameter is not displayed,
graceful stop is used.
Enumeration values:
● HARD
● SOFT


Table 4-38 server_reboot
Parameter Mandatory Type Description

id Yes String BMS ID.


Response Parameters
Status code: 200

Table 4-39 Response body parameters
Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).


Status code: 400


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 45
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-40 Response body parameters

Parameter Type Description

error error object Message returned if a job submission error
occurs.



Table 4-41 error

Parameter Type Description

message String Job error message.

code String Job error code.



Example Requests
{
"os-stop" : {
"servers" : [ {
"id" : "616fb98f-46ca-475e-917e-2563e5a8cd19"
}, {
"id" : "726fb98f-46ca-475e-917e-2563e5a8cd20"
} ],
"type" : "HARD"
}
}

Example Responses

Status code: 200

The job is delivered.

{
"job_id" : "70a599e0-31e7-49b7-b260-868f441e862b"
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The job is delivered.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 46
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.2.2 Restarting a BMS

Function
This API is used to restart one or more BMSs with specified IDs.

URI
POST /v1/{project_id}/baremetalservers/action

Table 4-42 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 47
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-43 Request header parameters
Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.


Table 4-44 Request body parameters
Parameter Mandatory Type Description

reboot Yes reboot object Operation of restarting a BMS.


Table 4-45 reboot
Parameter Mandatory Type Description

type Yes String Restart type: 1. SOFT: soft
restart; 2. HARD: forcible
restart.
Enumeration values:
● SOFT
● HARD

servers Yes Array of IDs of BMSs to be restarted.
server_reboot
objects




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 48
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-46 server_reboot

Parameter Mandatory Type Description

id Yes String BMS ID.



Response Parameters
Status code: 200

Table 4-47 Response body parameters

Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).



Status code: 400

Table 4-48 Response body parameters

Parameter Type Description

error error object Message returned if a job submission error
occurs.



Table 4-49 error

Parameter Type Description

message String Job error message.

code String Job error code.



Example Requests
{
"reboot" : {
"type" : "SOFT",
"servers" : [ {
"id" : "616fb98f-46ca-475e-917e-2563e5a8cd19"
}, {
"id" : "726fb98f-46ca-475e-917e-2563e5a8cd20"
} ]

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 49
Bare Metal Server (BMS)
API Reference 4 API Reference

}
}

Example Responses

Status code: 200

The job is delivered.

{
"job_id" : "70a599e0-31e7-49b7-b260-868f441e862b"
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 50
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.



4.2.3 Starting a BMS

Function

This API is used to start one or more BMSs with specified IDs.

URI

POST /v1/{project_id}/baremetalservers/action

Table 4-50 Path Parameters

Parameter Mandatory Type Description

project_id Yes String Project ID.



Request Parameters

Table 4-51 Request header parameters

Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 51
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.



Table 4-52 Request body parameters

Parameter Mandatory Type Description

os-start Yes os-start Operation of starting a BMS.
object



Table 4-53 os-start

Parameter Mandatory Type Description

servers Yes Array of IDs of BMSs to be started.
server_reboot
objects



Table 4-54 server_reboot

Parameter Mandatory Type Description

id Yes String BMS ID.



Response Parameters

Status code: 200

Table 4-55 Response body parameters

Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).



Status code: 400

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 52
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-56 Response body parameters

Parameter Type Description

error error object Message returned if a job submission error
occurs.



Table 4-57 error

Parameter Type Description

message String Job error message.

code String Job error code.



Example Requests
{
"os-start" : {
"servers" : [ {
"id" : "616fb98f-46ca-475e-917e-2563e5a8cd19"
}, {
"id" : "726fb98f-46ca-475e-917e-2563e5a8cd20"
} ]
}
}

Example Responses
Status code: 200
The job is delivered.

{
"job_id" : "70a599e0-31e7-49b7-b260-868f441e862b"
}
Status code: 400
The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes
Status Description
Code

200 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 53
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.3 BMS Flavor Query

4.3.1 Querying BMS Flavors

Function
This API is used to query BMS flavors. If the value of id in a response starts with
physical, it indicates a BMS flavor and can be used to create BMSs.

URI
GET /v1/{project_id}/baremetalservers/flavors


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 54
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-58 Path Parameters

Parameter Mandatory Type Description

project_id Yes String Project ID.



Request Parameters

Table 4-59 Request header parameters

Parameter Mandatory Type Description

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Response Parameters

Status code: 200

Table 4-60 Response body parameters

Parameter Type Description

flavors Array of BMS flavors.
flavor objects



Table 4-61 flavor

Parameter Type Description

id String BMS flavor ID.

name String BMS flavor name.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 55
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Type Description

vcpus Integer CPU cores in the BMS flavor.

ram Integer Memory size (MB) in the BMS flavor.

disk Integer Disk size (GB) in the BMS flavor.

swap String Unused.

OS-FLV-EXT- Integer Unused.
DATA:epheme
ral

OS-FLV- Boolean Unused.
DISABLED:dis
abled

rxtx_factor Integer Unused.

rxtx_quota String Unused.

os-flavor- Boolean Unused.
access:is_publi
c

links Array of link Shortcut links to the flavor.
objects

os_extra_spec os_extra_spec Extended field of the BMS flavor.
s s object


Table 4-62 link
Parameter Type Description

rel String Shortcut link marker name.

href String Shortcut link.


Table 4-63 os_extra_specs
Parameter Type Description

capabilities:cp String BMS CPU architecture, for example, x86_64
u_info:arch

capabilities:bo String BMS flavor type.
ard_type

capabilities:hy String Ironic flavor, preventing the scheduler from
pervisor_type affecting VM scheduling.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 56
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Type Description

baremetal:cpu String Physical CPU specifications.
_detail

baremetal:me String Physical memory specifications.
mory_detail

baremetal:dis String Physical disk specifications.
k_detail

baremetal:net String Physical NIC specifications.
card_detail

baremetal:net String Maximum number of NICs that can be
_num attached.

resource_type String Resource type of the BMS, which is fixed at
ironic.

baremetal:bm String Tags of a physical network port of a BMS.
s_port_tags

trait:CUSTOM String Flavor tag, which indicates that the RoCE
_ROCE network is supported.

resources:CUS String Maximum number of RoCE NICs that can be
TOM_ROCE_ attached.
MAX_NUM



Status code: 400

Table 4-64 Response body parameters

Parameter Type Description

error error object Message returned if a job submission error
occurs.



Table 4-65 error

Parameter Type Description

message String Job error message.

code String Job error code.



Example Requests

None

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 57
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Responses

Status code: 200

The request is successful.

{
"flavors" : [ {
"id" : "physical.test",
"name" : "bms.test",
"vcpus" : "24",
"ram" : 319024,
"disk" : "598",
"swap" : "",
"links" : [ {
"rel" : "self",
"href" : "https://compute-ext.az0.dc0.domainname.com/v1.0/a440453330964546b3e9ee8389f4603a/
flavors/physical.test",
"type" : null
}, {
"rel" : "bookmark",
"href" : "https://compute-ext.az0.dc0.domainname.com/a440453330964546b3e9ee8389f4603a/flavors/
physical.test",
"type" : null
} ],
"OS-FLV-EXT-DATA:ephemeral" : 0,
"rxtx_factor" : 1,
"OS-FLV-DISABLED:disabled" : false,
"rxtx_quota" : null,
"rxtx_cap" : null,
"os-flavor-access:is_public" : true,
"os_extra_specs" : {
"capabilities:cpu_info:arch" : "x86_64",
"huawei:deploytype" : "ironic",
"capabilities:hypervisor_type" : "ironic",
"baremetal:extBootType" : "volume",
"capabilities:board_type" : "2288H",
"huawei:extBootType" : "Volume",
"baremetal:memory_detail" : "319024",
"baremetal:net_num" : "6",
"baremetal:netcard_detail" : "intel",
"baremetal:cpu_detail" : "24",
"resource_type" : "ironic",
"baremetal:disk_detail" : "598"
}
} ]
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The request is successful.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 58
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.



4.4 BMS NIC Management

4.4.1 Creating a High-Speed Network

Function

This API is used to create a high-speed network. A high-speed network is an
internal network among BMSs in the centralized BMS gateway scenario and
provides unlimited bandwidth for connecting BMSs in the same AZ. The traffic of a
high-speed network is limited within a BMS gateway.

Constraints

This API can be used only when centralized BMGWs are deployed.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 59
Bare Metal Server (BMS)
API Reference 4 API Reference

URI
POST /v1/{project_id}/baremetalservers/subnets

Table 4-66 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.


Request Parameters

Table 4-67 Request header parameters
Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.
Default:
e9993fc787d94b6c886cbaa34
0f9c0f4


Table 4-68 Request body parameters
Parameter Mandatory Type Description

subnet Yes subnet object High-speed network.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 60
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-69 subnet
Parameter Mandatory Type Description

name Yes String High-speed network name.
The value is a string of 1 to 64
characters that can contain
only Chinese characters, digits,
letters, underscores (_), and
hyphens (-).

cidr Yes String IPv4 subnet CIDR block of the
high-speed network.

cidr_v6 No String IPv6 subnet CIDR block of the
high-speed network.


Response Parameters
Status code: 201

Table 4-70 Response body parameters
Parameter Type Description

ipv4 high_ip IPv4 subnet of the high-speed network.
object

ipv6 high_ip IPv6 subnet of the high-speed network.
object


Table 4-71 high_ip
Parameter Type Description

id String High-speed network ID.

name String High-speed network name.

cidr String Subnet CIDR block of the high-speed network.

status String Subnet status of the high-speed network.

gateway_ip String Subnet gateway of the high-speed network.


Status code: 400


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 61
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-72 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.


Table 4-73 error
Parameter Type Description

message String Job error message.

code String Job error code.


Example Requests
{
"subnet" : {
"name" : "highway-69ca",
"cidr" : "192.168.65.0/24",
"cidr_v6" : "FC00:0:0:0:0:0:0:0/64"
}
}

Example Responses
Status code: 201
The job is delivered.

{
"ipv4" : {
"id" : "a3488d1d-e134-4f69-b1a7-fe227ae0e4d9",
"name" : "highway-69ca",
"cidr" : "192.168.0.0/16",
"status" : "ACTIVE",
"gateway_ip" : "192.168.0.1",
"subnet_id" : "164d8d6f-6669-421a-bc3f-a03c91b7d85e"
},
"ipv6" : {
"id" : "a3488d1d-e134-4f69-b1a7-fe227ae0e4d9",
"name" : "highway-69ca",
"cidr" : "fc00::/64",
"status" : "ACTIVE",
"gateway_ip" : "fc00::1",
"subnet_id" : "41b4d26d-61d9-4f4e-a11a-6346ae4da9a4"
},
"gateway_ipv6" : "fc00::1",
"cidr_v6" : "fc00::/64",
"name" : "highway-69ca",
"cidr" : "192.168.0.0/16",
"id" : "a3488d1d-e134-4f69-b1a7-fe227ae0e4d9",
"status" : "ACTIVE",
"gateway_ip" : "192.168.0.1"
}
Status code: 400
The server failed to process the request.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 62
Bare Metal Server (BMS)
API Reference 4 API Reference

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes
Status Description
Code

201 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.4.2 Querying High-Speed Networks

Function
This API is used to query all created high-speed networks.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 63
Bare Metal Server (BMS)
API Reference 4 API Reference

Constraints
This API can be used only when centralized bare metal gateways (BMGWs) are
deployed.

URI
GET /v1/{project_id}/baremetalservers/subnets

Table 4-74 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.


Request Parameters

Table 4-75 Request header parameters
Parameter Mandatory Type Description

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
Status code: 200

Table 4-76 Response body parameters
Parameter Type Description

subnets Array of Subnets of the high-speed network.
query_subnet
objects



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 64
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-77 query_subnet
Parameter Type Description

id String High-speed network ID.

name String High-speed network name.

cidr String Subnet CIDR block of the high-speed network.

status String Subnet status of the high-speed network.

gateway_ip String Subnet gateway of the high-speed network.

subnet_id String Subnet ID of the high-speed network.


Status code: 400

Table 4-78 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.


Table 4-79 error
Parameter Type Description

message String Job error message.

code String Job error code.


Example Requests
None

Example Responses
Status code: 200
The request is successful.

{
"subnets" : [ {
"id" : "5bb9f9f5-86a5-41a7-a6cb-9009e78de9f4",
"name" : "highway-d879",
"cidr" : "192.168.60.0/24",
"status" : "ACTIVE",
"subnet_id" : "897cfd58-c440-4ceb-85b3-e9f3ded25304",
"gateway_ip" : "192.168.60.1"
}, {
"id" : "5bb9f9f5-86a5-41a7-a6cb-9009e78de9f4",
"name" : "highway-d879",

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 65
Bare Metal Server (BMS)
API Reference 4 API Reference

"cidr" : "fc00:60::/64",
"status" : "ACTIVE",
"subnet_id" : "a25a6717-a628-4328-972d-bb40f3e6b784",
"gateway_ip" : "fc00:60::1"
} ]
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The request is successful.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 66
Bare Metal Server (BMS)
API Reference 4 API Reference

4.4.3 Modifying a High-Speed Network

Function
This API is used to change the display name of a high-speed network. API v2 is
recommended. For details, see section "Modifying a High-Speed Network (v2)."

Constraints
This API can be used only when centralized BMGWs are deployed.

URI
PUT /v1/{project_id}/baremetalservers/subnets/{subnet_id}

Table 4-80 Path Parameters

Parameter Mandatory Type Description

project_id Yes String Project ID.

subnet_id Yes String ID of the high-speed network.
For details, see section
"Querying High-Speed
Networks."



Request Parameters

Table 4-81 Request header parameters

Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 67
Bare Metal Server (BMS)
API Reference 4 API Reference



Table 4-82 Request body parameters

Parameter Mandatory Type Description

subnet Yes modify_subn High-speed network.
et object



Table 4-83 modify_subnet

Parameter Mandatory Type Description

name Yes String High-speed network name.
The value is a string of 1 to 64
characters that can contain
only Chinese characters, digits,
letters, underscores (_), and
hyphens (-).



Response Parameters

Status code: 200

Table 4-84 Response body parameters

Parameter Type Description

subnet modify_subn High-speed network.
et_response
object



Table 4-85 modify_subnet_response

Parameter Type Description

network_id String High-speed network ID.

name String High-speed network name.

cidr String Subnet CIDR block of the high-speed network.

id String Subnet ID of the high-speed network.

enable_dhcp Boolean Whether to enable DHCP for the high-speed
network subnet.

dns_nameserv Array of IP address of DNS server on the high-speed
ers strings network subnet.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 68
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Type Description

allocation_po Array of Subnet address pool of the high-speed
ols allocation_po network.
ols objects

host_routes Array of Host route of the high-speed network subnet.
strings

ip_version String Subnet IP version of the high-speed network.

gateway_ip String Subnet gateway of the high-speed network.

tenant_id String Tenant ID.



Table 4-86 allocation_pools

Parameter Type Description

start String Start IP address of the high-speed network
segment.

end String End IP address of the high-speed network
segment.



Status code: 400

Table 4-87 Response body parameters

Parameter Type Description

error error object Message returned if a job submission error
occurs.



Table 4-88 error

Parameter Type Description

message String Job error message.

code String Job error code.



Example Requests
{
"subnet" : {
"name" : "highway-a78d_new"
}
}

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 69
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Responses

Status code: 200

The request is successful.

{
"subnet" : {
"name" : "highway-d879-modify",
"cidr" : "fc00:60::/64",
"id" : "a25a6717-a628-4328-972d-bb40f3e6b784",
"enable_dhcp" : true,
"network_id" : "5bb9f9f5-86a5-41a7-a6cb-9009e78de9f4",
"tenant_id" : "4a0df56b626644cf9f9da95c40a89084",
"dns_nameservers" : [ ],
"allocation_pools" : [ {
"start" : "fc00:60::2",
"end" : "fc00:60::ffff:ffff:ffff:ffff"
} ],
"host_routes" : [ ],
"ip_version" : 6,
"gateway_ip" : "fc00:60::1"
}
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The request is successful.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 70
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.4.4 Deleting a High-Speed Network

Function
This API is used to delete a high-speed network.

Constraints
This API can be used only when centralized BMGWs are deployed.

URI
DELETE /v1/{project_id}/baremetalservers/subnets/{subnet_id}

Table 4-89 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.

subnet_id Yes String ID of the high-speed network.
For details, see section
"Querying High-Speed
Networks."




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 71
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-90 Request header parameters
Parameter Mandatory Type Description

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
Status code: 400

Table 4-91 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.


Table 4-92 error
Parameter Type Description

message String Job error message.

code String Job error code.


Example Requests
None

Example Responses
Status code: 400

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 72
Bare Metal Server (BMS)
API Reference 4 API Reference

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

204 No content.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.



4.4.5 Adding a NIC

Function

This API is used to add a NIC to a created BMS.

Constraints

The NIC and the BMS must belong to the same VPC.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 73
Bare Metal Server (BMS)
API Reference 4 API Reference

URI
POST /v1/{project_id}/baremetalservers/{server_id}/nics

Table 4-93 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.

server_id Yes String BMS ID.


Request Parameters

Table 4-94 Request header parameters
Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.


Table 4-95 Request body parameters
Parameter Mandatory Type Description

nics Yes Array of nic NIC list.
objects




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 74
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-96 nic
Parameter Mandatory Type Description

subnet_id Yes String Subnet ID. For details, see
"VPC" > "Subnet combination
interface" > "Query subnet
list" in Virtual Private Cloud
(VPC) 8.3.0 API Reference (for
Huawei Cloud Stack 8.3.0) in
Virtual Private Cloud (VPC)
8.3.0 Usage Guide (for Huawei
Cloud Stack 8.3.0), and add
the query parameter vpc to
the URL to query subnets of
the specified VPC. The subnet
and the BMS must belong to
the same VPC.

ip_address No String Subnet IPv4 address. If IPv4 is
used, select an unused IPv4
address from the subnet
indicated by subnet_id. If this
parameter is left blank or is
set to an empty string, an
unused IP address will be
automatically assigned.

ip_address_v6 No String Subnet IPv6 address. If IPv6 is
used, select an unused IPv6
address from the subnet
indicated by subnet_id. If this
parameter is left blank or is
set to an empty string, an
unused IP address will be
automatically assigned.

security_grou Yes Array of (Mandatory) IDs of security
ps pg_id objects groups bound to the NIC.


Table 4-97 pg_id
Parameter Mandatory Type Description

id Yes String Security group ID.


Response Parameters
Status code: 200


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 75
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-98 Response body parameters
Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).


Status code: 400

Table 4-99 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.


Table 4-100 error
Parameter Type Description

message String Job error message.

code String Job error code.


Example Requests
{
"nics" : [ {
"subnet_id" : "23f5faad-0cbd-4247-817e-0ed6030c23d0",
"security_groups" : [ {
"id" : "018d2ddf-fbaa-44b9-a56b-1d44ba9d1e58"
} ]
} ]
}

Example Responses
Status code: 200
The job is delivered.

{
"job_id" : "70a599e0-31e7-49b7-b260-868f441e862b"
}
Status code: 400
The server failed to process the request.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 76
Bare Metal Server (BMS)
API Reference 4 API Reference

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes
Status Description
Code

200 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.4.6 Deleting a NIC

Function
This API is used to delete a NIC that has been attached to a BMS.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 77
Bare Metal Server (BMS)
API Reference 4 API Reference

URI
POST /v1/{project_id}/baremetalservers/{server_id}/nics/delete

Table 4-101 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.

server_id Yes String BMS ID.


Request Parameters

Table 4-102 Request header parameters
Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.


Table 4-103 Request body parameters
Parameter Mandatory Type Description

nics Yes Array of NIC list.
delete_nic
objects




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 78
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-104 delete_nic
Parameter Mandatory Type Description

id Yes String NIC ID. Obtain the value of
port_id in the response. For
details, see "NIC
Management" > "Querying
NIC Information About an
ECS" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for
Huawei Cloud Stack 8.3.0) in
Elastic Cloud Server (ECS)
8.3.0 Usage Guide (for Huawei
Cloud Stack 8.3.0).


Response Parameters
Status code: 200

Table 4-105 Response body parameters
Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).


Status code: 400

Table 4-106 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.


Table 4-107 error
Parameter Type Description

message String Job error message.

code String Job error code.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 79
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Requests
{
"nics" : [ {
"id" : "f2a9cfd3-2203-4541-a200-172cbf33f0a6"
} ]
}

Example Responses

Status code: 200

The job is delivered.

{
"job_id" : "70a599e0-31e7-49b7-b260-868f441e862b"
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 80
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.



4.4.7 Querying NICs of a BMS (Community-Compatible API)

Function
This API is used to query NICs of a BMS. It is compatible with the v2 API. When
calling community-compatible APIs, use the ECS service endpoint.

URI
GET /v2.1/{project_id}/servers/{server_id}/os-interface

Table 4-108 Path Parameters

Parameter Mandatory Type Description

server_id Yes String BMS ID.

project_id Yes String Project ID.



Request Parameters

Table 4-109 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 81
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Response Parameters
Status code: 200

Table 4-110 Response body parameters

Parameter Type Description

interfaceAttac Array of BMS NICs.
hments interfaceAtta
chment-
R_Rep objects



Table 4-111 interfaceAttachment-R_Rep

Parameter Type Description

mac_addr String MAC address of the NIC.

net_id String ID of the network to which the NIC port
belongs.

port_id String NIC port ID.

port_state String NIC port status.

fixed_ips fixed_ip- Information about the private IP address of the
R_Rep object NIC.



Table 4-112 fixed_ip-R_Rep

Parameter Type Description

ip_address String Private IP address of the NIC.

subnet_id String Subnet mapping to the private IP address of
the NIC.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 82
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Requests
None

Example Responses
Status code: 200

The request is successful.

{
"interfaceAttachments" : [ {
"port_state" : "ACTIVE",
"fixed_ips" : [ {
"subnet_id" : "f360d942-119b-4a37-abd2-b2595a951f91",
"ip_address" : "192.168.1.2"
} ],
"port_id" : "1e48ef46-c26d-447b-89d2-a793ebd1e366",
"net_id" : "a31544fc-1511-4925-912b-bd0660048dae",
"mac_addr" : "fa:16:3e:c6:ed:c7"
}, {
"port_state" : "ACTIVE",
"fixed_ips" : [ {
"subnet_id" : "5a845a1c-ad5e-4e91-a3c3-995fee2dbe9e",
"ip_address" : "192.168.2.2"
} ],
"port_id" : "81c153ab-8753-47a1-9983-743e682ebd10",
"net_id" : "3006706b-2617-4062-b9fe-1bebbc4fd48d",
"mac_addr" : "fa:16:3e:c5:ad:69"
}, {
"port_state" : "ACTIVE",
"fixed_ips" : [ {
"subnet_id" : "6196dbe0-6420-42de-86b4-ccb48b4bddfa",
"ip_address" : "192.168.3.2"
} ],
"port_id" : "fdf9f782-0191-4021-a4ba-e5781ec0230e",
"net_id" : "ddab6e80-4e62-431e-92fa-8b893b2ca255",
"mac_addr" : "fa:16:3e:21:a5:ae"
} ]
}

Status Codes

Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

503 Failed to complete the request because the service is unavailable.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 83
Bare Metal Server (BMS)
API Reference 4 API Reference



4.4.8 Modifying a High-Speed Network (v2)

Function

This API is used to change the display name of a high-speed network.

Constraints

This API can be used only when centralized BMGWs are deployed.

URI

POST /v2/{project_id}/baremetalservers/networks/{network_id}

Table 4-113 Path Parameters

Parameter Mandatory Type Description

network_id Yes String ID of the high-speed network.
For details, see section
"Querying High-Speed
Networks."

project_id Yes String Project ID.



Request Parameters

Table 4-114 Request header parameters

Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 84
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.



Table 4-115 Request body parameters

Parameter Mandatory Type Description

network Yes modify_subn High-speed network.
et object



Table 4-116 modify_subnet

Parameter Mandatory Type Description

name Yes String High-speed network name.
The value is a string of 1 to 64
characters that can contain
only Chinese characters, digits,
letters, underscores (_), and
hyphens (-).



Response Parameters

Status code: 200

Table 4-117 Response body parameters

Parameter Type Description

network network High-speed network.
object



Table 4-118 network

Parameter Type Description

id String High-speed network ID.

name String High-speed network name.

admin_state_ Boolean High-speed network management status.
up


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 85
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Type Description

created_at String Time when the high-speed network was
created.

description String Description of the high-speed network.

mtu Integer MTU of the high-speed network.

availability_zo Array of AZs available to this network. The current
ne_hints strings version does not support cross-AZ network
scheduling. An empty list is returned.

availability_zo Array of AZs of this network. An empty list is returned.
nes strings

provider:netw String Physical network type of the high-speed
ork_type network.
Default: geneve

provider:segm Integer VNI of the high-speed network.
entation_id

router:externa Boolean Whether the network is an external one.
l Default: false

shared Boolean Whether the network can be shared by
different tenants.
Default: false

status String Network status, which can be ACTIVE, BUILD,
DOWN, or ERROR.
Enumeration values:
● ACTIVE
● BUILD
● DOWN
● ERROR

subnets Array of Subnet IDs of the high-speed network.
strings

updated_at String Time when the high-speed network was
updated.

project_id String Project ID.

tenant_id String Tenant ID.


Status code: 400


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 86
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-119 Response body parameters

Parameter Type Description

error error object Message returned if a job submission error
occurs.



Table 4-120 error

Parameter Type Description

message String Job error message.

code String Job error code.



Example Requests
{
"network" : {
"name" : "highway-a78d_new"
}
}

Example Responses

Status code: 200

The request is successful.

{
"network" : {
"id" : "5bb9f9f5-86a5-41a7-a6cb-9009e78de9f4",
"name" : "highway-a78d_new",
"status" : "ACTIVE",
"shared" : false,
"subnets" : [ "897cfd58-c440-4ceb-85b3-e9f3ded25304", "a25a6717-a628-4328-972d-bb40f3e6b784" ],
"description" : "",
"mtu" : 1450,
"availability_zone_hints" : [ ],
"availability_zones" : [ ],
"admin_state_up" : true,
"tenant_id" : "4a0df56b626644cf9f9da95c40a89084",
"provider:network_type" : "geneve",
"provider:segmentation_id" : "15733556",
"router:external" : false,
"created_at" : "2019-04-09T12:58:42",
"updated_at" : "2019-04-09T13:31:08",
"project_id" : "4a0df56b626644cf9f9da95c40a89084"
}
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 87
Bare Metal Server (BMS)
API Reference 4 API Reference

}
}

Status Codes

Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.



4.4.9 Creating an IPv6 Subnet for a High-Speed Network

Function

This API is used to add an IPv6 subnet for an existing high-speed network.

Constraints

This API can be used only when centralized BMGWs are deployed.

URI

POST /v2/{project_id}/baremetalservers/subnets

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 88
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-121 Path Parameters

Parameter Mandatory Type Description

project_id Yes String Project ID.



Request Parameters

Table 4-122 Request header parameters

Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.
Default:
e9993fc787d94b6c886cbaa34
0f9c0f4



Table 4-123 Request body parameters

Parameter Mandatory Type Description

subnet Yes IPv6_subnet_ IPv6 subnet of the high-speed
create_reque network.
st object



Table 4-124 IPv6_subnet_create_request

Parameter Mandatory Type Description

network_id Yes String High-speed network ID.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 89
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

cidr Yes String IPv6 subnet CIDR block of the
high-speed network.

name No String Name of the high-speed
network, which must be the
same as that of the existing
high-speed network.



Response Parameters

Status code: 200

Table 4-125 Response body parameters

Parameter Type Description

subnet subnet_2 IPv6 subnet of the high-speed network.
object



Table 4-126 subnet_2

Parameter Type Description

network_id String High-speed network ID.

name String High-speed network name.

allocation_po Array of IPv6 subnet address pool of the high-speed
ols allocation_po network.
ols objects

host_routes Array of Static VM routes
host_routes
objects

cidr String IPv6 subnet CIDR block of the high-speed
network.

enable_dhcp Boolean Whether to enable DHCP for the high-speed
network IPv6 subnet.

gateway_ip String IPv6 subnet gateway of the high-speed
network.

id String IPv6 subnet ID of the high-speed network.

ip_version Integer Subnet IP version of the high-speed network.
Default: 6

tenant_id String Tenant ID.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 90
Bare Metal Server (BMS)
API Reference 4 API Reference



Table 4-127 allocation_pools
Parameter Type Description

start String Start IP address of the high-speed network
segment.

end String End IP address of the high-speed network
segment.


Table 4-128 host_routes
Parameter Type Description

destination String Destination subnet IP address of the route.

nexthop String Next hop of the route.


Status code: 400

Table 4-129 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.


Table 4-130 error
Parameter Type Description

message String Job error message.

code String Job error code.


Example Requests
{
"subnet": {
cidr: "fc00:0:0:0:0:0:0:0/64",
name: "highway-98f9",
network_id: "df0b1235-75d0-4e53-9866-5c3c4643d3c1"
}
}


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 91
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Responses

Status code: 200

The request is successful.

{
"subnet" : {
"name" : "highway-a78d_new",
"cidr" : "fc00:70::/64",
"id" : "96002da4-f9a2-471e-a62a-32ab763492ec",
"enable_dhcp" : true,
"network_id" : "5bb9f9f5-86a5-41a7-a6cb-9009e78de9f4",
"tenant_id" : "4a0df56b626644cf9f9da95c40a89084",
"dns_nameservers" : [ ],
"allocation_pools" : [ {
"start" : "fc00:70::2",
"end" : "fc00:70::ffff:ffff:ffff:ffff"
} ],
"host_routes" : [ ],
"ip_version" : 6,
"gateway_ip" : "fc00:70::1"
}
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 92
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

500 Failed to complete the request because of an internal service error.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.4.10 Deleting an IPv6 Subnet from a High-Speed Network

Function
This API is used to delete an IPv6 subnet from an existing high-speed network.

Constraints
This API can be used only when centralized BMGWs are deployed.

URI
DELETE /v2/{project_id}/baremetalservers/subnets/{subnet_id}

Table 4-131 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.

subnet_id Yes String IPv6 subnet ID. For details, see
section "Querying High-Speed
Networks." If the value of cidr
for the high-speed network
subnet is an IPv6 address in
CIDR format, the high-speed
network subnet is the IPv6
subnet, and the value of
subnet_id is the IPv6 subnet
ID.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 93
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-132 Request header parameters
Parameter Mandatory Type Description

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
Status code: 400

Table 4-133 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.


Table 4-134 error
Parameter Type Description

message String Job error message.

code String Job error code.


Example Requests
None

Example Responses
Status code: 400

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 94
Bare Metal Server (BMS)
API Reference 4 API Reference

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes
Status Description
Code

204 No content.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.4.11 Querying Information About a Specified BMS NIC
(Community-Compatible API)

Function
This API is used to query information about a BMS NIC based on the NIC ID. When
calling community-compatible APIs, use the ECS service endpoint.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 95
Bare Metal Server (BMS)
API Reference 4 API Reference

URI
GET /v2/{project_id}/servers/{server_id}/os-interface/{id}

Table 4-135 Path Parameters
Parameter Mandatory Type Description

server_id Yes String BMS ID.

id Yes String NIC port ID.

project_id Yes String Project ID.


Request Parameters

Table 4-136 Request header parameters
Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
Status code: 200


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 96
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-137 Response body parameters

Parameter Type Description

interfaceAttac interfaceAtta BMS NIC information.
hment chment-
R_Rep object



Table 4-138 interfaceAttachment-R_Rep

Parameter Type Description

mac_addr String MAC address of the NIC.

net_id String ID of the network to which the NIC port
belongs.

port_id String NIC port ID.

port_state String NIC port status.

fixed_ips fixed_ip- Information about the private IP address of the
R_Rep object NIC.



Table 4-139 fixed_ip-R_Rep

Parameter Type Description

ip_address String Private IP address of the NIC.

subnet_id String Subnet mapping to the private IP address of
the NIC.



Example Requests
None

Example Responses
Status code: 200
The request is successful.

{
"interfaceAttachment" : {
"port_state" : "ACTIVE",
"fixed_ips" : [ {
"subnet_id" : "f8a6e8f8-c2ec-497c-9f23-da9616de54ef",
"ip_address" : "192.168.1.3"
} ],
"net_id" : "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
"port_id" : "ce531f90-199f-48c0-816c-13e38010b442",
"mac_addr" : "fa:16:3e:4c:2c:30"

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 97
Bare Metal Server (BMS)
API Reference 4 API Reference

}
}

Status Codes
Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.


4.5 BMS Disk Management

4.5.1 Attaching an EVS Disk

Function
This API is used to attach an EVS disk to a created BMS.

Constraints
The EVS disk to be attached and the target BMS must be in the same AZ.

URI
POST /v1/{project_id}/baremetalservers/{server_id}/attachvolume

Table 4-140 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.

server_id Yes String BMS ID.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 98
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-141 Request header parameters
Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.


Table 4-142 Request body parameters
Parameter Mandatory Type Description

volumeAttach Yes volumeAttac EVS disk.
ment hment object




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 99
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-143 volumeAttachment
Parameter Mandatory Type Description

volumeId Yes String ID of the EVS disk. For details,
see "EVS Disk APICom" >
"Querying Details of All EVS
Disks" in Elastic Volume
Service (EVS) 8.3.0 API
Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Volume
Service (EVS) 8.3.0 Usage
Guide (for Huawei Cloud
Stack 8.3.0), and add the
query parameter
availability_zone to the URL.
The value of availability_zone
is the AZ where the BMS is
located. Select the EVS disk
whose hw:passthrough is true
in metadata.


Response Parameters
Status code: 200

Table 4-144 Response body parameters
Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).


Status code: 400

Table 4-145 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 100
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-146 error

Parameter Type Description

message String Job error message.

code String Job error code.



Example Requests
{
"volumeAttachment" : {
"volumeId" : "c9ebddb51209403f8036611e0c166f0d"
}
}

Example Responses

Status code: 200

The job is delivered.

{
"job_id" : "70a599e0-31e7-49b7-b260-868f441e862b"
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 101
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.5.2 Detaching an EVS Disk

Function
This API is used to detach an EVS disk from a BMS.

URI
DELETE /v1/{project_id}/baremetalservers/{server_id}/detachvolume/{volume_id}

Table 4-147 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.

server_id Yes String BMS ID.

volume_id Yes String EVS disk ID. For details about
how to view information
about EVS disks attached to
the BMS, see section
"Querying Disks of a BMS."




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 102
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-148 Request header parameters
Parameter Mandatory Type Description

Content-type Yes String MIME type of a request body.
Default: application/json
Enumeration values:
● application/json

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.
Default:
e9993fc787d94b6c886cbaa34
0f9c0f4

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
Status code: 200

Table 4-149 Response body parameters
Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).


Status code: 400


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 103
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-150 Response body parameters

Parameter Type Description

error error object Message returned if a job submission error
occurs.



Table 4-151 error

Parameter Type Description

message String Job error message.

code String Job error code.



Example Requests

None

Example Responses

Status code: 200

The job is delivered.

{
"job_id" : "70a599e0-31e7-49b7-b260-868f441e862b"
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 104
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.


4.5.3 Attaching Shared EVS Disks in Batches

Function
This API is used to batch attach shared EVS disks to a created BMS.

Constraints
The shared EVS disks and the target BMS must be in the same AZ.

URI
POST /v1/{project_id}/bmsbatchaction/attachvolumes/{volume_id}

Table 4-152 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 105
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

volume_id Yes String ID of the shared EVS disk. For
details, see "EVS Disk APICom"
> "Querying Details of All EVS
Disks" in Elastic Volume
Service (EVS) 8.3.0 API
Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Volume
Service (EVS) 8.3.0 Usage
Guide (for Huawei Cloud
Stack 8.3.0), and add the
query parameter
availability_zone to the URL.
The value of availability_zone
is the AZ where the BMS is
located. If the values of the
parameters multiattach and
shareable in the response are
both true, the EVS disk is a
shared disk.


Request Parameters

Table 4-153 Request header parameters
Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.
Default: 3495

Content-type Yes String MIME type of a request body.
Enumeration values:
● application/json

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.

X-Project-Id No String Project ID, which is used to
obtain tokens for different
projects.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 106
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-154 Request body parameters
Parameter Mandatory Type Description

serverinfo Yes Array of BMS IDs.
serverinfo
objects


Table 4-155 serverinfo
Parameter Mandatory Type Description

server_id Yes String BMS ID.


Response Parameters
Status code: 200

Table 4-156 Response body parameters
Parameter Type Description

job_id String Job ID returned after the job is delivered. The
job ID can be used to query the job execution
status. For details, see "Querying Job Status" >
"Querying Job Status" in Elastic Cloud Server
(ECS) 8.3.0 API Reference (for Huawei Cloud
Stack 8.3.0) in Elastic Cloud Server (ECS) 8.3.0
Usage Guide (for Huawei Cloud Stack 8.3.0).


Status code: 400

Table 4-157 Response body parameters
Parameter Type Description

error error object Message returned if a job submission error
occurs.


Table 4-158 error
Parameter Type Description

message String Job error message.

code String Job error code.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 107
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Requests
{
"serverinfo" : [ {
"server_id" : "e12f803d-d957-46ec-b38d-0ea01aa83239"
}, {
"server_id" : "a5fa7f64-11b5-481c-bd0c-a1af3838d9f6"
} ]
}

Example Responses

Status code: 200

The job is delivered.

{
"job_id" : "70a599e0-31e7-49b7-b260-868f441e862b"
}

Status code: 400

The server failed to process the request.

{
"error" : {
"message" : "Bad Request",
"code" : "BMS.0010"
}
}

Status Codes

Status Description
Code

200 The job is delivered.

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

405 You are not allowed to use the method specified in the request.

406 The response generated by the server could not be accepted by the
client.

407 You must use the proxy server for authentication so that the
request can be processed.

408 The request timed out.

409 The request could not be processed due to a conflict.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 108
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

500 Failed to complete the request because of an internal service error.

501 Failed to complete the request because the server does not support
the requested function.

502 Failed to complete the request because the server has received an
invalid response.

503 Failed to complete the request because the service is unavailable.

504 A gateway timeout error occurred.



4.5.4 Querying Disks of a BMS (Community-Compatible API)

Function
This API is used to query disks attached to a BMS. When calling community-
compatible APIs, use the ECS service endpoint.

URI
GET /v2/{project_id}/servers/{server_id}/os-volume_attachments

Table 4-159 Path Parameters

Parameter Mandatory Type Description

server_id Yes String BMS ID.

project_id Yes String Project ID.



Request Parameters

Table 4-160 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 109
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
Status code: 200

Table 4-161 Response body parameters
Parameter Type Description

volumeAttach volumeAttac Information about EVS disks attached to the
ments hment-R_Rep BMS.
object


Table 4-162 volumeAttachment-R_Rep
Parameter Type Description

id String ID of the attached resource.

serverId String ID of the BMS to which the disk is attached.

volumeId String ID of the attached disk.


Example Requests
None

Example Responses
None


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 110
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Codes
Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.


4.5.5 Querying Information About a Disk Attached to a BMS
(Community-Compatible API)

Function
This API is used to query information about a disk attached to a BMS based on the
disk ID. When calling community-compatible APIs, use the ECS service endpoint.

URI
GET /v2/{project_id}/servers/{server_id}/os-volume_attachments/{volume_id}

Table 4-163 Path Parameters
Parameter Mandatory Type Description

server_id Yes String BMS ID.

volume_id Yes String Disk ID.

project_id Yes String Project ID.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 111
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-164 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Response Parameters

Status code: 200

Table 4-165 Response body parameters

Parameter Type Description

volumeAttach volumeAttac Information about an EVS disk attached to the
ment hment-R_Rep BMS.
object



Table 4-166 volumeAttachment-R_Rep

Parameter Type Description

id String ID of the attached resource.

serverId String ID of the BMS to which the disk is attached.

volumeId String ID of the attached disk.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 112
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Requests

None

Example Responses

Status code: 200

The request is successful.

{
"volumeAttachment" : {
"id" : "a26887c6-c47b-4654-abb5-dfadf7d3f803",
"serverId" : "2390fb4d-1693-45d7-b309-e29c4af16538",
"volumeId" : "a26887c6-c47b-4654-abb5-dfadf7d3f803"
}
}

Status Codes

Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.



4.6 BMS SSH Key Pair Management

4.6.1 Creating and Importing an SSH Key Pair (Community-
Compatible API)

Function

This API is used to create an SSH key pair or import a public key to generate a key
pair. It is compatible with the v2 API. After an SSH key pair is created, download
the private key to a local directory. Then, you can use this private key to log in to
a BMS. To ensure BMS security, the private key can be downloaded only once.
Keep it secure. When calling community-compatible APIs, use the ECS service
endpoint. Note: The microversion of this API is requested using the X-OpenStack-
Nova-API-Version header.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 113
Bare Metal Server (BMS)
API Reference 4 API Reference

Constraints

The specified version number is 2.60.

URI

POST /v2.1/{project_id}/os-keypairs

Table 4-167 Path Parameters

Parameter Mandatory Type Description

project_id Yes String Project ID.



Request Parameters

Table 4-168 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Table 4-169 Request body parameters

Parameter Mandatory Type Description

keypair Yes keypair- Information about the created
C_Req object or imported SSH key pair.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 114
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-170 keypair-C_Req

Parameter Mandatory Type Description

public_key No String Information about the public
key in the key pair.

type No String Key pair type, which can be
ssh or x509. This parameter is
supported in microversion 2.2.

user_id No String ID of the user to which the
key pair belongs.

name Yes String Key pair name. The new key
pair name cannot be the same
as an existing one.



Response Parameters

Status code: 200

Table 4-171 Response body parameters

Parameter Type Description

keypair keypair- Information about the SSH key pair.
C_Rep object



Table 4-172 keypair-C_Rep

Parameter Type Description

fingerprint String Fingerprint information about the key pair.

name String Key pair name.

private_key String Information about the private key in the key
pair. The information about the private key is
contained in the response for creating an SSH
key pair. The information about the private key
is not contained in the response for importing
an SSH key pair.

public_key String Information about the public key in the key
pair.

type String Key pair type, which can be ssh or x509. This
parameter is supported in microversion 2.2.

user_id String ID of the user to which the key pair belongs.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 115
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Requests
{
"keypair" : {
"public_key" : "ssh-
rsaAAAAB3NzaC1yc2EAAAADAQABAAABAQDWNgTxQYeBzK9LYy4IakX7IsIl5j5zqR6BU2GJaEg3RK6dlS7rKFQh
vy/V/1emK+GT/7P8up9VsMZ9Dx6PBOLow5p+2/wGsMlwDJpWiQ8zNnEMg+u/Ar/
ZhYHAMyKEAOOJxIcnPoUgxfNdj/eiXV98AabsBdUA7QD30Og8F4Bmn2lii/
WD9KbQQVjb7kbB3gNIJpGTUcoX73arorqkq/ppaLRmmwMJ7bTIGl8/0MWU2Dy+eTByOaDMb2htbB
+j8ZXyEu7Oooy0NaSd+PNHv3PZ9OIVO7gd1lyoTRvCMK/
F346+zmZtk5EASSOx5RifnSwk3NtugVjXs9GMJfFLBRibGenerated-by-Nova\\n\n",
"type" : "ssh",
"name" : "demo1",
"user_id" : "fake"
}
}

Example Responses
Status code: 200
The request is successful.

{
"keypair" : {
"public_key" : "ssh-
rsaAAAAB3NzaC1yc2EAAAADAQABAAABAQDWNgTxQYeBzK9LYy4IakX7IsIl5j5zqR6BU2GJaEg3RK6dlS7rKFQh
vy/V/1emK+GT/7P8up9VsMZ9Dx6PBOLow5p+2/wGsMlwDJpWiQ8zNnEMg+u/Ar/
ZhYHAMyKEAOOJxIcnPoUgxfNdj/eiXV98AabsBdUA7QD30Og8F4Bmn2lii/
WD9KbQQVjb7kbB3gNIJpGTUcoX73arorqkq/ppaLRmmwMJ7bTIGl8/0MWU2Dy+eTByOaDMb2htbB
+j8ZXyEu7Oooy0NaSd+PNHv3PZ9OIVO7gd1lyoTRvCMK/
F346+zmZtk5EASSOx5RifnSwk3NtugVjXs9GMJfFLBRibGenerated-by-Nova\\n",
"type" : "ssh",
"name" : "demo1",
"user_id" : "fake"
}
}

Status Codes
Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 116
Bare Metal Server (BMS)
API Reference 4 API Reference

4.6.2 Querying SSH Key Pairs (Community-Compatible API)

Function

This API is used to query SSH key pairs. It is compatible with the API of version 2
(v2). When calling community-compatible APIs, use the ECS service endpoint.

URI

GET /v2.1/{project_id}/os-keypairs

Table 4-173 Path Parameters

Parameter Mandatory Type Description

project_id Yes String Project ID.



Request Parameters

Table 4-174 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Response Parameters

Status code: 200

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 117
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-175 Response body parameters

Parameter Type Description

keypairs keypairs- keypairs-R_Rep
R_Rep object



Table 4-176 keypairs-R_Rep

Parameter Type Description

fingerprint String Fingerprint information about the key pair.

name String Key pair name.

public_key String Information about the public key in the key
pair.



Example Requests

None

Example Responses

Status code: 200

The request is successful.

{
"keypairs" : [ {
"keypair" : {
"fingerprint" : "15:b0:f8:b3:f9:48:63:71:cf:7b:5b:38:6d:44:2d:4a",
"name" : "keypair-601a2305-4f25-41ed-89c6-2a966fc8027a",
"public_key" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC+Eo/
RZRngaGTkFs7I62ZjsIlO79KklKbMXi8F+KITD4bVQHHn+kV
+4gRgkgCRbdoDqoGfpaDFs877DYX9n4z6FrAIZ4PES8TNKhatifpn9NdQYWA+IkU8CuvlEKGuFpKRi/k7JLos/
gHi2hy7QUwgtRvcefvD/vgQZOVw/mGR9Q== Generated-by-Nova"
}
} ]
}

Status Codes

Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 118
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.


4.6.3 Querying an SSH Key Pair (Community-Compatible API)

Function
This API is used to query a specified SSH key pair based on the SSH key pair name.
When calling community-compatible APIs, use the ECS service endpoint.

URI
GET /v2/{project_id}/os-keypairs/{keypair_name}

Table 4-177 Path Parameters
Parameter Mandatory Type Description

keypair_name Yes String Key pair name.

project_id Yes String Project ID.


Request Parameters

Table 4-178 Request header parameters
Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 119
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
Status code: 200

Table 4-179 Response body parameters
Parameter Type Description

keypair keypair- Information about the SSH key pair.
R_Rep object


Table 4-180 keypair-R_Rep
Parameter Type Description

public_key String Information about the public key in the key
pair.

name String Key pair name.

fingerprint String Fingerprint information about the key pair.

created_at String Time when the key pair was created.

deleted String Key pair deletion status. true: indicates that the
key pair has been deleted. false: indicates that
the key pair is not deleted.

deleted_at String Time when the key pair was deleted.

id String Key pair ID.

updated_at String Time when the key pair was updated.

user_id String Information about the user to which the key
pair belongs.


Example Requests
None

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 120
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Responses

Status code: 200

The request is successful.

{
"keypair" : {
"created_at" : "2014-05-07T12:06:13.681238",
"deleted" : false,
"deleted_at" : null,
"fingerprint" : "9d:00:f4:d7:26:6e:52:06:4c:c1:d3:1d:fd:06:66:01",
"id" : 1,
"name" : "keypair-3582d8b7-e588-4aad-b7f7-f4e76f0e4314",
"public_key" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYJrTVpcMwFqQy/
oMvtUSRofZdSRHEwrsX8AYkRvn2ZnCXM+b6+GZ2NQuuWj+ocznlnwiGFQDsL/yeE+/
kurqcPJFKKp60mToXIMyzioFxW88fJtwEWawHKAclbHWpR1t4fQ4DS+/sIbX/Yd9btlVQ2tpQjodGDbM9Tr9/+/
3i6rcR+EoLqmbgCgAiGiVV6VbM2Zx79yUwd+GnQejHX8BlYZoOjCnt3NREsITcmWE9FVFy6TnLmahs3FkEO/
QGgWGkaohAJlsgaVvSWGgDn2AujKYwyDokK3dXyeX3m2Vmc3ejiqPa/C4nRrCOlko5nSgV/
9IXRx1ERImsqZnE9usB Generated-by-Nova",
"updated_at" : null,
"user_id" : "fake"
}
}

Status Codes

Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.



4.6.4 Deleting an SSH Key Pair (Community-Compatible API)

Function

This API is used to delete a specified SSH key pair. When calling community-
compatible APIs, use the ECS service endpoint.

URI

DELETE /v2/{project_id}/os-keypairs/{keypair_name}


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 121
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-181 Path Parameters
Parameter Mandatory Type Description

keypair_name Yes String Key pair name.

project_id Yes String Project ID.


Request Parameters

Table 4-182 Request header parameters
Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
None

Example Requests
None

Example Responses
None


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 122
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Codes
Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.


4.7 BMS Tag Management

4.7.1 Creating Tags for a BMS (Community-Compatible API)

Function
This API is used to replace all tags of a specified BMS with a new tag set. When
calling community-compatible APIs, use the ECS service endpoint.

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

Table 4-183 Path Parameters
Parameter Mandatory Type Description

project_id Yes String Project ID.

server_id Yes String BMS ID.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 123
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-184 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Table 4-185 Request body parameters

Parameter Mandatory Type Description

tags Yes Array of A maximum of 50 tags can be
strings configured, and each tag can
contain up to 80 characters.
Maximum: 80



Response Parameters

Status code: 200

Table 4-186 Response body parameters

Parameter Type Description

tags Array of BMS tags.
strings




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 124
Bare Metal Server (BMS)
API Reference 4 API Reference

Example Requests
{
"tags" : [ "baz", "foo", "qux" ]
}

Example Responses
Status code: 200
The request is successful.

{
"tags" : [ "baz", "foo", "qux" ]
}

Status Codes
Status Description
Code

200 The request is successful.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.


4.7.2 Deleting Tags of a BMS (Community-Compatible API)

Function
This API is used to delete all tags of a BMS. When calling community-compatible
APIs, use the ECS service endpoint.

URI
DELETE /v2.1/{project_id}/servers/{server_id}/tags

Table 4-187 Path Parameters
Parameter Mandatory Type Description

server_id Yes String BMS ID.

project_id Yes String Project ID.



Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 125
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-188 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Response Parameters

None

Example Requests

None

Example Responses

None

Status Codes

Status Description
Code

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

204 The job is delivered.

400 The server failed to process the request.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 126
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.



4.7.3 Querying Tags of a BMS (Community-Compatible API)

Function

This API is used to query all tags of a BMS. When calling community-compatible
APIs, use the ECS service endpoint.

URI

GET /v2.1/{project_id}/servers/{server_id}/tags

Table 4-189 Path Parameters

Parameter Mandatory Type Description

server_id Yes String BMS ID.

project_id Yes String Project ID.



Request Parameters

Table 4-190 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 127
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Response Parameters

Status code: 200

Table 4-191 Response body parameters

Parameter Type Description

tags Array of BMS tags.
strings



Example Requests

None

Example Responses

Status code: 200

The job is delivered.

{
"tags" : [ "baz", "foo", "qux" ]
}

Status Codes

Status Description
Code

200 The job is delivered.

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 128
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.


4.7.4 Deleting a Specified Tag of a BMS (Community-
Compatible API)

Function
This API is used to delete a specified tag of a BMS. When calling community-
compatible APIs, use the ECS service endpoint.

Constraints
A tag can contain a maximum of 80 characters. If a tag contains non-URL-safe
characters, perform URL encoding.

URI
DELETE /v2.1/{project_id}/servers/{server_id}/tags/{tag}

Table 4-192 Path Parameters
Parameter Mandatory Type Description

server_id Yes String BMS ID.

tag Yes String Key of the tag to be deleted. If
no tag key is specified, all tags
of the BMS are deleted.

project_id Yes String Project ID.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 129
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-193 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Response Parameters

None

Example Requests

None

Example Responses

None

Status Codes

Status Description
Code

202 The job has been successfully delivered. However, it will be
postponed because the system is busy currently.

204 The job is delivered.

400 The server failed to process the request.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 130
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Description
Code

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.



4.7.5 Checking for a Specified Tag on a BMS (Community-
Compatible API)

Function

This API is used to check whether a BMS has a specified tag. When calling
community-compatible APIs, use the ECS service endpoint.

URI

GET /v2.1/{project_id}/servers/{server_id}/tags/{tag}

Table 4-194 Path Parameters

Parameter Mandatory Type Description

server_id Yes String BMS ID.

tag Yes String Key of the tag to be queried.

project_id Yes String Project ID.



Request Parameters

Table 4-195 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 131
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.


Response Parameters
None

Example Requests
None

Example Responses
None

Status Codes
Status Description
Code

204 No Content

400 The server failed to process the request.

401 You must enter a username and password to access the requested
page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 132
Bare Metal Server (BMS)
API Reference 4 API Reference

4.7.6 Adding a Tag to a Specified BMS (Community-
Compatible API)

Function
This API is used to add a tag to a BMS. When calling community-compatible APIs,
use the ECS service endpoint.

Constraints
A tag can contain a maximum of 80 characters. It cannot start with a dot (.) or
contain slashes (/) or commas (,). The number of tags supported by each BMS is
limited. (The administrator can adjust the maximum number of the tags. The
default value is 50.) An empty tag cannot be created. A tag can be updated only
when the BMS is running or stopped. This API is used to add a tag to a BMS. The
tag is not displayed on the Tag tab page of the BMS details page on ManageOne
Operation Portal. To display the tag, call the tag creation API /rest/tag/v3.0/tags of
ManageOne.

URI
PUT /v2.1/{project_id}/servers/{server_id}/tags/{tag}

Table 4-196 Path Parameters

Parameter Mandatory Type Description

server_id Yes String BMS ID.

tag Yes String Tag to be added.

project_id Yes String Project ID.



Request Parameters

Table 4-197 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 133
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Mandatory Type Description

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Response Parameters

Status code: 201

Table 4-198 Response body parameters

Parameter Type Description

response tag_Rep Content of status code 201.
object



Table 4-199 tag_Rep

Parameter Type Description

message String Returned message.

code String Returned status code.

title String Title of the response.



Example Requests
# Add tag 'bms_tag_test' to BMS 2a2e93c8-4ba5-4ba4-803f-6f4aa671cb00.
PUT /v2.1/034b5b767bf64858aa39455fd5e7f03c/servers/2a2e93c8-4ba5-4ba4-803f-6f4aa671cb00/
tags/bms_tag_test

Example Responses

Status code: 201

Created

{
"message" : "<br /><br />\n\n\n",
"code" : "201 Created",
"title" : "Created"
}

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 134
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Codes
Status Description
Code

201 Created

400 The server failed to process the request.

401 Authentication failed. You must enter a username and password to
access the requested page.

403 You are forbidden to access the requested page.

404 The server could not find the requested page.

409 The request could not be processed due to a conflict.

500 Failed to complete the request because of an internal service error.

503 Failed to complete the request because the service is unavailable.


4.8 Job Status Query

4.8.1 Querying Job Status

Function
This API is used to query the execution status of a job. After a job, such as
creating, deleting, or restarting a BMS, is issued, a job ID is returned, based on
which you can query the execution status of the job.

URI
GET /v1/{tenant_id}/jobs/{job_id}

Table 4-200 Path Parameters
Parameter Mandatory Type Description

tenant_id Yes String Project ID.

job_id Yes String Job ID.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 135
Bare Metal Server (BMS)
API Reference 4 API Reference

Request Parameters

Table 4-201 Request header parameters

Parameter Mandatory Type Description

Content-Type Yes String MIME type of a request body,
which varies with the flow
type.
Default: application/json
Enumeration values:
● application/json

Content- No String Length of a request body in
Length bytes.

X-Project-Id No String Project ID.

X-Auth-Token Yes String User token. For details, see
"API Reference" > "Token" >
"Obtaining a User Token" in
the ManageOne xxx
OTenantSecurity API Reference
file of ManageOne 8.3.0 API
Reference in Huawei Cloud
Stack 8.3.0 API Reference.



Response Parameters

Status code: 200

Table 4-202 Response body parameters

Parameter Type Description

begin_time String Start time.

code String Error code returned if an error occurs.

end_time String End time.

entities entities Information related to the job. If the job is a
object BMS-related operation, the value is server_id. If
a sub-job is available, details about the sub-job
are displayed.

error_code String Error code returned upon a job execution
failure.

fail_reason String Cause of a job execution failure.

job_id String Job ID.

Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 136
Bare Metal Server (BMS)
API Reference 4 API Reference

Parameter Type Description

job_type String Job type.

message String Error message returned if an error occurs.

status String Job status. SUCCESS: The job was successfully
executed. RUNNING: The job is in progress.
FAIL: The job failed. INIT: The job is being
initialized.


Table 4-203 entities
Parameter Type Description

sub_jobs Array of Execution information about a sub-job. If no
sub_job sub-job exists, the value of this parameter is
objects left empty.

sub_jobs_total Integer Number of sub-jobs. If no sub-job exists, the
value of this parameter is 0.


Table 4-204 sub_job
Parameter Type Description

begin_time String Start time.

end_time String End time.

entities entity object Information related to the job. If the job is a
BMS-related operation, the value is server_id. If
a sub-job is available, details about the sub-job
are displayed.

error_code String Error code returned upon a job execution
failure.

fail_reason String Cause of a job execution failure.

job_id String Job ID.

job_type String Job type.

status String Job status. SUCCESS: The job was successfully
executed. RUNNING: The job is in progress.
FAIL: The job failed. INIT: The job is being
initialized.




Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 137
Bare Metal Server (BMS)
API Reference 4 API Reference

Table 4-205 entity
Parameter Type Description

server_id String If the job is an ECS-related operation, the value
is server_id.


Example Requests
Use the BMS domain name to replace {endpoint} for calling the API.

GET https://{endpoint}/v1/{project_id}/jobs/{job_id}

Example Responses
Status code: 200
The job is being executed. The response parameters vary with the value of
job_type. You can use the response parameters based on the result returned by the
API.

{
"job_id" : "d8e2829484eb4ee20184eb56294b0001",
"job_type" : "baremetalBatchCreate",
"begin_time" : "2022-12-07T06:46:43.009Z",
"end_time" : "",
"status" : "RUNNING",
"error_code" : null,
"fail_reason" : null,
"entities" : {
"sub_jobs_total" : 1,
"sub_jobs" : [ {
"job_id" : "d8e2829484eb4ee20184eb562aa40004",
"job_type" : "baremetalSingleCreate",
"begin_time" : "2022-12-07T06:46:43.611Z",
"end_time" : "",
"status" : "RUNNING",
"error_code" : null,
"fail_reason" : null,
"entities" : { }
} ]
}
}
Status code: 400
The server failed to process the request.

{
"error" : {
"message" : "XXXX",
"code" : "XXX"
}
}


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 138
Bare Metal Server (BMS)
API Reference 4 API Reference

Status Codes
Status Description
Code

200 The job is being executed. The response parameters vary with the
value of job_type. You can use the response parameters based on
the result returned by the API.

400 The server failed to process the request.


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 139
Bare Metal Server (BMS)
API Reference 5 API Changes


5 API Changes


5.1 Change History

5.1.1 Huawei Cloud Stack 8.3.0

New APIs
API URI Description

4.1.1 Creating a POST /v1/{project_id}/ Added the optional
BMS baremetalservers parameter
enterprise_project_id
to the extendparam
field in request
parameters.


Modified APIs
None

Deleted APIs
None

5.2 Deprecation Plan
None


Issue 02 (2023-10-26) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 140
Note: The preview effect may be slightly different from the source document. You can download the document and view it on your PC.