
# 获取用户可订阅的事件列表 - GetEventList
#### 功能介绍
本接口用于获取用户可订阅的事件列表。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-dis/dis_02_0400.html)。
#### URI
GET /v1/{project_id}/event-list
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|:---|
| project_id | 是    | String | **参数解释**： 项目ID。获取方法，请参见[获取项目ID](https://support.huaweicloud.com/api-dis/dis_02_0501.html)。 **约束限制**： 不涉及 **取值范围**： 只能由英文字母和数字组成，且长度为\[1-64\]个字符。 **默认取值**： 不涉及 |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | **参数解释**： 用户Token，通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。请参见[认证鉴权-Token认证](https://support.huaweicloud.com/api-dis/dis_02_0517.html)。 **约束限制**： 不涉及 **取值范围**： 长度为\[1-32768\]个字符。 **默认取值**： 不涉及 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数     | 参数类型                                                                                              | 描述                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|
| count  | Integer                                                                                           | **参数解释**： 可订阅事件的个数。 **约束限制**： 不涉及 **取值范围**： 不涉及 **默认取值**： 9   |
| events | Array of [GetEventListResultResponse] objects | **参数解释**： 事件类型参数列表。 **约束限制**： 不涉及 **取值范围**： 不涉及 **默认取值**： 不涉及 |
   
 表4GetEventListResultResponse 
| 参数        | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|
| severity  | Integer | **参数解释**： 事件级别，分为正常和警告。 **约束限制**： 不涉及 **取值范围**： - 0：正常   - 1：警告    **默认取值**： 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| category  | Integer | **参数解释**： 事件源类型，分为租户、任务和通道。 **约束限制**： 不涉及 **取值范围**： - 0：事件源类型为租户   - 1：事件源类型为通道   - 2：事件源类型为任务    **默认取值**： 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| type_name | String  | **参数解释**： 事件名称。 **约束限制**： 不涉及 **取值范围**： - Dump task restored: 转储任务恢复。   - Dump task abnormal：转储任务异常。   - Quota insufficient：配额不足。   - Traffic limited： 流控受限。   - Auto scaling succeeded：通道自动扩缩容成功。   - Auto scaling failed：通道自动扩缩容失败。   - Stream Traffic Abnormal：通道流量异常。   - Stream Traffic Recovery：通道流量恢复。   - Manual scaling failed：通道手动扩缩容失败。    **默认取值**： 不涉及                                                                          |
| type_id   | String  | **参数解释**： 事件名称对应的时间id，id值固定且唯一。 **约束限制**： 不涉及 **取值范围**： - dis_event.000: Dump task restored。   - dis_event.001：Dump task abnormal。   - dis_event.002：Quota insufficient。   - dis_event.003：Traffic limited。   - dis_event.004：Auto scaling succeeded。   - dis_event.005：Auto scaling failed。   - dis_event.006：Stream Traffic Abnormal。   - dis_event.007：Stream Traffic Recovery。   - dis_event.008：Manual scaling failed。    **默认取值**： 不涉及 |
   
#### 请求示例
获取用户可订阅的事件列表。
```
GET https://{Endpoint}/v1/{project_id}/event-list
```
#### 响应示例
**状态码：200**
正常返回
```
{
  "count" : 9,
  "events" : {
    "severity" : 0,
    "category" : 2,
    "type_name" : "Dump task restored",
    "type_id" : "dis_event.000",
    "occur_time" : 0
  }
}
```
#### 状态码
| 状态码 | 描述   |
|:---|:---|
| 200 | 正常返回 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-dis/ErrorCode.html)。
