获取¶
GET /api/v1/tag/{tag_uuid}/get
概述¶
读取指定标签的完整保存实体与作用域。
调用前和使用步骤¶
返回本空间非删除标签,包含实体状态和时间,不含列表的tagPermissionInfo或身份摘要。缺失/跨空间/已删除返回ObjectNotExists。scope历史空值会规范为["all"],不代表新增请求可传null。
路由参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| tag_uuid | string | Y | 本空间标签UUID,不是标签名、列表数字页码或资源UUID。 例子: tag_example获取或填写方式: 从标签列表content.data[].uuid取得。 |
请求头¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| DF-API-KEY | string | Y | 工作空间的 OpenAPI 鉴权凭据。 例子: <DF-API-KEY>获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。 |
参数补充说明¶
数据说明
- 响应参数说明
| 参数名 | type | 说明 |
|---|---|---|
| name | string | 标签名称 |
| description | string | 字段描述信息 |
| color | string | 前后端约定的颜色类型, default,style_key1,style_key2 ~~ |
- 颜色 color 字段 类型颜色对照:
{ "default": {"background": "#CCE6FF", "color": "rgba(0,0,0,0.8)"}, "style_key1": {"background": "#3333FE", "color": "#FFFFFF"}, "style_key2": {"background": "#428BCA", "color": "#FFFFFF"}, "style_key3": {"background": "#364450", "color": "#FFFFFF"}, "style_key4": {"background": "#E0E1FF", "color": "rgba(0,0,0,0.8)"}, "style_key5": {"background": "#9400D3", "color": "#FFFFFF"}, "style_key6": {"background": "#EDDBFF", "color": "rgba(0,0,0,0.8)"}, "style_key7": {"background": "#CC328B", "color": "#FFF"}, "style_key8": {"background": "#FCDEF0", "color": "rgba(0,0,0,0.8)"}, "style_key9": {"background": "#DC143D", "color": "#FFFFFF"}, "style_key10": {"background": "#FCBABA", "color": "rgba(0,0,0,0.8)"}, "style_key11": {"background": "#BD0B48", "color": "#FFFFFF"}, "style_key12": {"background": "#FDECD2", "color": "rgba(0,0,0,0.8)"}, "style_key13": {"background": "#FFC29C", "color": "rgba(0,0,0,0.8)"}, "style_key14": {"background": "#ED9120", "color": "#FFFFFF"}, "style_key15": {"background": "#CD5B44", "color": "#FFFFFF"}, "style_key16": {"background": "#FAF570", "color": "rgba(0,0,0,0.8)"}, "style_key17": {"background": "#C29953", "color": "#FFFFFF"}, "style_key18": {"background": "#02B140", "color": "#FFFFFF"}, "style_key19": {"background": "#D5F4D5", "color": "rgba(0,0,0,0.8)"}, "style_key20": {"background": "#009966", "color": "#FFFFFF"}, "style_key21": {"background": "#023220", "color": "#FFFFFF"}, "style_key22": {"background": "#E7E7E7", "color": "rgba(0,0,0,0.8)"}, "style_key23": {"background": "#808080", "color": "#FFFFFF"} }
请求例子¶
响应¶
HTTP 200,application/json。下方示例展示可直接读取的主要字段。
| 字段 | 类型 | 说明 |
|---|---|---|
| content.id | integer | 实体记录编号;列表id为UUID字符串,见列表字段。 |
| content.uuid | string | tag_标签UUID。 |
| content.workspaceUUID | string | 所属工作空间。 |
| content.name | string | 标签名称。 |
| content.description | string | 用途说明。 |
| content.colour | string | 颜色表示。 |
| content.scope | array<string> |
规范化作用域,历史null/空scope按["all"]返回。 |
| content.scope[] | string | all/scene/monitor/dialing/security/infrastructure/catalog之一。 |
| content.status | integer | 0有效、3删除,其他历史状态以实际数据为准。 |
| content.creator | string | 创建身份。 |
| content.updator | string | 最近修改身份。 |
| content.createAt | integer | 创建Unix秒。 |
| content.updateAt | integer | 更新Unix秒,未更新-1。 |
| content.deleteAt | integer | 删除Unix秒,未删除-1。 |
| content.declaration | object | 公共声明。 |
{
"code": 200,
"content": {
"id": 100,
"uuid": "tag_example",
"workspaceUUID": "wksp_example",
"name": "production",
"description": "生产资源统一标记。",
"colour": "default",
"scope": [
"scene",
"monitor"
],
"status": 0,
"creator": "wsak_example",
"updator": "",
"createAt": 1785427200,
"updateAt": -1,
"deleteAt": -1,
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
错误响应¶
鉴权、限流和公共请求错误参见公共错误定义。
| HTTP 状态 | errorCode | 触发条件 | 消息或响应说明 | 处理方式 |
|---|---|---|---|---|
| 404 | ft.ObjectNotExists | 本空间没有对应有效标签,或已删除 | 指定对象不存在 | 从当前空间列表取得有效UUID。 |
| 500 | ft.InternalServerError | 标签、引用/权限或身份资料读取与响应格式化失败 | 内部错误 | 核对空间和查询条件,稍后重试,持续失败提供traceId。 |