获取¶
GET /api/v1/dashboards/{dashboard_uuid}/get
概述¶
读取指定仪表板的详情、图表布局和关联信息。
调用前和使用步骤¶
从仪表板列表取实际仪表板 UUID。用响应中的 UUID 核对目标,用 extend、mapping 或标签信息准备下一次配置更新。需要可导入的完整模板时使用导出接口。
路由参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| dashboard_uuid | string | Y | 目标仪表板 UUID。 例子: dsbd_example获取或填写方式: 从仪表板列表的 content.data[].uuid 复制,也可取创建结果的 content.uuid。 |
请求头¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| DF-API-KEY | string | Y | 工作空间的 OpenAPI 鉴权凭据。 例子: <DF-API-KEY>获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。 |
请求例子¶
curl --get 'https://openapi.guance.com/api/v1/dashboards/dsbd_example/get' \
-H 'DF-API-KEY: <DF-API-KEY>'
响应¶
HTTP 200,application/json。下方示例展示可直接读取的主要字段。
| 字段 | 类型 | 说明 |
|---|---|---|
| content.id | integer | 仪表板记录编号。 |
| content.uuid | string | 仪表板 UUID,用于详情、修改、删除和轮播。 |
| content.workspaceUUID | string | 所属工作空间。 |
| content.name | string | 仪表板显示名。 |
| content.desc | string | 仪表板描述。 |
| content.identifier | string | 对外自定义标识,可为空。 |
| content.ownerType | string | 资源类型归属,仪表板通常为 node。 |
| content.type | string | 仪表板类型,例如 CUSTOM。 |
| content.chartPos | array<object> |
图表布局数组。每项的 chartUUID 是图表标识,pos 是布局对象。 |
| content.chartPos[].chartUUID | string | 已关联的图表 UUID。 |
| content.chartPos[].pos | object | 图表尺寸及位置,例如 x、y、w、h。 |
| content.chartGroupPos | array<string> |
图表分组标识的排列顺序。 |
| content.iconSet | object | 图标设置。 |
| content.isPublic | integer | 1 公开,0 仅创建身份可见,-1 自定义权限。 |
| content.extend | object | 扩展配置。 |
| content.mapping | array<object> |
变量字段映射。 |
| content.createdWay | string | 资源创建来源。 |
| content.dashboardBindSet | array | 视图绑定配置。 |
| content.openPermissionSet | boolean | 当前是否开启自定义权限。 |
| content.permissionSet | array<string> |
操作权限主体 UUID 列表。 |
| content.readPermissionSet | array<string> |
读取权限主体 UUID 列表。 |
| content.tagInfo | array<object> |
与本响应相关的标签信息。 |
| content.tagInfo[].id | string | 标签标识,与 uuid 相同。 |
| content.tagInfo[].uuid | string | 标签 UUID。 |
| content.tagInfo[].name | string | 关联的标签名称。 |
| content.tagInfo[].description | string | 标签描述。 |
| content.tagInfo[].colour | string | 标签颜色。 |
| content.tagInfo[].scope | array<string> |
标签的生效范围。 |
| content.tagInfo[].tagPermissionInfo | object | 存在标签授权时附带的操作和读取权限信息。 |
| content.status | integer | 记录状态。 |
| content.creator | string | 创建者身份 ID。 |
| content.updator | string | 最近更新者身份 ID,未发生时可能为空。 |
| content.createAt | number | 创建时间,Unix 秒。 |
| content.updateAt | number | 最近更新时间,Unix 秒。未发生时可为 -1。 |
| content.deleteAt | number | 删除时间,Unix 秒。未删除时为 -1。 |
| content.creatorInfo | object | 创建者信息,可为空对象。 |
| content.updatorInfo | object | 最近更新者信息,可为空对象。 |
| content.isFavorite | boolean | 当前身份是否收藏。详情结果中通常只在已收藏时出现。 |
| content.isIndexDashboard | boolean | 是否为当前工作空间的首页仪表板。 |
| content.refCheckerUUIDs | array<string> |
引用的监控器 UUID。 |
| content.allow_operation | boolean 或 null | 权限计算后的操作提示,存在时用于判断是否可编辑。 |
| content.permissionSetInfo | object | 配置了操作权限列表时,按 UUID 返回主体详情。 |
| content.readPermissionSetInfo | object | 配置了读取权限列表时,按 UUID 返回主体详情。 |
| content.extend.defaultTargetWorkspaceName | string | 旧的单默认查询空间字段对应的显示名称。详情可能提供。 |
| content.extend.defaultTargetWorkspaceNames | array<string> |
配置了默认查询空间列表时,该列表对应的显示名称。详情可能提供。 |
| content.declaration | object 或 null | 工作空间的公共声明。 |
{
"code": 200,
"content": {
"id": 21,
"uuid": "dsbd_example",
"name": "生产巡检",
"desc": "生产服务巡检指标",
"workspaceUUID": "wksp_example",
"identifier": "prod-check",
"ownerType": "node",
"type": "CUSTOM",
"chartPos": [],
"chartGroupPos": [],
"iconSet": {},
"isPublic": 1,
"extend": {},
"mapping": [],
"createdWay": "manual",
"dashboardBindSet": [],
"openPermissionSet": false,
"permissionSet": [],
"readPermissionSet": [],
"tagInfo": [],
"creator": "wsak_example",
"updator": "",
"createAt": 1785427200,
"updateAt": -1,
"deleteAt": -1,
"status": 0,
"declaration": {},
"creatorInfo": {},
"updatorInfo": {},
"isIndexDashboard": false,
"refCheckerUUIDs": [],
"allow_operation": true
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
错误响应¶
鉴权、限流和公共请求错误参见公共错误定义。
| HTTP 状态 | errorCode | 触发条件 | 消息或响应说明 | 处理方式 |
|---|---|---|---|---|
| 404 | ft.NotFoundView | 目标仪表板不存在、已删除或不在当前工作空间 | 未找到指定视图 | 换用当前空间仪表板列表返回的 UUID。 |
| 403 | ft.ForbiddenDashboardQueryOperation | 调用身份不具有目标仪表板的读取权限 | 您无仪表板【{}】查看权限 | 确认目标已向调用身份开放读取权限。 |