跳转至

获取



GET /api/v1/dashboard/{dashboard_uuid}/get

概述

获取指定内置视图的配置、图表布局和绑定条件。

调用前和使用步骤

先用内置视图列表取得 UUID。需要修改并保留绑定时,先读取并保存 content.dashboardBidding。如需可移植的模板内容,请调用导出内置视图。

路由参数

参数名 类型 必选 说明
dashboard_uuid string Y 当前工作空间的内置视图 UUID。
例子: dsbd_inner_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/dashboard/dsbd_inner_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 内置视图资源归属,内置视图为 inner。
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.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.isIndexDashboard boolean 是否为当前身份返回的空间首页视图。
content.refCheckerUUIDs array<string> 关联该视图的监控器 UUID。
content.dashboardBidding object 绑定条件对象。无绑定时为空对象。
content.dashboardBidding.* array<object> 按实际来源字段组织的匹配条件数组。
content.dashboardBidding.*[].op string 匹配运算符。
content.dashboardBidding.*[].value array<string> 匹配值数组。
content.tagInfo array<object> 内置视图当前返回空数组。
content.declaration object 或 null 工作空间的公共声明。
{
  "code": 200,
  "content": {
    "id": 72,
    "uuid": "dsbd_inner_example",
    "name": "主机详情内置视图",
    "desc": "根据主机查看运行状态",
    "workspaceUUID": "wksp_example",
    "identifier": "host-overview",
    "ownerType": "inner",
    "type": "CUSTOM",
    "isPublic": 1,
    "chartPos": [],
    "chartGroupPos": [],
    "iconSet": {},
    "extend": {},
    "mapping": [],
    "dashboardBindSet": [],
    "createdWay": "manual",
    "openPermissionSet": false,
    "permissionSet": [],
    "readPermissionSet": [],
    "status": 0,
    "creator": "wsak_example",
    "updator": "",
    "createAt": 1785427200,
    "updateAt": -1,
    "deleteAt": -1,
    "dashboardBidding": {
      "host": [
        {
          "op": "in",
          "value": [
            "web-01"
          ]
        }
      ]
    },
    "tagInfo": [],
    "isIndexDashboard": false,
    "refCheckerUUIDs": [],
    "creatorInfo": {},
    "updatorInfo": {},
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

错误响应

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

HTTP 状态 errorCode 触发条件 消息或响应说明 处理方式
404 ft.NotFoundView 目标不存在、已删除或不属于此工作空间 未找到指定视图 从同一空间的内置视图列表获取仍有效的 UUID。
403 ft.ForbiddenOperationResource API Key 无目标视图的有效操作权限 暂无操作权限 确认工作空间归属和 API Key 权限,或联系资源创建者。
403 ft.ForbiddenAccessResourceNoPublic 访问私有视图的身份与视图创建身份不同 暂无资源访问权限,当前页面非公开状态 由有访问权的创建身份操作,并确认使用同一工作空间的 API Key。

文档评价

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