Updated on 2026-01-12 GMT+08:00

Updating a Pipeline Template

Function

This API is used to update a pipeline template.

Calling Method

For details, see Calling APIs.

URI

PUT /v5/{tenant_id}/api/pipeline-templates/{template_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

tenant_id

Yes

String

Definition:

Tenant ID, that is, domain ID of a user.

Constraints:

N/A

Range:

The value consists of 32 characters, including digits and letters.

Default value:

N/A

template_id

Yes

String

Definition:

Template ID, which is the unique identifier of a template. Obtain the template ID by calling the API for querying templates. templates.id indicates the template ID.

Constraints:

N/A

Value range:

The value consists of 32 characters, including digits and letters.

Default value:

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition:

User token. Obtain a token (the value of the X-Subject-Token response header) by calling the IAM API for .

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Definition:

Template name.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

description

No

String

Definition:

Template description.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

language

Yes

String

Definition:

Template language.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

variables

No

Array of CustomVariableVO objects

Definition:

Custom parameter.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

definition

Yes

String

Definition:

Template orchestration JSON file, including stages.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

is_system

Yes

Boolean

Definition:

Whether the template is a system template.

Constraints:

N/A

Value range:

  • true: The template is a system template.

  • false: The template is not a system template.

Default value:

N/A

domain_id

Yes

String

Definition:

Tenant ID, that is, domain ID of a user.

Constraints:

N/A

Range:

The value consists of 32 characters, including digits and letters.

Default value:

N/A

is_show_source

Yes

Boolean

Definition:

Whether to display the pipeline source.

Constraints:

N/A

Value range:

  • true: Display the pipeline source.

  • false: Do not display the pipeline source.

Default value:

N/A

Table 4 CustomVariableVO

Parameter

Mandatory

Type

Description

name

No

String

Definition:

Custom parameter name.

Constraints:

N/A.

Value range:

Enter a maximum of 128 characters. Only letters, digits, and underscores (_) are supported.

Default value:

N/A.

sequence

No

Integer

Definition:

Parameter sequence number, which starts from 1.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

type

No

String

Definition:

Custom parameter type.

Constraints:

N/A.

Value range:

  • autoIncrement: auto-increment parameter.

  • enum: enumerated parameter.

  • string: string parameter.

Default value:

N/A.

value

No

String

Definition:

Default value of a custom parameter.

Constraints:

N/A.

Value range:

Max. 8,192 characters.

Default value:

N/A.

is_secret

No

Boolean

Definition:

Private parameter or not.

Constraints:

N/A.

Value range:

  • true: The parameter is private.

  • false: The parameter is not private.

Default value:

false.

description

No

String

Definition:

Parameter description.

Constraints:

N/A.

Value range:

Max. 1,024 characters.

Default value:

N/A.

is_runtime

No

Boolean

Definition:

Whether a parameter can be set at runtime.

Constraints:

N/A.

Value range:

  • true: The parameter can be set at runtime.

  • false: The parameter cannot be set at runtime.

Default value:

false.

limits

No

Array of objects

Definition:

Enumerated values.

Constraints:

N/A.

Value range:

Max. 1,024 characters for an enumerated value.

Default value:

N/A.

is_reset

No

Boolean

Definition:

Whether to reset. If the auto-increment parameter is edited, the edited value is used. Otherwise, the last digit increases.

Constraints:

N/A.

Value range:

  • true: Use the edited parameter value.

  • false: Use the auto-increment parameter.

Default value:

false.

latest_value

No

String

Definition:

Value of the parameter in the last run.

Constraints:

N/A.

Value range:

Max. 8,192 characters.

Default value:

N/A.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

templateId

String

Definition:

Template ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A

error_code

String

Parameter description:

Error code.

Value range:

N/A

Example Requests

PUT https://{endpoint}/v5/ce8df55870164338a72d7e828a966a2a/api/pipeline-templates/ad8a26f8b19a4b83a8d92eb733b65476

{
  "name" : "Creating a Pipeline Template-20231023212159",
  "language" : "none",
  "description" : "",
  "is_system" : false,
  "domain_id" : "ce8df55870164338a72d7e828a966a2a",
  "variables" : [ ],
  "is_show_source" : true,
  "definition" : "{\"stages\":[{\"name\":\"Stage_1\",\"sequence\":\"0\",\"jobs\":[{\"stage_id\":1698067319814,\"identifier\":\"16980673371452673e2a4-b3e1-4389-a145-fc57a4473137\",\"name\":\"CloudBuild template\",\"depends_on\":[],\"timeout\":\"\",\"timeout_unit\":\"\",\"steps\":[{\"name\":\"CloudBuild template\",\"task\":\"official_devcloud_cloudBuild_template\",\"sequence\":0,\"inputs\":[{\"key\":\"pipelineNumber\",\"value\":\"v1.0.0\"},{\"key\":\"artifactName\",\"value\":\"name\"},{\"key\":\"is_build_in\",\"value\":\"system\"},{\"key\":\"module_or_template_id\",\"value\":\"00057\"}],\"business_type\":\"Build\",\"runtime_attribution\":\"agent\",\"identifier\":\"1698067328741629de896-a67b-4c2a-be40-7f6531af2f19\",\"multi_step_editable\":0,\"official_task_version\":\"0.0.1\"}],\"resource\":\"{\\\"type\\\":\\\"system\\\",\\\"arch\\\":\\\"x86\\\"}\",\"condition\":\"${{ completed() }}\",\"exec_type\":\"OCTOPUS_JOB\",\"sequence\":0},{\"identifier\":\"1698067635354dba15971-5277-48fe-a219-8cd578aa8773\",\"name\":\"CodeCheck\",\"task\":\"official_devcloud_codeCheck_template\",\"sequence\":0,\"inputs\":[{\"key\":\"language\",\"value\":\"C/C++\"},{\"key\":\"module_or_template_id\",\"value\":\"d7dffaefb6d94c63a09cf141668356c7\"}],\"business_type\":\"Gate\",\"runtime_attribution\":\"agent\",\"identifier\":\"1698067631617e1847e52-06ff-429e-9bfa-492ae877f192\",\"multi_step_editable\":0,\"official_task_version\":\"0.0.1\"}],\"resource\":\"{\\\"type\\\":\\\"system\\\",\\\"arch\\\":\\\"x86\\\"}\",\"condition\":\"completed()\",\"exec_type\":\"OCTOPUS_JOB\",\"sequence\":1}],\"identifier\":\"1698067319814bd28be5a-eb0c-4bdf-9ac5-4b441ef46ef9\",\"pre\":[{\"task\":\"official_devcloud_autoTrigger\",\"sequence\":0}],\"post\":null,\"depends_on\":[],\"run_always\":false}]}"
}

Example Responses

Status code: 200

OK

{
  "templateId" : "ad8a26f8b19a4b83a8d92eb733b65476"
}

Status Codes

Status Code

Description

200

OK

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.