列出¶
GET /api/v1/notice/date/list
概述¶
分页获取当前空间的自定义通知日期配置。
调用前和使用步骤¶
默认pageIndex=1、pageSize=20,按记录编号倒序。读取content.data数组及顶层pageInfo;保存uuid供告警策略引用。日期字段在响应中名为dates。本资源只保存日期集合,不包含当天开始时刻、持续时长或时区。使用时在告警策略alertOpt.alertTarget[].customDateUUIDs引用本资源UUID,并一起设置customStartTime/customDuration;具体规则见告警策略参数页。当前告警执行时区读取有已知限制,应按告警策略页面说明核实实际时区。
请求头¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| DF-API-KEY | string | Y | 工作空间的 OpenAPI 鉴权凭据。 例子: <DF-API-KEY>获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。 |
Query 请求参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| search | string | 可选名称模糊搜索。 允许 null: True 例子: 维护获取或填写方式: 填写日期配置名称中的部分文本;省略或空白不筛选。 |
|
| pageIndex | integer | 页码,默认1,最小1。 允许 null: False $minValue: 1 例子: 1获取或填写方式: 从1开始逐页递增,保持搜索条件不变。 |
|
| pageSize | integer | 每页条数,默认20,上限10000。 允许 null: False $minValue: 1 $maxValue: 10000 例子: 20获取或填写方式: 按需要填写1至10000,建议使用适量分页以控制响应体积。 |
参数补充说明¶
日期集合本身不会触发通知,需要通过新建告警策略 v2配置目标和自定义日期窗口。
请求例子¶
curl --get 'https://openapi.guance.com/api/v1/notice/date/list' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-urlencode pageIndex=1 \
--data-urlencode pageSize=20
响应¶
HTTP 200,application/json。下方示例展示可直接读取的主要字段。
| 字段 | 类型 | 说明 |
|---|---|---|
| content.data | array<object> |
当前页配置,无结果为[]。 |
| content.data[].id | integer | 已保存日期配置记录编号,操作使用uuid。 |
| content.data[].uuid | string | 日期配置UUID,供告警策略customDateUUIDs引用。 |
| content.data[].workspaceUUID | string | 所属工作空间UUID。 |
| content.data[].name | string | 配置名称。 |
| content.data[].dates | array<string> |
保存的日期数组;请求字段名为noticeDates,响应字段名为dates。 |
| content.data[].dates[] | string | 单个YYYY/MM/DD日期字符串。 |
| content.data[].status | integer | 记录状态,0正常,3已删除。 |
| content.data[].creator | string | 创建身份。 |
| content.data[].updator | string | 最近更新身份,尚未更新为空字符串。 |
| content.data[].createAt | integer | 创建时间,Unix秒。 |
| content.data[].updateAt | integer | 更新时间,Unix秒,尚未更新为-1。 |
| content.data[].deleteAt | integer | 删除时间,Unix秒,未删除为-1。 |
| content.declaration | object 或 null | 工作空间公共声明。 |
| pageInfo | object | 顶层分页。 |
| pageInfo.pageIndex | integer | 页码。 |
| pageInfo.pageSize | integer | 页容量。 |
| pageInfo.count | integer | 当前页实际条数。 |
| pageInfo.totalCount | integer | 匹配配置总数。 |
{
"code": 200,
"content": {
"data": [
{
"id": 42,
"uuid": "ndate_example",
"workspaceUUID": "wksp_example",
"name": "生产维护日",
"dates": [
"2026/11/20",
"2026/11/27"
],
"status": 0,
"creator": "wsak_example",
"updator": "",
"createAt": 1785430800,
"updateAt": -1,
"deleteAt": -1
}
],
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE",
"pageInfo": {
"pageIndex": 1,
"pageSize": 20,
"count": 1,
"totalCount": 1
}
}
错误响应¶
鉴权、限流和公共请求错误参见公共错误定义。
| HTTP 状态 | errorCode | 触发条件 | 消息或响应说明 | 处理方式 |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | 请求字段缺失,或字段值违反声明的校验条件 | 参数解析失败 | 核对参数位置、字段名、类型和取值。 |
| 500 | ft.InternalServerError | 日期配置读取失败 | 内部错误 | 稍后重试,持续失败提供traceId。 |