
# 查询支持的服务部署规格
#### 功能介绍
查询支持的服务部署规格列表。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/ModelArts/doc?api=ShowServiceSpecifications)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-modelarts/modelarts_03_0138.html)。
- 如果使用身份策略授权，当前API调用无需身份策略权限。
 
#### URI
GET /v1/{project_id}/services/specifications
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                               |
|:---|:---|:---|:---|
| project_id | 是    | String | 用户项目ID。获取方法请参见[获取项目ID和名称](https://support.huaweicloud.com/api-modelarts/modelarts_03_0147.html)。 |
   
表2Query参数 
| 参数                  | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| is_personal_cluster | 否    | Boolean | 是否查询专属资源池支持的服务部署规格列表，默认为false。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| infer_type          | 否    | String  | 推理方式，枚举值如下： - real-time：在线服务，默认值   - batch：批量服务   - edge: 边缘服务    |
| limit               | 否    | String  | 指定每一页返回的最大条目数，默认为1000。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| offset              | 否    | String  | 返回数据的起始偏移量，默认为0。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                       |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数             | 参数类型                                                                                    | 描述           |
|:---|:---|:---|
| total_count    | Integer                                                                                 | 部署服务规格总数。    |
| count          | Integer                                                                                 | 当前列表的规格数量。   |
| specifications | Array of [Specification] objects | 支持的服务部署规格列表。 |
   
 表5Specification 
| 参数            | 参数类型                                                                    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|
| is_open       | Boolean                                                                 | 是否开放此规格，默认是true；取值为false时，用户需要提工单申请才可使用此规格。                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| spec_status   | String                                                                  | 规格状态，取值为： - normal：正常。   - sellout：售罄，售罄时无法使用此规格部署服务。    |
| specification | String                                                                  | 规格的唯一标识。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| billing_spec  | String                                                                  | 计费对应规格的唯一标识。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| category      | String                                                                  | 规格类型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| cpu_info      | [CpuInfo] object       | 规格的CPU信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| memory_info   | [MemoryInfo] object | 规格的内存信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| gpu_info      | [GpuInfo] object       | 规格的GPU信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| npu_info      | [NpuInfo] object       | 规格的NPU信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| source_type   | String                                                                  | 此规格应用于模型的类型，取值为空或auto，默认为空，代表是用户自己产生的模型；取值为auto时，代表是自动学习训练的模型，计费方式有差别。                                                                                                                                                                                                                                                                                                                                                                                                                       |
| is_free       | Boolean                                                                 | 当前规格是否是免费规格，"true"表示是免费规格。                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| over_quota    | Boolean                                                                 | 当前规格是否超过可用配额，"true"表示超过可用配额。                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| extend_params | Integer                                                                 | 计费因子。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| display_en    | String                                                                  | 规格的英文描述。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| display_cn    | String                                                                  | 规格的中文描述。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   
 表6CpuInfo 
| 参数   | 参数类型   | 描述      |
|:---|:---|:---|
| arch | String | 架构类型。   |
| cpu  | Number | CPU核心数。 |
   
 表7MemoryInfo 
| 参数     | 参数类型    | 描述    |
|:---|:---|:---|
| unit   | String  | 单位。   |
| memory | Integer | 内存大小。 |
   
 表8GpuInfo 
| 参数      | 参数类型    | 描述     |
|:---|:---|:---|
| brand   | String  | 品牌。    |
| version | String  | 卡类型。   |
| unit    | String  | 单位。    |
| memory  | Integer | 卡内存大小。 |
| gpu     | Number  | GPU数。  |
   
 表9NpuInfo 
| 参数      | 参数类型    | 描述     |
|:---|:---|:---|
| brand   | String  | 品牌。    |
| version | String  | 卡类型。   |
| unit    | String  | 单位。    |
| memory  | Integer | 卡内存大小。 |
| npu     | Integer | NPU数。  |
   
#### 请求示例
```
GET https://{endpoint}/v1/{project_id}/services/specifications
```
#### 响应示例
**状态码：200**
服务部署规格列表。
```
{
  "total_count" : 3,
  "count" : 3,
  "specifications" : [ {
    "specification" : "modelarts.vm.cpu.2u",
    "billing_spec" : "modelarts.vm.cpu.2u",
    "category" : "CPU",
    "cpu_info" : {
      "arch" : "x86",
      "cpu" : 2.0
    },
    "memory_info" : {
      "unit" : "GB",
      "memory" : 8
    },
    "gpu_info" : {
      "unit" : "MB",
      "gpu" : 0.0,
      "memory" : 0
    },
    "npu_info" : {
      "unit" : "MB",
      "npu" : 0,
      "memory" : 0
    },
    "display_en" : "CPU: 2 vCPUs | 8 GiB",
    "display_cn" : "CPU: 2 Core 8 GiB",
    "is_open" : true,
    "spec_status" : "normal",
    "is_free" : false,
    "over_quota" : false,
    "extend_params" : 1
  }, {
    "specification" : "modelarts.vm.gpu.pnt004",
    "billing_spec" : "modelarts.vm.gpu.pnt004",
    "category" : "GPU",
    "cpu_info" : {
      "arch" : "x86",
      "cpu" : 8.0
    },
    "memory_info" : {
      "unit" : "GB",
      "memory" : 32
    },
    "gpu_info" : {
      "unit" : "GB",
      "brand" : "NVIDIA",
      "version" : "Pnt004",
      "gpu" : 1.0,
      "memory" : 16
    },
    "npu_info" : {
      "unit" : "MB",
      "npu" : 0,
      "memory" : 0
    },
    "display_en" : "CPU: 8 vCPUs | 32 GiB GPU：Pnt004",
    "display_cn" : "CPU：8 Core 32 GiB GPU：1 * Pnt004",
    "is_open" : true,
    "spec_status" : "normal",
    "is_free" : false,
    "over_quota" : false,
    "extend_params" : 1
  }, {
    "specification" : "modelarts.vm.ai1.snt3",
    "billing_spec" : "modelarts.vm.ai1.snt3",
    "category" : "NPU",
    "cpu_info" : {
      "arch" : "x86",
      "cpu" : 2.0
    },
    "memory_info" : {
      "unit" : "GB",
      "memory" : 8
    },
    "gpu_info" : {
      "unit" : "MB",
      "gpu" : 0.0,
      "memory" : 0
    },
    "npu_info" : {
      "unit" : "GB",
      "brand" : "Ascend",
      "version" : "Snt3",
      "npu" : 1,
      "memory" : 8
    },
    "display_en" : "CPU: 2 vCPUs | 8 GiB Ascend: 1 x Ascend snt3",
    "display_cn" : "CPU：2 Core 8 GiB Ascend: 1 * Ascend snt3",
    "is_open" : false,
    "spec_status" : "normal",
    "is_free" : false,
    "over_quota" : false,
    "extend_params" : 1
  } ]
}
```
#### 状态码
| 状态码 | 描述        |
|:---|:---|
| 200 | 服务部署规格列表。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-modelarts/modelarts_03_0095.html)。
