# 研发云互联互通规范数据开放和接入技术规范(试行稿) > 脱敏整理版:已移除编制人员、联系人和联系方式,并合并无意义硬换行。技术条款、章节和示例以原始 DOCX 为争议核验依据。 研发云互联互通规范 数据开放和接入技术规范 中国电信股份有限公司研究院研发云平台运营中心 ## 2025 年 5 月 1 > 编制人员信息已移除。 版本变更历史 3 ## 1 文档说明 ### 1.1 编制说明 本规范服务对象为中国电信集团及下属各级单位 ### 1.2 适用范围 中国电信集团范围内 ### 1.3 起草单位 中国电信股份有限公司研究院-研发云平台运营中心 ### 1.4 解释权 中国电信股份有限公司研究院-研发云平台运营中心 ### 1.5 版权 中国电信股份有限公司研究院-研发云平台运营中心 ### 1.6 名词解释 ## 2 数据开放 1 ### 2.1 数据开放标准表 目前,研发云数据开放支持对外开放基于研发云平台的基本对象的维度信息数据、基于研发云平台的研发过程效能度量明细数据、基于研发云平台的效能度量汇总模型数据等,具体可通过“研发云平台-能力开放专区-数据能力“查看目前已支持获取的数据开放表。 附件: ### 2.2 数据订阅接入技术说明 #### 2.2.1 数据订阅 DCOOS 接入说明 支持推送数据至 DCOOS 地址,DCOOS 注册及使用介绍参考“DCOOS(云桥)使用介绍”,更多问题请咨询云桥平台支撑团队。注意事项:注册 api 时须选择集团 eop,1.0 环境。 设置 DCOOS 方式时,除需填入地址外,还需从 DCOOS 平台获取 AppID、 AppKEY 填入后,方可保存设置。 #### 2.2.2 数据订阅 HTTPS/HTTP 接入说明 仅组织级数据订阅支持 HTTPS/HTTP 形式,基于数据安全要求,推荐HTTPS。接口地址开发完成并填入地址后,即可准备接收已订阅数据推送服务。 注意,以下情况可能会导致地址无法推送,保存不成功: 1.地址对应的服务无法正常访问(网络未放通或服务异常) 2.地址对应的服务没有参照研发云消息事件接收开发指南实现2 #### 2.2.3 数据订阅 Kafka 接入说明 Kafka 订阅需由度量数据管理员填入订阅方 IP 地址并发起申请后,经研发云平台内部审核、配置完成后开启推送服务。对需求方 java 环境的要求: 使用 Kafka 方式,java 的环境须是 jdk11 以及 11 以上版本!低于 jdk11 版本会导致认证失败。网络层面注意事项: 1.Kafka 订阅用户访问的是 10.158.231.51:9093,10.158.231.52:9093,10.158.231.53:9093,可以通过访问研发云的门户页面确定网络可达,但还需要提供用户订阅客户端程序的 1124 vpn 出口地址给研发云平台这边配置 Kafka网络白名单策略。2.出口 1124vpn 地址需用户自行确认,网络贯通情况可按以下方式测试验证(从订阅客户端程序发起)。3.IP 地址需提前进行网络自查确保可以访问研发云,可以用研发云的基础页面和服务来验证网络:● 对于图形界面可以用浏览器访问研发云https://www.srdcloud.cn● 对于字符界面可以用 curl https://www.srdcloud.cn 或telnet www.srdcloud.cn 443● 如果不能访问请先打通网络,参考研发云帮助文档网络接入章节 Kafka 接入说明: 我们将以邮件、消息提醒的方式通知您最终审核结果和相应的账号密码信息。开通成功后,请参照如下配置信息配置您的客户端程序:3 ● Kafka bootstrap server 连接地址:10.158.231.51:9093, 10.158.231.52:9093,10.158.231.53:9093● 客户端 truststore.jks 文件:generic_client.truststore.jks,文件密码:FT9@PxAk● Java 客户端程序配置示例: bootstrap.servers=10.158.231.51:9093,10.158.231.52:9093,10.158.231.53:9093 security.protocol=SASL_SSL sasl.mechanism=SCRAM-SHA-256 sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLogi nModule required \username="your_username" \password="your_password";ssl.truststore.location=/path/to/truststore.jks ssl.truststore.password=FT9@PxAk #### 2.2.4 数据订阅网络配置 DCOOS:只需订阅方打通与 DCOOS 网络即可; HTTPS/HTTP:需要告知研发云平台支撑人员订阅服务 IP 地址,由研发云放通出口网络策略。同时,订阅方服务侧也需要放通研发云的出口 IP(出口 IP联系研发云支撑团队获取);Kafka:只提供 1124VPN 接入,订阅方需要告知 Kafka 客户端 IP 地址,由研发云网络管理员配置 IP 白名单;注:若订阅方使用研发云数据同步 SDK 进行数据入库,都需要打通订阅系统与 DCOOS 的网络。 4 #### 2.2.5 数据订阅 SDK 使用 具体见:研发云数据推送 SDK 使用说明 ### 2.3 数据查询接口接入技术说明 具体见:https://www.srdcloud.cn/capopenzone/operatingGuide #### 2.3.1 接口访问账号 申请外部用户账号及角色(角色名:“外部通用中台数据开放接口”) #### 2.3.2 接口访问地址 研发云应用能力调用的 host 地址为:https://www.srdcloud.cn 网络放通地址:https://www.srdcloud.cn 10.158.231.10:443 #### 2.3.2 接口访问鉴权 在调用研发云应用能力接口时,需要携带外部用户账号鉴权信息,鉴权信息的格式如下: 上表中,authorization 字段是对{srdcloud-user-account },{time- 5 stamp},{secret}字串进行 SHA256 加密后,再进行 Base64 处理后得到的字串。注意 srdcloud-user-account、time-stamp 和 secret 三个字段值之间需要采用“, ”号隔开。srdcloud-user-account, secret 值由研发云分配提供,每个外部账号都有其专用的 secret 值。time-stamp 值由第三方进行设置。 #### 2.3.4 接口访问示例 ## 3 数据接入 ### 3.1 接入方式-能力开放接口 研发云平台提供统一的能力开放接口,以 OpenAPI 方式给外部系统使用。 OpenAPI 接入技术要求详见《5 研发云互联互通规范-能力开放技术规范(OpenAPI 接口)》 ### 3.2 接口规范 外部系统数据(包括研发活动指标和数据)可根据需要接入研发云。数据接入研发云时,根据对接的内部系统可细分,主要差异在于接口格式。a. 消息中心(统一 CloudEvents 格式,见能力开放专区的消息中心接口) 6 b. 其他中心(如测试中心,按实际业务要求定义) 已知接入方式有: ### 3.3 数据模型 #### 3.3.1 部署数据 使用消息中心接口规范 数据模型对应消息体中的 data.before 或者 data.after 字段,before 标识数据模型变更前的内容,after 标识数据模型变更后的内容。此外,消息体中还有 op 字段,值为 c/d/u/r 表示增删改查,其中 c 表示新增数据模型记录,d表示删除模型记录,u 表示更新模型记录,r 表示当前模型记录。当 op 等于 c和 r 时,before 为 null,after 不为 null;当 op 等于 d 时,before 不为null,after 为 null;当 op 的 u 时,before 和 after 都不为 null。 数据模型类型可分为: 汇总模型:与研发云的实体关联,如项目、人员、组织等的汇总指标,指标类型包括周期值和累计值,汇总周期通常是按天、按月、按年,更新频率通常为天。明细模型:业务明细数据,通常包括项目、人员、操作类型、操作时间、操作内容、扩展信息等。7 ##### 3.3.1.1 项目汇总模型 本模型接入时,设置消息事件 source:dmo.dws.dws_srd_project_deploy_period_1d。 本模型数据接入时,消息中心将按照以下 JsonSchema 进行校验,接入方可以提前验证是否合规。JSONSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "title": "dmo.dws.dws_srd_project_deploy_period_1d.Envelope", "description": "部署统计数据格式", "type": "object", "properties": { "before": { "$ref": "#/$defs/rowData", "description": "变更前的数据行,删除 操作时有值" }, "after": { "$ref": "#/$defs/rowData", "description": "变更后的数据行,创建 和更新操作时有值" }, "op": { "type": "string", "description": "操作类型: c=创建, u=更新, d=删除, r=读取", "enum": ["c", "u", "d", "r"] }, "ts_ms": { "type": ["integer", "null"], "description": "操作时间戳(毫秒),可选字段", "minimum": 0 8 } }, "required": ["op"], "additionalProperties": false, "$defs": { "rowData": { "type": ["object", "null"], "description": "项目部署统计行数据", "properties": { "day": { "description": "统计日期。支持:数字(自 1970-01-01 的天数)或 yyyy-MM- dd 格式", "x-dmo-type": "date", "oneOf": [ { "type": "integer", "minimum": 0, "description": "自 1970-01-01 的 天数,如 15628" }, { "type": "string", "pattern": "^\\d{4}-(0[1-9] |1[0-2])-(0[1- 9] |[12][0-9] |3[01])$", "description": "yyyy-MM-dd 格式的日期字符串" } ] }, "project_id": { "type": "integer", "description": "项目 ID,主键字段", "x-dmo-type": "int8", "minimum": 0 }, "parent_project_id": { "type": "integer", "description": "父项目 ID。0=一级项目汇总; 与 project_id 相同=父项目自身统计; 与 project_id 不同=子项目统计", "x-dmo-type": "int8", "minimum": 0 }, "deploy_cnt": { "type": ["integer", "null"], "description": "部署次数", "x-dmo-type": "int4", "minimum": 0 }, "success_deploy_cnt": { "type": ["integer", "null"], "description": "成功部署次数", "x-dmo-type": "int4", "minimum": 0 }, "total_deploy_duration": { "type": ["integer", "null"], "description": "部署任务持续总时间(秒)", "x-dmo-type": "int8", "minimum": 0 }, "success_deploy_duration": { "type": ["integer", "null"], "description": "成功部署任务持续总时间(秒)", "x-dmo-type": "int8", "minimum": ## 0 } }, "required": ["day", "project_id", "parent_project_id"], "x-dmo-pkey": ["day", "project_id", "parent_project_id"], "additionalProperties": false } } } ##### 3.3.1.2 人员-项目汇总模型 本模型接入时,设置消息事件 source:dmo.dws.dws_srd_user_project_deploy_period_1d。 9 本模型数据接入时,消息中心将按照以下 JsonSchema 进行校验,接入方可以提前验证是否合规。 { "$schema": "http://json-schema.org/draft-07/schema#", "title": "dmo.dws.dws_srd_user_project_deploy_period_1d.Envelope", "description": "用户项目部署中心业务周期值数据格式", "type": "object", "properties": { "before": { "$ref": "#/$defs/rowData", "description": "变更前的数据行" }, "after": { "$ref": "#/$defs/rowData", "description": "变更后的数据行" }, "op": { "type": "string", "description": "操作类型: c=创建, u=更新, d=删除, r=读取", "enum": ["c", "u", "d", "r"] }, "ts_ms": { "type": ["integer", "null"], "description": "操作时间戳(毫秒),可选字段", "minimum": 0 } }, "required": ["op"], "additionalProperties": false, "$defs": { "rowData": { "type": ["object", "null"], "description": "用户项目部署统计行数据", 10 "properties": { "day": { "description": "统计日期。支持:数字(自 1970-01-01 的天数)或 yyyy-MM- dd 格式", "x-dmo-type": "date", "oneOf": [ { "type": "integer", "minimum": 0, "description": "自 1970-01-01 的 天数,如 15628" }, { "type": "string", "pattern": "^\\d{4}-(0[1-9] |1[0-2])-(0[1- 9] |[12][0-9] |3[01])$", "description": "yyyy-MM-dd 格式的日期字符串" } ] }, "user_id": { "type": "integer", "description": "用户 ID", "x-dmo-type": "int8", "minimum": 0 }, "project_id": { "type": "integer", "description": "项目 ID", "x-dmo- type": "int8", "minimum": 0 }, "parent_project_id": { "type": "integer", "description": "父项目 ID。0=一级项目汇总; 与 project_id 相同=父项目自身统计; 与 project_id 不同=子项目统计", "x-dmo-type": "int8", "minimum": 0 }, "deploy_cnt": { "type": ["integer", "null"], "description": "部署次数", "x-dmo-type": "int4", "minimum": 0 }, "success_deploy_cnt": { "type": ["integer", "null"], "description": "成功部署次数", "x-dmo-type": "int4", "minimum": 0 }, "total_deploy_duration": { "type": ["integer", "null"], "description": "部署任务持续总时间(秒)", "x-dmo-type": "int8", "minimum": 0 }, "success_deploy_duration": { "type": ["integer", "null"], "description": "成功部署任务持续总时间(秒)", "x-dmo-type": "int8", "minimum": ## 0 } }, "required": ["day", "user_id", "project_id", "parent_project_id"], "x-dmo-pkey": ["day", "user_id", "project_id", "parent_project_id"], "additionalProperties": false } } } ##### 3.3.1.3 部署任务汇总模型 本模型接入时,设置消息事件 source:dmo.dws.dws_srd_user_project_cd_period_1d。 11 parent_project_id day create_cd_task_cnt bigint date integer 父项目 ID 。 三种可能情况:父项目 ID 为 0,则是一级项目数据的“汇总”; 父项目 ID 与项目 ID 非空且相同,则是父项 必填目自身的统计; 父项目 ID 与项目 ID 非空且不同,则是子项目的统计。日期 必填创建部署任务次数 必填 本模型数据接入时,消息中心将按照以下 JsonSchema 进行校验,接入方可以提前验证是否合规。JsonSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "title": "dmo.dws.dws_srd_user_project_cd_period_1d.Envelope", "description": "用户项目部署周期统计数据格式", "type": "object", "properties": { "before": { "$ref": "#/$defs/rowData", "description": "变更前的数据行" }, "after": { "$ref": "#/$defs/rowData", "description": "变更后的数据行" }, "op": { "type": "string", "description": "操作类型: c=创建, u=更新, d=删除, r=读取", "enum": ["c", "u", "d", "r"] }, "ts_ms": { "type": ["integer", "null"], "description": "操作时间戳(毫秒),可选字段", "minimum": 0 } }, "required": ["op"], "additionalProperties": false, "$defs": { "rowData": { "type": ["object", "null"], "description": "用户项目部署统计行数据", "properties": { "user_id": { "type": "integer", "description": "用户 ID", "x-dmo-type": "int8", "minimum": 0 }, "project_id": { "type": "integer", "description": "项目 ID", "x-dmo- type": "int8", "minimum": 0 }, "parent_project_id": { "type": "integer", "description": "父项目 ID。0=一级项目汇总; 与 project_id 相同=父项目自身统计; 与 project_id 不同=子项目统计", "x-dmo-type": "int8", "minimum": 0 }, "day": { "description": "统计日期。支持:数字(自 1970-01-01 的天数)或 yyyy-MM- dd 格式", "x-dmo-type": "date", 12 "oneOf": [ { "type": "integer", "minimum": 0, "description": "自 1970-01-01 的 天数,如 15628" }, { "type": "string", "pattern": "^\\d{4}-(0[1-9] |1[0-2])-(0[1- 9] |[12][0-9] |3[01])$", "description": "yyyy-MM-dd 格式的日期字符串" } ] }, "create_cd_task_cnt": { "type": ["integer", "null"], "description": "创建部署任务次数", "x-dmo-type": "int4", "minimum": 0 } }, "required": ["day", "user_id", "project_id", "parent_project_id"], "x-dmo-pkey": ["day", "user_id", "project_id", "parent_project_id"], "additionalProperties": false } } } ##### 3.3.1.4 部署任务执行记录明细模型 本模型接入时,设置消息事件 source:dmo.dwd.dwd_srd_deploy_task_record_s。 13 pipeline_wait_mode apply_exec_mode apply_exec_time apply_status apply_approval_info commit_id create_time start_time end_time queue_time character varying(64) character varying(64) timestamp with time zone character varying(64) json character varying(256) timestamp with time zone timestamp with time zone timestamp with time zone timestamp with time zone 否 否 否 否 否 否 否 否 否 否 流水线等待模式,当oprFrom 取值为 pipeline 时为必须,可取值为: sync–流水线同步等待部署任务执行结束 async–流水线不等待部署任务结束审批后执行模式,取值为:AtOnce – 审批成功后立即执行 PlanTime – 审批成功后按时间计划执行申请审核的最迟时间或者任务计划执行时间, 如果execMode 为 AtOnce 的话,则为最迟审核时间,过了这个时间本申请作废; 如果 execMode 为 PlanTime 的话,那么这个时间为审批通过后任务执行时间。注意,这也是该申请最迟审核时间,过了这个时间本申请作废;申请审核状态,取值为:waiting-审核中 accepted-审核通过 rejected-审核不通过 timeout-审核超时 aborted-任务取消审核人信息,Json 数组,举例: {user_id: ,name: ,opr: ,time: }流水线触发时,取流水线传入的提交 ID 部署任务创建时间任务开始执行时间,格式为yyyy-MM-dd HH:mm:ss任务结束执行时间,格式为yyyy-MM-dd HH:mm:ss任务开始排队时间,当该任务要执行但同样的模版已有其他任务在执行就进入排队,这个字段为开始进入开对的时间,格式为 yyyy-MM- 选填/如有 选填/如有 选填/如有 选填/如有 选填/如有选填/如有选填/如有必填选填/计算执行时长 选填/如有 14 dd HH:mm:ss.mmm(细化到毫秒)该任务的状态,取值为: 本模型数据接入时,消息中心将按照以下 JsonSchema 进行校验,接入方可以提前验证是否合规。JsonSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "title": "dmo.dwd.dwd_srd_deploy_task_record_s.Envelope", "description": "部署任务记录数据格式", "type": "object", "properties": { "before": { "$ref": "#/$defs/rowData", "description": "变更前的数据行" }, "after": { "$ref": "#/$defs/rowData", "description": "变更后的数据行" }, "op": { "type": "string", "description": "操作类型: c=创建, u=更新, d=删除, r=读取", "enum": ["c", "u", "d", "r"] }, "ts_ms": { "type": ["integer", "null"], "description": "操作时间戳(毫秒),可选字段", "minimum": 0 } }, "required": ["op"], 15 "additionalProperties": false, "$defs": { "rowData": { "type": ["object", "null"], "description": "部署任务记录行数据", "properties": { "id": { "type": "string", "description": "业务记录 ID", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "area": { "type": "string", "description": "区域, GuangZhou/GuiZhou", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "project_id": { "type": ["integer", "null"], "description": "研发云项目 ID", "x-dmo-type": "int8", "minimum": 0 }, "parent_project_id": { "type": ["integer", "null"], "description": "父 项目 ID(一级项目时与 project_id 一致)", "x-dmo-type": "int8", "minimum": 0 }, "task_template_id": { "type": ["integer", "null"], "description": "部署任务模板 id", "x-dmo-type": "int8", "minimum": 0 }, "operator_id": { "type": ["integer", "null"], "description": "执行人 id", "x-dmo-type": "int8", "minimum": 0 }, "canceller_id": { "type": ["integer", "null"], "description": "任务取消 人 id", "x-dmo-type": "int8", "minimum": 0 }, "pipeline_operation_id": { "type": ["string", "null"], "description": " 流水线触发 id", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "pipeline_cancel_id": { "type": ["string", "null"], "description": "流 水线取消 id", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "pipeline_wait_mode": { "type": ["string", "null"], "description": "流 水线等待模式: sync/async", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "apply_exec_mode": { "type": ["string", "null"], "description": "审批后 执行模式: AtOnce/PlanTime", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "apply_exec_time": { "type": ["string", "number", "null"], "description": "计划执行时间", "x-dmo-type": "timestamptz", "oneOf": [ { "type": "number", "description": "毫秒时间戳" }, { "type": "string", "format": "date-time" }, { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$" }, { "type": "null" } ] }, "apply_status": { "type": ["string", "null"], "description": "审核状态", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "apply_approval_info": { "type": ["object", "null"], "description": "审核人信息(json 数组)", "x-dmo-type": "json" }, "commit_id": { "type": ["string", "null"], "description": "提交 ID", "x-dmo-type": "varchar(256)", "maxLength": 256 }, "create_time": { "type": ["string", "number", "null"], "description": "任务创建时间", "x-dmo-type": "timestamptz", "oneOf": [ { "type": "number" }, { "type": "string", "format": "date-time" }, { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$" }, { "type": "null" } ] 16 }, "start_time": { "type": ["string", "number", "null"], "description": "开始执行时间", "x-dmo-type": "timestamptz", "oneOf": [ { "type": "number" }, { "type": "string", "format": "date-time" }, { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$" }, { "type": "null" } ] }, "end_time": { "type": ["string", "number", "null"], "description": "结束执行时间", "x-dmo-type": "timestamptz", "oneOf": [ { "type": "number" }, { "type": "string", "format": "date-time" }, { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$" }, { "type": "null" } ] }, "queue_time": { "type": ["string", "number", "null"], "description": "开始排队时间", "x-dmo-type": "timestamptz", "oneOf": [ { "type": "number" }, { "type": "string", "format": "date-time" }, { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$" }, { "type": "null" } ] }, "status": { "type": "string", "description": "任务状态", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "version_id": { "type": "string", "description": "版本中心版本 id", "x- dmo-type": "varchar(64)", "maxLength": 64 }, "artifact_uris": { "type": ["array", "null"], "description": "部署制品URI 列表", "x-dmo-type": "json" }, "task_type": { "type": ["string", "null"], "description": "任务类型: 0=普通, 1=灰度", "x-dmo-type": "varchar" } }, "required": ["id", "area", "version_id", "project_id"], "x-dmo-pkey": ["id", "area"], "additionalProperties": false } } } 17 ##### 3.3.1.5 部署任务模板明细模型 本模型接入时,设置消息事件 source:dmo.dwd.dwd_cd_deploy_task_template。 注释部署任务模板 id区域,GuangZhou/GuiZhou,用于区分基础版项目还是云网版项目 物理删除标识(0:正常; 1:删除)模版名称 任务模版显示名称研发云项目 ID该模版是否已发布,取值:0-未发布;1-已发布部署任务模板审批方式,取值:none-不审批singleApproval-或签groupApproval-会签任务模版部署类型部署任务模版中环境信息,当任务为灰度发布任务时才有值。 任务模板创建时间 任务模板更新时间 任务模板创建人 id 任务模板更新人 id描述 备注必填 必填 必填 必填 必填必填必填 必填 选填/如有选填/如有 选填/如有 选填/如有选填/如有选填/如有选填/如有 18 本模型数据接入时,消息中心将按照以下 JsonSchema 进行校验,接入方可以提前验证是否合规。JsonSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "title": "dmo.dwd.dwd_cd_deploy_task_template.Envelope", "description": "部署任务模板数据格式", "type": "object", "properties": { "before": { "$ref": "#/$defs/rowData", "description": "变更前的数据行" }, "after": { "$ref": "#/$defs/rowData", "description": "变更后的数据行" }, "op": { "type": "string", "description": "操作类型: c=创建, u=更新, d=删除, r=读取", "enum": ["c", "u", "d", "r"] }, "ts_ms": { "type": ["integer", "null"], "description": "操作时间戳(毫秒),可选字段", "minimum": 0 } }, "required": ["op"], "additionalProperties": false, "$defs": { "rowData": { "type": ["object", "null"], "description": "部署任务模板行数据", "properties": { "id": { "type": "integer", "description": "部署任务模板 id", "x-dmo- type": "int8", "minimum": 0 }, "area": { "type": "string", "description": "区域, GuangZhou/GuiZhou", "x-dmo-type": "varchar(16)", "maxLength": 16 }, "ph_del": { "type": ["integer", "null"], "description": "物理删除: 0=正常, 1=删除", "x-dmo-type": "int2", "minimum": 0, "maximum": 1 }, "name": { "type": ["string", "null"], "description": "模版名称", "x- dmo-type": "varchar(64)", "maxLength": 64 }, "display_name": { "type": ["string", "null"], "description": "任务模版显示名称", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "project_id": { "type": ["integer", "null"], "description": "研发云项目ID", "x-dmo-type": "int8", "minimum": 0 }, "has_published": { "type": ["integer", "null"], "description": "是否已发布: 0=否, 1=是", "x-dmo-type": "int2", "minimum": 0, "maximum": 1 }, "task_approval_type": { "type": ["string", "null"], "description": "审批方式: none/singleApproval/groupApproval", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "is_ccse": { "type": ["string", "null"], "description": "部署类型", "x- dmo-type": "varchar(64)", "maxLength": 64 }, "environment": { "type": ["object", "null"], "description": "环境信息(灰度任务时存在)", "x-dmo-type": "json" }, "create_date": { "type": ["string", "number", "null"], 19 "description": "创建时间", "x-dmo-type": "timestamptz", "oneOf": [ { "type": "number", "description": "毫秒时间戳" }, { "type": "string", "format": "date-time" }, { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$" }, { "type": "null" } ] }, "update_date": { "type": ["string", "number", "null"], "description": "更新时间", "x-dmo-type": "timestamptz", "oneOf": [ { "type": "number" }, { "type": "string", "format": "date-time" }, { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$" }, { "type": "null" } ] }, "create_by": { "type": ["integer", "null"], "description": "创建人 ID", "x-dmo-type": "int8", "minimum": 0 }, "update_by": { "type": ["integer", "null"], "description": "更新人 ID", "x-dmo-type": "int8", "minimum": 0 }, "description": { "type": ["string", "null"], "description": "描述", "x- dmo-type": "varchar(512)", "maxLength": 512 } }, "required": ["id", "area", "project_id"], "x-dmo-pkey": ["id", "area"], "additionalProperties": false } } } ##### 3.3.1.6 部署对象明细模型(非必选) 可用于传输部署任务部署的对象、环境等信息。本模型接入时,设置消息事件 source:dmo.dwd.dwd_cd_deploy_object。 20 21 本模型数据接入时,消息中心将按照以下 JsonSchema 进行校验,接入方可以提前验证是否合规。JsonSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "title": "dmo.dwd.dwd_cd_deploy_object.Envelope", "description": "部署对象数据格式", "type": "object", "properties": { "before": { "$ref": "#/$defs/rowData", "description": "变更前的数据行" }, "after": { "$ref": "#/$defs/rowData", "description": "变更后的数据行" }, "op": { "type": "string", "description": "操作类型: c=创建, u=更新, d=删除, r=读取", "enum": ["c", "u", "d", "r"] }, "ts_ms": { "type": ["integer", "null"], "description": "操作时间戳(毫秒),可选字段", "minimum": 0 } }, "required": ["op"], "additionalProperties": false, "$defs": { "rowData": { "type": ["object", "null"], "description": "部署对象行数据", "properties": { 22 "id": { "type": "integer", "description": "部署对象 id", "x-dmo-type": "int8", "minimum": 0 }, "area": { "type": "string", "description": "区域, GuangZhou/GuiZhou", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "deploy_object_name": { "type": ["string", "null"], "description": "部署对象名称", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "deploy_object_type": { "type": ["integer", "null"], "description": "类型:1=deployment, 8=nginxport", "x-dmo-type": "int2", "minimum": 1, "maximum": ## 8 }, "ns_id": { "type": ["string", "null"], "description": "命名空间 id", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "res_entity_id": { "type": ["string", "null"], "description": "资源实体id", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "project_id": { "type": "integer", "description": "项目 id", "x-dmo- type": "int8", "minimum": 0 }, "relative_id": { "type": ["integer", "null"], "description": "关联workload 的 id", "x-dmo-type": "int4", "minimum": 0 }, "deploy_env_type": { "type": ["integer", "null"], "description": "环境类型:1=K8S,2=ccse3", "x-dmo-type": "int2", "minimum": 1, "maximum": 2 }, "res_entity_name": { "type": ["string", "null"], "description": "集群名称", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "domain_name": { "type": ["string", "null"], "description": "部署环境", "x-dmo-type": "varchar(256)", "maxLength": 256 }, "namespace": { "type": ["string", "null"], "description": "命名空间", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "node_label_id": { "type": ["string", "null"], "description": "节点标签id", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "node_labels": { "type": ["string", "null"], "description": "节点标签", "x-dmo-type": "varchar(128)", "maxLength": 128 }, "image": { "type": ["string", "null"], "description": "镜像", "x-dmo- type": "varchar(1024)", "maxLength": 1024 }, "extra_data": { "type": ["string", "null"], "description": "额外数据", "x-dmo-type": "varchar(2048)", "maxLength": 2048 }, "last_update_deploy_task_name": { "type": ["string", "null"], "description": "最后更新任务名称", "x-dmo-type": "varchar(128)", "maxLength": ## 128 }, "version": { "type": ["string", "null"], "description": "任务版本号", "x-dmo-type": "varchar(255)", "maxLength": 255 }, "task_template_id": { "type": ["string", "null"], "description": "任务模板 id", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "last_replicas": { "type": ["integer", "null"], "description": "上次副本数", "x-dmo-type": "int2", "minimum": 0 }, "create_by": { "type": ["string", "null"], "description": "创建者", "x- dmo-type": "varchar(255)", "maxLength": 255 }, "create_date": { "type": ["string", "number", "null"], "description": "创建时间", "x-dmo-type": "timestamptz", "oneOf": [ { "type": "number", "description": "Unix 时间戳(毫秒级)" }, { "type": "string", "format": "date-time" }, { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$" }, { "type": "null" } ] }, 23 "update_by": { "type": ["string", "null"], "description": "更新者", "x- dmo-type": "varchar(255)", "maxLength": 255 }, "update_date": { "type": ["string", "number", "null"], "description": "更新时间", "x-dmo-type": "timestamptz", "oneOf": [ { "type": "number" }, { "type": "string", "format": "date-time" }, { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$" }, { "type": "null" } ] }, "commit_id": { "type": ["string", "null"], "description": "提交 ID", "x-dmo-type": "varchar(256)", "maxLength": 256 }, "version_id": { "type": "string", "description": "版本 ID", "x-dmo- type": "varchar(256)", "maxLength": 256 }, "type": { "type": ["string", "null"], "description": "环境类型: test、 pro", "x-dmo-type": "varchar(64)", "maxLength": 64 }, "state_data": { "type": ["object", "null"], "description": "状态信息, Pod 信息", "x-dmo-type": "jsonb" }, "is_state_fetchable": { "type": ["integer", "null"], "description": "是否可获取状态: 1=是, 0=未知", "x-dmo-type": "int2", "minimum": 0, "maximum": ## 1 }, "ph_del": { "type": ["integer", "null"], "description": "物理删除: 0=正常, 1=删除", "x-dmo-type": "int2", "minimum": 0, "maximum": 1 } }, "required": ["id", "area", "version_id", "project_id"], "x-dmo-pkey": ["id", "area"], "additionalProperties": false } } } ##### 3.3.1.7 数据类型格式说明 以下描述支持的数据类型,必须按照以下数据类型格式说明接入。 无限制长度文本:string 表示接入的字段是字符串,且长度不可预知,一般比较大的文本。 固定长度字符串:char 表示接入的字段是固定长度的字符串。24 可变长度字符串:varchar 表示接入的字段时有限长度但长度不固定的字符串。 短整数:smallint 表示 16 位整数。 整数:int 表示 32 位整数。 长整数:bigint 表示 64 位整数。 短浮点数:float 表示 32 位浮点数。 长浮点数:double 表示 64 位浮点数。 精确数字:decimal 精确数字,需要同时配置长度和小数位。 日期时间:datetime 字符串表示的日期时间类型。支持:yyyy-MM-dd HH:mm:ss。支持:yyyy-MM-ddTHH:mm:ss.SSSZ。25 时间戳: timestamp 字符串表示的日期时间类型。支持:毫秒级数字时间戳,1740992677000。支持:yyyy-MM-ddTHH:mm:ss.SSSZ,标准的 ISO 时间戳格式。支持:yyyy-MM-dd HH:mm:ss。 日期: date 字符串表示的日期类型。支持:数字,15628:表示自 1970-01-01 自今天的天数。支持:yyyy-MM-dd。 布尔:boolean 字符串表示的布尔值:true/false。 二进制:binary 表示使用 base64 编码的字符串,实际写入时会转成二进制存储。如果没有特殊需求,不建议使用。Json 类型:json 表示 Json 格式的字符串,实际写入时会校验并转成格式化的 json。 #### 3.3.2 测试数据 26 测试数据上报至研发云平台, 目前提供 OpenAPI 方式,包括人工测试、自动化测试两种场景上报流程。能力开放规范详情、接口详情,见研发云-能力开放专区:https://www.srdcloud.cn/capopenzone/ability ■ 人工测试上报流程:人工测试上报,基于测试用例、人工计划实现,支持两种上报流程。第一种是简化流程,适用于上报历史存量数据: 1)创建测试用例(3.3.2.1 接口); 2)一次性上报整个人工计划及结果信息(3.3.2.2 接口)。 第二种为业务对接模式的上报流程: 1)创建测试用例(3.3.2.1 接口); 2)创建人工计划,包括设置与测试用例的关联(3.3.2.3 接口); 3)针对人工计划和测试用例,提交人工测试结果,支持用例结果的提交以及步骤结果的提交(3.3.2.4 接口)。 ■ 自动化测试上报流程:自动化测试结果上报,基于自动化计划实现,上报内容支持脚本结果上报、回填结果上报。基本流程为: 1)创建测试用例,用户平台若无用例管理,可忽略本步骤; 2)创建自动化计划,提供计划名称、描述等基本信息说明; 3)对该计划上报自动化结果,每次上报须上报自动化计划的完整测试结果,即表示一次自动化测试记录,触发上报多次则表示要创建多条自动化测试记录。一次完整的自动化测试记录,包括计划脚本执行结果、执行耗时等信息,同时还支持上报用例回填信息、脚本日志、原生报告链接等可选信息。 27 ##### 3.3.2.1 测试用例 说明用户平台新建用例或对存量用例同步到研发云时,调用本接口实现接口地址https://www.srdcloud.cn/api/tsback/openapi/testcase/v1/add-case请求体 28 CaseDesc 数据结构: DescStep 数据结构: 返回响应HTTP 状态码: 200 Data 数据结构: ##### 3.3.2.2 人工计划及结果上报 说明用户平台上报人工测试计划、及测试结果,适用于对历史存量数据的上报 29 接口地址https://www.srdcloud.cn/api/tsback/openapi/mantest/v1/commit-manplan-result消息体Case 数据结构: Description 数据结构: 30 StepResult 数据结构: 返回响应HTTP 状态码: 200 Data 数据结构: ##### 3.3.2.3 人工计划 说明用户平台新建人工计划或对存量人工计划同步到研发云时,调用本接口实现接口地址https://www.srdcloud.cn/api/tsback/openapi/plan/v1/create-plan消息体 31 Case 数据结构: Demand 数据结构: 返回响应HTTP 状态码: 200 Data 数据结构: 32 ##### 3.3.2.4 人工结果上报 说明用户平台提交人工测试结果 或 对存量测试结果上报,都可使用本接口接口地址https://www.srdcloud.cn/api/tsback/openapi/mantest/v1/commit-result消息体 Description 数据结构: StepResult 数据结构: 33 返回响应HTTP 状态码: 200 Data 数据结构: ##### 3.3.2.5 自动化计划 说明用户平台新建自动化计划或对存量自动化计划同步到研发云时,调用本接口实现接口地址https://www.srdcloud.cn/api/tsback/openapi/autoplan/v1/create-autoplan消息体 34 Data 数据结构: ##### 3.3.2.6 自动化结果上报 接口说明上报自动化计划的执行结果,包括脚本执行结果、回填信息等。本接口调用前提是用户已在研发云创建相应的自动化计划,然后基于计划 ID 上报自动化执行结果。接口地址https://www.srdcloud.cn/api/tsback/openapi/autoresult/v1/callback-autoresult消息体 ScriptResult 数据结构: 35 ScriptInfo 数据结构: CaseResult 数据结构: BackFill 数据结构: 36 注:backfill 回填信息,研发云用于展示在脚本执行页-回填 tab 页,第三方平台若有提取相关信息便可以上报返回响应HTTP 状态码: 200 Data 数据结构: 37