更新时间:2025-08-06 GMT+08:00
分享

根据模板uuid查询特定模板

功能介绍

根据模板uuid查询特定模板

调用方法

请参见如何调用API

URI

GET /v1/template/{uuid}/custom

表1 路径参数

参数

是否必选

参数类型

描述

uuid

String

uuid

请求参数

响应参数

状态码:200

表2 响应Body参数

参数

参数类型

描述

result

QueryTemplatesItems object

返回结果

error

String

返回错误信息

status

String

返回状态信息

表3 QueryTemplatesItems

参数

参数类型

描述

favourite

Boolean

参数解释

是否收藏模板。

取值范围

● true:收藏模板。

● false:未收藏模板。

nick_name

String

参数解释

昵称。

取值范围

不涉及。

id

String

参数解释

数据库中的主键id。

取值范围

不涉及。

uuid

String

参数解释

模板ID。

取值范围

不涉及。

template

QueryTemplateVo object

参数解释

构建步骤模板,需封装为驼峰式命名。

取值范围

不涉及。

type

String

参数解释

模板类别。

取值范围

不涉及。

public

Boolean

参数解释

模板是否公开。

取值范围

● true:公开。

● false:不公开。

name

String

参数解释

模板命名。

取值范围

不涉及。

create_time

String

参数解释

模板创建时间。

取值范围

不涉及。

domain_id

String

参数解释

租户ID。

取值范围

不涉及。

weight

Double

参数解释

权重。

取值范围

不涉及。

user_id

String

参数解释

用户id。

取值范围

不涉及。

user_name

String

参数解释

用户名。

取值范围

不涉及。

domain_name

String

参数解释

租户名称。

取值范围

不涉及。

scope

String

参数解释

模板范围,自定义模板默认为custom。

取值范围

不涉及。

description

String

参数解释

模板说明。

取值范围

不涉及。

tool_type

String

参数解释

构建工具类型,yaml构建还是action构建。

取值范围

不涉及。

intl_description

Object

参数解释

intl说明。

取值范围

不涉及。

parameters

Array of CreateBuildJobParameterResponse objects

参数解释

构建执行参数列表。

取值范围

不涉及。

i18n

Object

参数解释

i18n。

取值范围

不涉及。

表4 QueryTemplateVo

参数

参数类型

描述

steps

Array of CreateBuildJobStepsResponse objects

参数解释

构建执行的步骤。

取值范围

不涉及。

actions

Object

参数解释

构建步骤中的action。

取值范围

不涉及。

auto_update_sub_module

Boolean

参数解释

是否自动更新子模块。

取值范围

false:不更新子模块。

true:更新子模块。

image

String

参数解释

配置镜像地址。

取值范围

不涉及。

image_source

String

参数解释

配置镜像源的地址。

取值范围

不涉及。

表5 CreateBuildJobStepsResponse

参数

参数类型

描述

properties

Map<String,Object>

参数解释

构建步骤配置参数。

取值范围

不涉及。

module_id

String

参数解释

构建步骤ID。

取值范围

不涉及。

name

String

参数解释

构建步骤名称。

取值范围

不涉及。

version

String

参数解释

构建步骤版本。

取值范围

不涉及。

enable

Boolean

参数解释

是否开启自动构建任务。

取值范围

● true:开启。

● false:不开启。

表6 CreateBuildJobParameterResponse

参数

参数类型

描述

name

String

参数解释

参数定义名,默认为hudson.model.StringParameterDefinition。

取值范围

不涉及。

params

Array of CreateBuildJobParameterParamResponse objects

参数解释

构建执行参数子参数。

取值范围

不涉及。

表7 CreateBuildJobParameterParamResponse

参数

参数类型

描述

name

String

参数解释

参数字段名。

取值范围

不涉及。

value

String

参数解释

参数字段值。

取值范围

不涉及。

limits

Array of LimitsParamResponse objects

参数解释

枚举类参数限制。

取值范围

不涉及。

表8 LimitsParamResponse

参数

参数类型

描述

disable

String

参数解释

是否生效,默认为"0",为生效状态。

取值范围

不涉及。

display_name

String

参数解释

参数展示的名字。

取值范围

不涉及。

name

String

参数解释

参数名字。

取值范围

不涉及。

状态码:400

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码:401

表10 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码:403

表11 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码:404

表12 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码:500

表13 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

GET https://{endpoint}/v1/template/f79b7d8a71b34bd8b3f2bb5fabf06f5c/custom

响应示例

状态码:200

OK

{
  "result" : {
    "favourite" : true,
    "nick_name" : "gray1",
    "id" : "1772",
    "uuid" : "f79b7d8a71b34bd8b3f2bb5fabf06f5c",
    "template" : {
      "steps" : [ {
        "properties" : { },
        "module_id" : "devcloud2018.codeci_action_20018.action",
        "name" : "上传软件包到软件发布库",
        "version" : null,
        "enable" : true
      } ],
      "auto_update_sub_module" : false,
      "image" : false,
      "image_source" : false
    },
    "type" : "codeci",
    "public" : true,
    "name" : "test-123",
    "create_time" : "2025-05-19T15:00:40.000+00:00",
    "domain_id" : "764f03980afc4e5c97a1a9a73c1d707a",
    "weight" : 0,
    "user_id" : "6d7a54d45bf44a0684a7a682f719ffd9",
    "user_name" : "hwstaff_codeci_gray",
    "domain_name" : "hwstaff_codeci_gray",
    "scope" : "custom",
    "description" : "",
    "tool_type" : "",
    "intl_description" : { },
    "parameters" : [ {
      "name" : "hudson.model.StringParameterDefinition",
      "params" : [ {
        "name" : "name",
        "value" : "codeBranch"
      }, {
        "name" : "type",
        "value" : "normalparam"
      }, {
        "name" : "defaultValue",
        "value" : "master"
      }, {
        "name" : "description",
        "value" : "代码分支,系统预定义参数"
      }, {
        "name" : "deletion",
        "value" : "false"
      }, {
        "name" : "defaults",
        "value" : "true"
      }, {
        "name" : "staticVar",
        "value" : "false"
      }, {
        "name" : "sensitiveVar",
        "value" : "false"
      } ]
    } ],
    "i18n" : { }
  },
  "error" : null,
  "status" : "success"
}

状态码

状态码

描述

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

错误码

请参见错误码

相关文档