此内容的本地化语言页面暂未提供。我们将不断努力以提供本地化语言版本。感谢您的关注。

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 Details About an ECS

Updated on 2024-07-23 GMT+08:00

Function

This API is used to query details about an ECS.

The information that can be queried includes the ECS billing mode and whether the ECS is frozen.

URI

GET /v1/{project_id}/cloudservers/{server_id}

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

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

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

server_id

Yes

Specifies the ECS ID.

Request

None

Response

Table 2 describes the response parameters.
Table 2 Response parameters

Parameter

Type

Description

server

Object

Specifies ECS information. For details, see Table 3.

Table 3 server field description

Parameter

Type

Description

status

String

Specifies the ECS status.

Options:

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

For details, see ECS Statuses.

updated

String

Specifies the last time when the ECS was updated, such as started, stopped, or restarted.

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

hostId

String

Specifies the ID of the host where the ECS is deployed.

OS-EXT-SRV-ATTR:host

String

Specifies the name of the host on which the ECS is deployed.

addresses

Object

Specifies the network attribute of the ECS.

The structure is Map<String, Object>.

  • The key indicates the network name, for example, demo_net.
  • The value indicates the network attribute specified in Table 1.

key_name

String

Specifies the key pair that is used to authenticate an ECS.

image

Object

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

OS-EXT-STS:task_state

String

Specifies the ECS task status. This is an extended attribute. For details, see ECS Statuses.

OS-EXT-STS:vm_state

String

Specifies the ECS status. This is an extended attribute. For details, see ECS Statuses.

OS-EXT-SRV-ATTR:instance_name

String

Specifies the ECS alias. This is an extended attribute.

OS-EXT-SRV-ATTR:hypervisor_hostname

String

Specifies the name of the host on which the ECS is deployed. This is an extended attribute.

flavor

Object

Specifies the ECS flavor.

For details, see Table 2.

id

String

Specifies the ECS ID in UUID format.

security_groups

Array of objects

Specifies the security groups of the ECS.

For details, see Table 3.

OS-EXT-AZ:availability_zone

String

Specifies the AZ of an ECS. This is an extended attribute.

user_id

String

Specifies the ID of the user for creating the ECS. The value is in UUID format.

name

String

Specifies the ECS name.

created

String

Specifies the time when the ECS was created.

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

tenant_id

String

Specifies the ID of the tenant to which the ECS belongs, which is the project ID in UUID format.

OS-DCF:diskConfig

String

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

Options:

  • MANUAL: The image space is not expanded.
  • AUTO: The image space of the system disk will be expanded to be as same as the flavor.

accessIPv4

String

Reserved

accessIPv6

String

Reserved

fault

Object

Specifies the ECS failure cause.

  • If the ECS status is normal, NULL is displayed.
  • If the ECS status is faulty, fault message or details are returned.
    • message: specifies the fault message.
    • code: specifies the fault code.
    • details: specifies the fault details.
    • created: specifies the time when the fault occurred. The time is in ISO8601 format.

progress

Integer

Specifies the ECS creation progress. The value ranges from 0 to 100.

OS-EXT-STS:power_state

Integer

Specifies the power status of the ECS. This is an extended attribute.

Options:

  • 0: NOSTATE
  • 1: RUNNING
  • 4: SHUTDOWN

config_drive

String

Specifies the configuration driver.

metadata

Map<String,String>

Specifies the ECS metadata. For details, see Table 5.

NOTE:

Metadata includes system default fields and the fields set by users.

OS-SRV-USG:launched_at

String

Specifies the time when the ECS was started. The time is in the format of "2019-05-22T03:23:59.000000".

OS-SRV-USG:terminated_at

String

Specifies the time when the ECS was deleted.

The time is in the format of "2019-05-22T03:23:59.000000".

os-extended-volumes:volumes_attached

Array of objects

Specifies the disks attached to an ECS.

For details, see Table 4.

description

String

Specifies the ECS description.

host_status

String

Specifies the status of the host accommodating the ECS.

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

OS-EXT-SRV-ATTR:hostname

String

Specifies the host name of the ECS.

OS-EXT-SRV-ATTR:reservation_id

String

Specifies the ID reserved for the ECSs to be created in a batch. You can use this ID to obtain all the ECSs created in the batch.

OS-EXT-SRV-ATTR:launch_index

Integer

Specifies the sequence in which ECSs start if the ECSs are created in a batch. The value ranges from 0 to the number of ECSs created in the batch.

OS-EXT-SRV-ATTR:kernel_id

String

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

OS-EXT-SRV-ATTR:ramdisk_id

String

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

OS-EXT-SRV-ATTR:root_device_name

String

Specifies the device name of the ECS system disk. For example, if the device type of the system disk is VDB, the value of this parameter is /dev/vda. If the device type of the system disk is SCSI, the value of this parameter is /dev/sda.

