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

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

Querying BMSs (Discarded)

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

Function

This API is used to query BMSs.

This API has been discarded. Use the API in Querying Details About BMSs.

Constraints

  • The query result returned by this API includes both ECSs and BMSs. You need to filter out the BMSs using the flavor used to create the BMSs or the tags added to the BMSs during BMS creation.
  • If the image is used as the search criteria, other search criteria and pagination criteria are not supported. If both the image and other filter criteria are specified, the image filter criterion is used. If the query criteria do not contain the image filter criterion, API functions are not restricted.

URI

GET /v2.1/{project_id}/servers{?changes-since={changes-since}&image={image}&flavor={flavor}&name={name}&status={status}&limit={limit}&marker={marker}&tags={tags}&not-tags={not-tags}&reservation_id={reservation_id}&sort_key={sort_key}&sort_dir={sort_dir}}

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

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

Request Parameters

Parameter

Mandatory

Type

Description

changes-since

No

String

Specifies the timestamp of the last BMS status update. The parameter is in ISO 8601 time format, for example, 2013-06-09T06:42:18Z.

image

No

String

Specifies the image ID.

You can obtain the image ID from the IMS console or by calling the Querying Images API.

NOTE:

If the image is used as the search criteria, other search criteria and pagination criteria are not supported. If both the image and other filter criteria are specified, the image filter criterion is used. If the query criteria do not contain the image filter criterion, API functions are not restricted.

flavor

No

String

Specifies the flavor ID.

You can obtain the flavor ID from the BMS console or using the Querying BMS Flavors (Discarded) API.

name

No

String

Specifies the BMS name. This parameter supports fuzzy matching.

For example, the regular expression ?name=bob will return both bob and bobb. To obtain only bob, you can use a regular expression matching the basic database syntax, such as MySQL or PostgreSQL (official website: https://www.postgresql.org/docs/9.2/static/functions-matching.html).

status

No

String

Specifies the BMS status.

Value range:

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

limit

No

Integer

Specifies the number of BMSs displayed on each page.

marker

No

String

Specifies the BMS ID to which the marker corresponds. The query will start from the next ID.

tags

No

String

Queries the BMSs with specified tags.

Added in micro version 2.26.

not-tags

No

String

Queries the BMSs with tags not containing the specified value. The value is a list of tag keys.

NOTE:

If the tags added before the function upgrade are in the format of "Key.Value", query tags using "Key".

For example, an existing tag is a.b. After the tag function upgrade, query the tag using "not-tags=a".

Added in micro version 2.26.

reservation_id

No

String

Specifies the reserved ID, which can be used to query BMSs created in a batch.

Added in micro version 2.26.

sort_key

No

String

Specifies the BMS sorting attribute, which can be the BMS UUID (uuid), BMS status (vm_state), BMS name (display_name), BMS task status (task_state), power status (power_state), creation time (created_at), last time when the BMS is updated (updated_at), and AZ (availability_zone). You can specify multiple sort_key and sort_dir pairs.

The default sorting is the reverse order by created_at.

sort_dir

No

String

Specifies the sorting direction.

  • asc: The query results are displayed in ascending order.
  • desc (default value): The query results are displayed in descending order.

Example Request

  • Querying BMSs
    1
    GET https://{ECS Endpoint}/v2.1/bbf1946d374b44a0a2a95533562ba954/servers
    
  • Querying BMSs with the __type_baremetal tag
    1
    GET https://{ECS Endpoint}/v2.1/bbf1946d374b44a0a2a95533562ba954/servers?tags=__type_baremetal
    
  • Querying BMSs with the __type_baremetal tag and with bms-test01 contained in the name
    1
    GET https://{ECS Endpoint}/v2.1/bbf1946d374b44a0a2a95533562ba954/servers?tags=__type_baremetal&name=bms-test01
    

Response Parameters

Parameter

Type

Description

servers

Array of objects

Specifies the BMS list. For details, see Table 2.

Table 2 servers field data structure description

Parameter

Type

Description

name

String

Specifies the BMS name.

id

String

Specifies the unique ID of the BMS.

links

Array of objects

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

Table 3 links field data structure description

Parameter

Type

Description

rel

String

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

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

href

String

Specifies the corresponding shortcut link.

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
    "servers": [
        {
            "name": "bms",
            "links": [
                {
                    "rel": "self",
                    "href": "https://openstack.example.com/v2.1/c685484a8cc2416b97260938705deb65/servers/820abbd0-2d8b-4bc5-ae46-69cacfd4fbaa"
                },
                {
                    "rel": "bookmark",
                    "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/servers/820abbd0-2d8e-4bc5-ae46-69cacfd4fbaa"
                }
            ],
            "id": "820abbd0-2d8e-4bc5-ae46-69cacfd4fbaa"
        }
    ]
}

Returned Values

Normal values

Returned Values

Description

200

The request has been successfully processed.

For details about other returned values, see Status Codes.

Error Codes

See Error Codes.

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

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback