Updated on 2025-09-25 GMT+08:00

Creating a Build Job

Function

This API is used to create a build job.

URI

POST /assembling/v1/jobs

Table 1 describes the parameters.

Request

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format). Default value: application/json;charset=utf8.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain a token, see Obtaining a User Token.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

job_name

Yes

String

Build job name.

The value contains 2 to 64 characters consisting of letters, digits, hyphens (-), and underscores (_). It starts with a letter and ends with a letter or digit. Letters are case insensitive.

job_description

No

String

Build job description.

The value can contain up to 64 characters.

environment_setting

Yes

Object

Build environment information. See Table 4.

code_repo

No

Object

Build repository information. See Table 6.

enterprise_project_id

No

String

Enterprise project ID.

Table 3 Build environment information

Parameter

Mandatory

Type

Description

docker_version

No

String

Version of the Docker image to be built.

cluster_id

No

String

ID of the CCE cluster used for build.

use_public_cluster

No

bool

Whether to use a public cluster. Value: true or false.

cluster_name

No

String

Name of the CCE cluster used for build.

build_os

No

Object

Build architecture type. See Table 5.

Table 4 Build architecture type

Parameter

Mandatory

Type

Description

arch

No

String

Build architecture type. Value: x86_64 or aarch64.

Table 5 Build repository information

Parameter

Mandatory

Type

Description

type

Yes

String

Repository type, for example, Gitlab or Github.

url

Yes

String

Repository address.

branch

Yes

String

Branch.

namespace

Yes

String

Organization.

Response

Table 6 Response

Parameter

Type

Description

job_id

String

Build job ID.

job_name

String

Build job name.

job_description

String

Build job description.

cluster_name

String

Start time of the build job instance.

cluster_id

String

End time of the build job instance.

created_at

String

Creation time.

Example Request

None

Example Response

None

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

The error code format is SVCSTG.CPE.[Error_ID], for example, SVCSTG.CPE.5004401. For details, see ServiceStage Error Codes.