Creating a Build Job
Function
This API is used to create a build job.
Request
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. |
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. |
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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
arch |
No |
String |
Build architecture type. Value: x86_64 or aarch64. |
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
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot