
# 查询服务器列表 - ListServers
#### 功能介绍
查询服务器列表。
- 该接口支持企业项目细粒度权限的校验，具体细粒度请参见 ies:edgeSite:listServers
  
 
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/IES/doc?api=ListServers)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-cloudpond/ies_05_0800.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                      | 访问级别 | 资源类型（\*为必须） | 条件键                   | 别名 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | ies:edgeSite:listServers | List | edgeSite \* | g:EnterpriseProjectId | -  | -      |
     
  
 
#### URI
GET /v2/{domain_id}/servers
表1路径参数 
| 参数        | 是否必选 | 参数类型   | 描述           |
|:---|:---|:---|:---|
| domain_id | 是    | String | path中租户的账号ID |
   
表2Query参数 
| 参数                | 是否必选 | 参数类型             | 描述                                   |
|:---|:---|:---|:---|
| edge_site_id      | 否    | String           | 边缘小站ID                               |
| delivery_order_id | 否    | String           | 交易单ID                                |
| limit             | 否    | Integer          | 每页的数量                                |
| marker            | 否    | String           | 分页标识                                 |
| status            | 否    | Array of strings | 根据服务器状态查询，支持多值查询                     |
| id                | 否    | Array of strings | 根据ID过滤，支持多值查询，查询条件格式：id=xxx\&id=xxx。 |
   
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述      |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数        | 参数类型                                                     | 描述    |
|:---|:---|:---|
| servers   | Array of [Server] objects | 服务器列表 |
| page_info | [PageInfo] object       | 分页信息  |
   
 表5Server 
| 参数             | 参数类型                                                                   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|:---|:---|:---|
| id             | String                                                                 | 资源ID                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| domain_id      | String                                                                 | 账号ID                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| edge_site_id   | String                                                                 | 站点ID                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| name           | String                                                                 | 名称                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| status         | String                                                                 | - PENDING_PAYMENT：待支付   - DELIVERING：交付中   - USING：使用中    |
| offering_id    | String                                                                 | 商品ID                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| spec           | [ServerResourceSpec] object | 服务器资源规格                                                                                                                                                                                                                                                                                                                                                                                                                               |
| market_options | [MarketOptions] object           | 计费信息                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| product_info   | [ProductInfo] object               | 商品归属产品属性信息                                                                                                                                                                                                                                                                                                                                                                                                                            |
| location       | [LayoutLocation] object         | 设备位置信息                                                                                                                                                                                                                                                                                                                                                                                                                                |
| created_at     | String                                                                 | 创建时间                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| updated_at     | String                                                                 | 更新时间                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   
 表6ServerResourceSpec 
| 参数               | 参数类型    | 描述                                                                                                                                                       |
|:---|:---|:---|
| id               | String  | 服务器规格ID                                                                                                                                                  |
| name             | String  | 服务器规格名称。                                                                                                                                                 |
| server_type      | String  | 服务器类型。 COMPUTE: 计算服务器 NETWORK: 网络服务器 BLOCK_STORAGE: 硬盘存储服务器 |
| flavor_type      | String  | 服务器发放的资源规格类型                                                                                                                                             |
| performance_type | String  | 服务器规格分类。如通用计算型/云桌面型/网关型等。                                                                                                                                |
| power            | Integer | 服务器功率（单位：w）                                                                                                                                              |
| unit             | Integer | 设备高度。U位数                                                                                                                                                 |
| vcpus            | Integer | 可用虚拟CPU核数                                                                                                                                                |
| memory           | Integer | 可用内存大小。单位：GB                                                                                                                                             |
| storage_capacity | Integer | 可用存储容量。单位：TiB                                                                                                                                            |
| cpu_name         | String  | 名称                                                                                                                                                       |
| cpu_architecture | String  | CPU架构                                                                                                                                                    |
   
 表7MarketOptions 
| 参数              | 参数类型                                                           | 描述                                                                                                                                                                                                  |
|:---|:---|:---|
| charge_mode     | String                                                         | 计费模式。 - prepaid：包周期    |
| prepaid_options | [PrepaidOptions] object | 包周期计费信息                                                                                                                                                                                             |
| strategies      | Array of [Strategy] objects   | 销售策略列表                                                                                                                                                                                              |
   
 表8PrepaidOptions 
| 参数         | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|
| order_id   | String | 订单ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| product_id | String | 产品ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| pay_mode   | String | 包周期付款类型 - FULL: 全预付   - HALF：半预付   - PAID_BY_YEAR：按年付费   - ZERO_PAID_BY_YEAR：零预付-按年   - ZERO_PAID_BY_MONTH：零预付-按月    |
   
 表9Strategy 
| 参数     | 参数类型   | 描述                                                                                                                                                                                                     |
|:---|:---|:---|
| status | String | 运维状态说明： - FREEZE - 已冻结    |
| scene  | String | 资源运营状态场景： ARREAR：欠费场景； POLICE：公安场景。 ILLEGAL：违规场景。 VERIFY：客户未实名认证冻结场景。      |
| effect | String | 资源运营功能： DELETABLE：可删除 UNDELETABLE：不可删除                                                                                                   |
   
 表10ProductInfo 
| 参数                 | 参数类型   | 描述    |
|:---|:---|:---|
| cloud_service_type | String | 云服务类型 |
| resource_type      | String | 资源类型  |
| resource_spec_code | String | 资源编码  |
   
 表11LayoutLocation 
| 参数          | 参数类型    | 描述   |
|:---|:---|:---|
| rack_id     | String  | 机柜ID |
| start_index | Integer | 起始U位 |
| unit        | Integer | U位数  |
   
 表12PageInfo 
| 参数            | 参数类型    | 描述     |
|:---|:---|:---|
| next_marker   | String  | 下一页标识。 |
| current_count | Integer | 当前页数量。 |
   
#### 请求示例
查询服务器列表
```
GET https://{ies_endpoint}/v2/{domain_id}/servers
```
#### 响应示例
**状态码：200**
successful operation
```
{
  "servers" : [ {
    "id" : "00000000-0000-000-0000-000000000000",
    "domain_id" : "00000000000000000000000000000000",
    "edge_site_id" : "00000000-0000-000-0000-000000000000",
    "name" : "server01",
    "status" : "USING",
    "offering_id" : "00000000-0000-000-0000-000000000000",
    "spec" : {
      "id" : "00000000-0000-000-0000-000000000000",
      "name" : "S7",
      "server_type" : "COMPUTE",
      "flavor_type" : null,
      "performance_type" : "normal",
      "power" : 10,
      "unit" : 3,
      "vcpus" : 100,
      "memory" : 500,
      "storage_capacity" : 3000,
      "cpu_name" : "",
      "cpu_architecture" : "X86"
    },
    "market_options" : {
      "charge_mode" : "prepaid",
      "prepaid_options" : {
        "order_id" : "CS2507010000LFU8W",
        "pay_mode" : "FULL"
      }
    },
    "created_at" : "2025-07-01T00:00:00.000000Z",
    "updated_at" : "2025-07-01T01:00:00.000000Z"
  } ],
  "page_info" : {
    "current_count" : 1
  }
}
```
#### 状态码
| 状态码 | 描述                   |
|:---|:---|
| 200 | successful operation |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-cloudpond/ErrorCode.html)。
