
# 获取资产列表
#### 功能介绍
获取资产列表
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/eihealth/doc?api=ListAsset)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### URI
GET /v1/{project_id}/assets
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                                                                                            |
|:---|:---|:---|:---|
| project_id | 是    | String | 华为云项目ID，您可以从[获取项目ID](https://support.huaweicloud.com/api-eihealth/eihealth_33_0044.html)中获取。 最小长度：**1** 最大长度：**128** |
   
表2Query参数 
| 参数         | 是否必选 | 参数类型    | 描述                                                                                                                                  |
|:---|:---|:---|:---|
| categories | 否    | String  | 资产类别，支持IMAGE/APP/WORKFLOW/DATASET，支持查询多个，以','分隔 最小长度：**0** 最大长度：**2000** |
| key_word   | 否    | String  | 关键字，支持在资产名、资产标题、短描述、长描述中搜索 最小长度：**0** 最大长度：**2000**                       |
| labels     | 否    | String  | 标签，支持查询多个，以','分隔 最小长度：**0** 最大长度：**2000**                                  |
| limit      | 否    | Integer | 返回记录限制 最小值：**1** 最大值：**1000** 缺省值：**100**         |
| offset     | 否    | Integer | 偏移量 最小值：**0** 最大值：**100000000** 缺省值：**0**        |
| publishers | 否    | String  | 发布者，支持查询多个，以','分隔 最小长度：**0** 最大长度：**2000**                                   |
| scope      | 是    | String  | 查询范围，支持PUBLIC/INTERNAL/SELF 最小长度：**1** 最大长度：**128**                        |
| vendor_ids | 否    | String  | 供应商，支持查询多个，以','分隔 最小长度：**0** 最大长度：**2000**                                  |
   
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                          |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。Token认证就是在调用API的时候将Token加到请求消息头，从而通过身份认证，获得操作API的权限，[获取Token](https://support.huaweicloud.com/api-eihealth/eihealth_33_0010.html)接口响应消息头中X-Subject-Token的值即为Token。 最小长度：**1** 最大长度：**32768** |
   
#### 响应参数
**状态码： 200**
表4响应Body参数 
| 参数     | 参数类型                                                             | 描述   |
|:---|:---|:---|
| count  | Integer                                                          | 资产总数 |
| assets | Array of [GetAssetRsp] objects | 资产列表 |
   
 表5GetAssetRsp 
| 参数          | 参数类型                                                           | 描述        |
|:---|:---|:---|
| id          | String                                                         | 资产id      |
| category    | String                                                         | 类别        |
| name        | String                                                         | 资产名       |
| title       | String                                                         | 资产展示名     |
| labels      | Array of strings                                               | 资产标签列表    |
| picture     | String                                                         | 资产封面图访问链接 |
| vendor_id   | String                                                         | 供应商id     |
| versions    | Array of [VersionRsp] objects | 资产版本号列表   |
| create_time | String                                                         | 创建时间      |
| update_time | String                                                         | 更新时间      |
| stars       | Integer                                                        | 收藏数       |
| subscribes  | Integer                                                        | 订阅数       |
   
 表6VersionRsp 
| 参数            | 参数类型             | 描述        |
|:---|:---|:---|
| version       | String           | 资产版本号     |
| publisher     | String           | 发布者       |
| description   | String           | 资产长描述     |
| summary       | String           | 资产短描述     |
| license       | String           | 许可证       |
| status        | String           | 资产状态      |
| failed_reason | String           | 资产发布失败原因  |
| labels        | Array of strings | 资产标签列表    |
| picture       | String           | 资产封面图访问链接 |
| create_time   | String           | 创建时间      |
| update_time   | String           | 更新时间      |
   
#### 请求示例
查询资产列表
```
https://eihealth.cn-north-4.myhuaweicloud.com/v1/{project_id}/assets
```
#### 响应示例
**状态码： 200**
OK
```
{
  "count" : 15,
  "assets" : [ {
    "id" : "aa78f595-5acb-4be8-b277-229be335633a",
    "category" : "WORKFLOW",
    "name" : "Docking Summary",
    "title" : "Docking Summary",
    "labels" : [ "molecular docking", "drug discovery", "smallMolecularChemicals" ],
    "picture" : "https://eihealth.obs.cn-north-4.huawei.com:443/assets/metadata/picture.png",
    "vendor_id" : "00000000000000000000000000000000",
    "versions" : [ {
      "version" : "1.0.0",
      "publisher" : "EIHealth",
      "description" : "",
      "summary" : "summary",
      "license" : "",
      "status" : "NORMAL",
      "failed_reason" : "internal error",
      "labels" : [ "molecular docking", "drug discovery", "smallMolecularChemicals" ],
      "picture" : "https://eihealth.obs.cn-north-4.huawei.com:443/assets/metadata/picture.png",
      "create_time" : "2021-09-07T05:44:28Z",
      "update_time" : "2021-09-07T05:44:28Z"
    } ],
    "create_time" : "2021-09-07T05:44:28Z",
    "update_time" : "2021-09-07T05:44:28Z",
    "stars" : 0,
    "subscribes" : 1
  } ]
}
```
#### 状态码
| 状态码 | 描述 |
|:---|:---|
| 200 | OK |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-eihealth/ErrorCode.html)。