OS-EXT-SRV-ATTR:user_data

String

Specifies the user data (information after encoding) configured during ECS creation.

locked

Boolean

Specifies whether an ECS is locked.

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

tags

Array of strings

Specifies ECS tags.

os:scheduler_hints

Object

Specifies the ECS scheduling information. For details, see Table 11.

sys_tags

Array of objects

Specifies ECS system tags.

For details, see Table 6.

Example Request

Query details about the ECS whose ID is 4f4b3dfa-eb70-47cf-a60a-998a53bd598a.

GET https://{endpoint}/v1/{project_id}/cloudservers/{server_id}

Example Response

{
    "server":{
        "id":"4f4b3dfa-eb70-47cf-a60a-998a53bd598a",
        "name":"ecs-2ecf",
        "addresses":{
            "0431c5e5-bc94-4a44-8263-15da2a642435":[
                {
                    "version":"4",
                    "addr":"192.168.1.99",
                    "OS-EXT-IPS-MAC:mac_addr":"fa:16:3e:df:18:6d",
                    "OS-EXT-IPS:port_id":"23037c18-027a-44e5-b6b9-f8d8f113fe02",
                    "OS-EXT-IPS:type":"fixed"
                }
            ]
        },
        "flavor":{
            "disk":"0",
            "vcpus":"2",
            "ram":"1024",
            "id":"s3.large.1",
            "name":"s3.large.1"
        },
        "accessIPv4":"",
        "accessIPv6":"",
        "status":"ACTIVE",
        "progress":0,
        "hostId":"c7145889b2e3202cd295ceddb1742ff8941b827b586861fd0acedf64",
        "updated":"2018-09-13T07:06:51Z",
        "created":"2018-09-13T07:03:44Z",
        "image":{
            "id":"1ce5800a-e487-4c1b-b264-3353a39e2b4b"
        },
        "metadata":{
            "metering.order_id":"CS1809131459IGC24",
            "metering.image_id":"c71b64e7-4767-4406-afde-2c7c7ac2242c",
            "metering.imagetype":"gold",
            "metering.resourcespeccode":"s3.small.1.linux",
            "image_name":"HEC_Public_Cloudinit_Oracle_Linux_7.4_64bit_40G",
            "metering.resourcetype":"1",
            "metering.product_id":"00301-117024-0--0",
            "cascaded.instance_extrainfo":"pcibridge:2",
            "os_bit":"64",
            "vpc_id":"0431c5e5-bc94-4a44-8263-15da2a642435",
            "os_type":"Linux",
            "charging_mode":"1"
        },
        "tags":[
        ],
        "description":"",
        "locked":false,
        "config_drive":"",
        "tenant_id":"ff2eb406effc455aba53174463eb9322",
        "user_id":"0bc5e11f91dd48849bb03b7c8a263b2c",
        "key_name":"KeyPair-d750",
        "os-extended-volumes:volumes_attached":[
            {
                "device":"/dev/vda",
                "bootIndex":"0",
                "id":"80c15cff-2473-4982-a816-d760cad6c42c",
                "delete_on_termination":"false"
            }
        ],
        "OS-EXT-STS:task_state":null,
        "OS-EXT-STS:power_state":1,
        "OS-EXT-STS:vm_state":"active",
        "OS-EXT-SRV-ATTR:host":"az21.dc1",
        "OS-EXT-SRV-ATTR:instance_name":"instance-0015147f",
        "OS-EXT-SRV-ATTR:hypervisor_hostname":"nova003@74",
        "OS-EXT-SRV-ATTR:user_data":null,
        "OS-DCF:diskConfig":"MANUAL",
        "OS-EXT-AZ:availability_zone":"az1-dc1",
        "os:scheduler_hints":{
        },
        "OS-EXT-SRV-ATTR:root_device_name":"/dev/vda",
        "OS-EXT-SRV-ATTR:ramdisk_id":"",
        "OS-SRV-USG:launched_at":"2018-09-13T07:04:09.197749",
        "OS-EXT-SRV-ATTR:kernel_id":"",
        "OS-EXT-SRV-ATTR:launch_index":0,
        "host_status":"UP",
        "OS-EXT-SRV-ATTR:reservation_id":"r-nrd8b5c4",
        "OS-EXT-SRV-ATTR:hostname":"ecs-2ecf",
        "sys_tags":[
            {
                "key":"_sys_enterprise_project_id",
                "value":"0"
            }
        ],
        "security_groups":[
            {
                "name":"sg-95ec",
                "id":"6505b5d1-7837-41eb-8a1c-869d4355baa3"
            }
        ]
    }
}

Error Codes

See Error Codes.

我们使用cookie来确保您的高速浏览体验。继续浏览本站,即表示您同意我们使用cookie。 详情

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback