Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Build Task

Function

This API is used to create a build task.

Calling Method

For details, see Calling APIs.

URI

POST /v3/jobs/create

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API. (Value of X-Subject-Token in the response header.) Global tenant tokens are not supported. Use a region-level token whose scope is project.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

arch

Yes

String

Architecture.

project_id

Yes

String

ID of the project to which the build task belongs.

job_name

Yes

String

Task name.

auto_update_sub_module

No

String

Whether to automatically update submodules.

flavor

No

String

Executor flavors.

parameters

No

Array of CreateBuildJobParameter objects

Parameters for build execution.

scms

No

Array of CreateBuildJobScm objects

SCMs of build execution.

steps

Yes

Array of CreateBuildJobSteps objects

Build actions.

host_type

No

String

Host type.

build_config_type

No

String

Build configuration type.

Table 3 CreateBuildJobParameter

Parameter

Mandatory

Type

Description

name

No

String

Parameter definition name. The default value is hudson.model.StringParameterDefinition.

params

No

Array of CreateBuildJobParameterParam objects

Subparameters of build execution parameters.

Table 4 CreateBuildJobParameterParam

Parameter

Mandatory

Type

Description

name

No

String

Parameter field name.

value

No

String

Parameter field value.

limits

No

Array of LimitsParam objects

Restrictions on enumeration parameters.

Table 5 LimitsParam

Parameter

Mandatory

Type

Description

disable

No

String

Whether the configuration takes effect. The default value is 0, indicating that the configuration takes effect.

display_name

No

String

Parameter display name.

name

No

String

Parameter name.

Table 6 CreateBuildJobScm

Parameter

Mandatory

Type

Description

branch

No

String

Branch.

url

Yes

String

Code repository address.

repo_id

No

String

Repo ID.

web_url

No

String

HTTP address of the code repository.

scm_type

Yes

String

Repository type, such as Repo and GitHub.

is_auto_build

No

Boolean

Whether to enable auto build.

build_type

No

String

Build type.

depth

No

String

Clone depth.

end_point_id

No

String

endpointId

source

No

String

source

Table 7 CreateBuildJobSteps

Parameter

Mandatory

Type

Description

properties

No

Map<String,Object>

Build action.

module_id

Yes

String

Build module ID.

name

Yes

String

Build module name.

version

No

String

Build version.

enable

No

Boolean

Enable or not.

Response Parameters

Status code: 200

Table 8 Response body parameters

Parameter

Type

Description

result

result object

Result.

status

String

Status information.

error

String

Error message.

Table 9 result

Parameter

Type

Description

job_id

String

Build task ID.

Status code: 400

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

POST https://{endpoint}/v3/jobs/create

{
  "arch" : "x86-64",
  "project_id" : "a287e712be6c404ca26e5f69040fa12b",
  "job_name" : "examplejob",
  "auto_update_sub_module" : "false",
  "flavor" : "2u8g",
  "parameters" : [ {
    "name" : "hudson.model.StringParameterDefinition",
    "params" : [ {
      "name" : "name",
      "value" : "codeBranch"
    }, {
      "name" : "type",
      "value" : "normalparam"
    }, {
      "name" : "defaultValue",
      "value" : "master"
    }, {
      "name" : "description",
      "value" : "description"
    }, {
      "name" : "deletion",
      "value" : "false"
    }, {
      "name" : "defaults",
      "value" : "true"
    }, {
      "name" : "staticVar",
      "value" : "false"
    }, {
      "name" : "sensitiveVar",
      "value" : "false"
    } ]
  } ],
  "scms" : [ {
    "branch" : "master",
    "url" : "git@codehub.devcloud.cn-north-7.ulanqab.huawei.com:soso-test00001/an.git",
    "repo_id" : "2111746211",
    "web_url" : "https://codehub.devcloud.cn-north-7.ulanqab.huawei.com/codehub/2111746211/home",
    "scm_type" : "codehub",
    "is_auto_build" : false,
    "build_type" : "branch",
    "depth" : "1"
  } ],
  "steps" : [ {
    "properties" : null,
    "module_id" : "devcloud2018.codeci_action_20043.action",
    "name" : "Build with Maven",
    "version" : "20231001.6",
    "enable" : true
  } ],
  "host_type" : "devcloud"
}

Example Responses

Status code: 200

OK

{
  "result" : {
    "job_id" : "db8467d972cc47f7a1bd2a3a3e77596a"
  },
  "error" : null,
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback