跳转至

获取



GET /api/v1/viewer/{viewer_uuid}/get

概述

获取指定查看器的详情及布局。

调用前和使用步骤

从查看器列表选取当前空间的 UUID。详情返回布局和关联信息;需要可移植的完整模板时用导出查看器。设置 showTemplate=true 可查看默认模板信息。

路由参数

参数名 类型 必选 说明
viewer_uuid string Y 当前工作空间的目标查看器 UUID。
例子: dsbd_view_example
获取或填写方式: 从查看器列表的 content.data[].uuid 取得,也可取创建响应的 content.uuid。

请求头

参数名 类型 必选 说明
DF-API-KEY string Y 工作空间的 OpenAPI 鉴权凭据。
例子: <DF-API-KEY>
获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。

Query 请求参数

参数名 类型 必选 说明
showTemplate boolean 省略时不额外读取默认模板。
例子: true
获取或填写方式: 需要读取关联的默认模板时传 true,也接受 1。

参数补充说明

模板信息来自查看器的默认模板配置。查看器本身可移植的 JSON 结构由导出接口返回。

请求例子

curl --get 'https://openapi.guance.com/api/v1/viewer/dsbd_view_example/get' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  --data-urlencode showTemplate=true

响应

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 查看器资源归属,通常为 viewer。
content.type string 查看器类型,例如 CUSTOM。
content.isPublic integer 当前资源的可见范围。1 为公开,0 为仅创建身份可见。
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.extend object 查看器扩展信息。
content.mapping array<object> 变量字段映射信息。
content.dashboardBindSet array 视图绑定配置。
content.createdWay string 资源创建来源。
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.creatorInfo.uuid string 查询到对应身份时可能提供。身份标识。
content.creatorInfo.status integer 查询到对应身份时可能提供。账号状态。
content.creatorInfo.wsAccountStatus integer 查询到对应身份时可能提供。工作空间成员状态。
content.creatorInfo.username string 查询到对应身份时可能提供。登录名。
content.creatorInfo.name string 查询到对应身份时可能提供。显示名称。
content.creatorInfo.iconUrl string 查询到对应身份时可能提供。头像 URL。
content.creatorInfo.email string 查询到对应身份时可能提供。账号邮箱。API Key 身份可能返回其标识。
content.creatorInfo.mobile string 查询到对应身份时可能提供。联系方式。
content.creatorInfo.countryCode string 查询到对应身份时可能提供。手机号国家或地区代码。
content.creatorInfo.acntWsNickname string 查询到对应身份时可能提供。空间内昵称。
content.updatorInfo.uuid string 查询到对应身份时可能提供。身份标识。
content.updatorInfo.status integer 查询到对应身份时可能提供。账号状态。
content.updatorInfo.wsAccountStatus integer 查询到对应身份时可能提供。工作空间成员状态。
content.updatorInfo.username string 查询到对应身份时可能提供。登录名。
content.updatorInfo.name string 查询到对应身份时可能提供。显示名称。
content.updatorInfo.iconUrl string 查询到对应身份时可能提供。头像 URL。
content.updatorInfo.email string 查询到对应身份时可能提供。账号邮箱。API Key 身份可能返回其标识。
content.updatorInfo.mobile string 查询到对应身份时可能提供。联系方式。
content.updatorInfo.countryCode string 查询到对应身份时可能提供。手机号国家或地区代码。
content.updatorInfo.acntWsNickname string 查询到对应身份时可能提供。空间内昵称。
content.isFavorite boolean 当前身份收藏状态。详情未收藏时可不返回。
content.isIndexDashboard boolean 是否为当前空间的首页视图。
content.refCheckerUUIDs array<string> 关联的监控器标识。
content.integrationInfo object showTemplate=true 或 1 时附带的默认模板信息,没有对应项时为空对象。
content.extend.defaultTargetWorkspaceName string 配置了旧的单空间 ID 时,可能返回对应名称。
content.extend.defaultTargetWorkspaceNames array<string> 配置了默认查询空间列表时,可能返回空间名称列表。
content.declaration object 或 null 工作空间的公共声明。
{
  "code": 200,
  "content": {
    "id": 25,
    "uuid": "dsbd_view_example",
    "name": "主机巡检查看器",
    "desc": "主机巡检与状态核对",
    "workspaceUUID": "wksp_example",
    "identifier": "",
    "ownerType": "viewer",
    "type": "CUSTOM",
    "isPublic": 1,
    "chartPos": [],
    "chartGroupPos": [],
    "iconSet": {},
    "extend": {},
    "mapping": [],
    "dashboardBindSet": [],
    "createdWay": "manual",
    "openPermissionSet": false,
    "permissionSet": [],
    "readPermissionSet": [],
    "tagInfo": [],
    "status": 0,
    "creator": "wsak_example",
    "updator": "",
    "createAt": 1785427200,
    "updateAt": -1,
    "deleteAt": -1,
    "creatorInfo": {},
    "updatorInfo": {},
    "isIndexDashboard": false,
    "refCheckerUUIDs": [],
    "integrationInfo": {},
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

错误响应

鉴权、限流和公共请求错误参见公共错误定义。

HTTP 状态 errorCode 触发条件 消息或响应说明 处理方式
404 ft.NotFoundView 目标不存在、已删除或不在当前工作空间 未找到指定视图 用同一工作空间的查看器列表重新确认有效 UUID。

文档评价

文档内容是否对您有帮助?