跳转至

获取



GET /api/v1/pipeline/{pl_uuid}/get

概述

读取Pipeline脚本、样例、版本与完整保存配置。

调用前和使用步骤

从列表取uuid。可读取本空间非删除配置,也可读取已知UUID的公共系统模板(workspaceUUID空串);系统模板不代表可直接修改。content/testData仍为base64,调用方解码UTF8后编辑,再重新编码提交。rum/llm详情source为[],使用extend.appID/measurement查看结构化绑定;系统模板source取模板名。

路由参数

参数名 类型 必选 说明
pl_uuid string Y 当前空间Pipeline UUID,区别历史UUID、名称或数字id。
例子: pl_example
获取或填写方式: 从Pipeline列表取uuid。

请求头

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

请求例子

curl --get 'https://openapi.guance.com/api/v1/pipeline/pl_example/get' \
  -H 'DF-API-KEY: <DF-API-KEY>'

响应

HTTP 200,application/json。下方示例展示可直接读取的主要字段。

字段 类型 说明
content.id integer 数据库编号,用uuid操作。
content.uuid string pl_对象UUID。
content.workspaceUUID string 所属空间;系统模板为空字符串。
content.isSysTemplate string / integer / boolean 是否系统模板,实体为Text列,可能返回字符串标记;按实际标记解析,不用字符串非空直接判断。
content.isCustomSysTemp integer 或 boolean 是否定制系统模板。
content.language string 模板/配置语言,可能空串。
content.status integer 0启用、2禁用、3删除。
content.creator string 创建身份。
content.updator string 最近更新身份。
content.createAt integer 创建Unix秒。
content.updateAt integer 更新Unix秒。
content.deleteAt integer 删除Unix秒,未删除-1。
content.name string 保存配置:必填,最大256计数单位(ASCII/半角片假名1,其他字符2),允许字母数字下划线中文U+4e00..9fa5及短横线;建议非空。相同category不允许重复,即使local/central不同或旧项禁用。不是输入日志source。
content.type string 保存配置:必填local/central;拨测dialtesting新增/修改只能central。空间版本可限制central。修改会替换原运行类型。
content.category string 保存配置:必填lineage/logging/object/custom_object/network/tracing/rum/llm/agent_monitor/security/keyevent/metric/profiling/dialtesting/cloud_billing;billing为历史兼容值。修改可变更类别,需要一起校对脚本、source和extend。
content.source array 保存配置:可选默认[],修改省略会移除全部来源关系。包含*或?的来源不参加精确唯一性冲突检查,不保证所有匹配运行时行为;普通精确来源在相同category/type内不可被其他非删除Pipeline占用。rum/llm新增修改忽略此数组,改用extend.appID与measurement。
content.source[] string 保存配置:建议非空字符串,数组未逐项严格校验;不要混不相关数据域。
content.content string 保存配置:必填base64字符串,新增解码后非空。解码脚本全文同时满足UI字符计数≤1048576和UTF8字节≤1048576;BMP非ASCII计2,补充字符计4。任一超限均ft.ContextExceedLimit。保存会同步无样本编译并检查同类别启用脚本引用,成功不等于真实数据调试通过或已生效。
content.testData string 保存配置:声明可选,但新增省略后controller解码None可返回InvalidBase64,应始终显式给W10=或空串。修改省略恢复空串。公开add/modify只接受空串,或严格base64解码后为空/JSON数组,不能直接编码单个对象。数组成员建议字符串或对象,数值/null可能在历史逐项长度校验导致500;每项历史限制约20480(对象按序列化对象内存大小、字符串按历史加权长度),不是脚本1MiB上限。
content.dataType string 保存配置:可选,默认line_protocol;支持line_protocol/json/message。修改省略恢复line_protocol;不是category。空字符串虽声明兼容,应明确选受支持值。
content.asDefault integer 保存配置:可选默认0,建议只给0/1;已有默认且未isForce时HTTP200返回confirm数组,本次目标配置未保存,不当作创建/修改成功。
content.enableByLogBackup integer 保存配置:可选默认0,建议0/1。保存标志不保证已有转发数据自动重跑。
content.extend json 保存配置:可选默认{};修改整体替换,不合并。rum/llm使用appID×measurement组合生成来源关系;未知子字段会被公开校验拒绝。
content.extend.appID array 保存配置:rum/llm应与measurement同时提供非空数组;两者都空可无专属来源,有appID无measurement报缺少参数。
content.extend.measurement array 保存配置:rum/llm与appID做笛卡尔组合;有measurement却没有appID报缺少参数,保存不验证每个应用/measurement确有数据。
content.extend.loggingIndex string 保存配置:可选日志索引回显字段,默认不补值,修改省略随extend清除;不是source数组。
content.extend.ifAiCreate boolean 保存配置:可选回显,不触发AI任务。
content.extend.aiTargetStructure string 保存配置:可选字符串,仅保存回显;本接口不生成脚本。
content.extend.exampleSource string 保存配置:可选回显,不代替source关联。
content.extend.exampleType string 保存配置:可选回显字符串,服务端未给固定枚举。
content.extend.appID[] string 保存配置:建议非空字符串。
content.extend.measurement[] string 保存配置:建议非空字符串。
content.configVersion integer 当前配置版本,初始1;配置发生实际变化时递增,启停不是配置快照字段。
content.configVersionAt integer 该配置版本生效记录时间,Unix秒。
content.configVersionOperator string 该版本操作者身份。
content.configVersionSource string 来源如openapi/console/history/workspace_restore/legacy/system。
content.configVersionAction string 如create/modify/import/official_clone/current_clone/history_restore/history_clone/default_replace/baseline。
content.configVersionSourceInfo object 来源动作资料,无来源时{},字段按动作可省略。
content.configVersionSourceInfo.templateName string 官方克隆来源模板名称。
content.configVersionSourceInfo.pipelineUUID string 来源Pipeline UUID。
content.configVersionSourceInfo.configVersion integer 来源配置版本号。
content.configVersionSourceInfo.pipelineHistoryUUID string 历史克隆/恢复来源历史UUID。
content.configVersionSourceInfo.replacedByName string 默认替换触发的新文件名。
content.configVersionSourceInfo.replacedByPipelineUUID string 默认替换触发的Pipeline UUID。
content.declaration object 公共声明。
{
  "code": 200,
  "content": {
    "id": 100,
    "uuid": "pl_example",
    "workspaceUUID": "wksp_example",
    "name": "production_parser",
    "type": "local",
    "category": "logging",
    "content": "YWRkX2tleSgiZW52IiwgInByb2R1Y3Rpb24iKQ==",
    "testData": "W3sibWVzc2FnZSI6ImV4YW1wbGUgbG9nIn1d",
    "dataType": "json",
    "asDefault": 0,
    "enableByLogBackup": 0,
    "extend": {
      "loggingIndex": "default"
    },
    "isSysTemplate": 0,
    "isCustomSysTemp": 0,
    "language": "",
    "status": 0,
    "creator": "wsak_example",
    "updator": "wsak_example",
    "createAt": 1785427200,
    "updateAt": 1785427200,
    "deleteAt": -1,
    "configVersion": 1,
    "configVersionAt": 1785427200,
    "configVersionOperator": "wsak_example",
    "configVersionSource": "openapi",
    "configVersionAction": "create",
    "configVersionSourceInfo": {},
    "source": [
      "nginx"
    ],
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

错误响应

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

HTTP 状态 errorCode 触发条件 消息或响应说明 处理方式
404 ft.NotFoundPipelineCfg 本空间Pipeline/历史不存在、已删除或其主配置已删除 未找到指定的Pipeline配置 从当前列表/历史列表重新取得UUID。
500 ft.InternalServerError 配置读取、身份资料或响应编码失败 内部错误 核对UUID和已保存数据,稍后重试,持续失败提供traceId。

文档评价

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