Help Center> CodeArts Build> API Reference> Task APIs> Obtaining Build Task Details
Updated on 2024-04-18 GMT+08:00

Obtaining Build Task Details

Function

This API is used to obtain build task details.

Calling Method

For details, see Calling APIs.

URI

GET /v3/jobs/{job_id}/query

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Build task ID. The task ID contains the 32 digits and letters at the end of the browser URL when the build task is edited.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

get_all_params

No

String

Enter true or false to specify whether returned parameters are complete.

Request Parameters

Table 3 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.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

result

CreateBuildJobRequestBody object

Template query result.

error

String

Returned error message.

status

String

Returned status information.

Table 5 CreateBuildJobRequestBody

Parameter

Type

Description

arch

String

Architecture.

project_id

String

ID of the project to which the build task belongs.

job_name

String

Task name.

auto_update_sub_module

String

Whether to automatically update submodules.

flavor

String

Executor flavors.

parameters

Array of CreateBuildJobParameter objects

Parameters for build execution.

scms

Array of CreateBuildJobScm objects

SCMs of build execution.

steps

Array of CreateBuildJobSteps objects

Build actions.

host_type

String

Host type.

build_config_type

String

Build configuration type.

Table 6 CreateBuildJobParameter

Parameter

Type

Description

name

String

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

params

Array of CreateBuildJobParameterParam objects

Subparameters of build execution parameters.

Table 7 CreateBuildJobParameterParam

Parameter

Type

Description

name

String

Parameter field name.

value

String

Parameter field value.

limits

Array of LimitsParam objects

Restrictions on enumeration parameters.

Table 8 LimitsParam

Parameter

Type

Description

disable

String

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

display_name

String

Parameter display name.

name

String

Parameter name.

Table 9 CreateBuildJobScm

Parameter

Type

Description

branch

String

Branch.

url

String

Code repository address.

repo_id

String

Repo ID.

web_url

String

HTTP address of the code repository.

scm_type

String

Repository type, such as Repo and GitHub.

is_auto_build

Boolean

Whether to enable auto build.

build_type

String

Build type.

depth

String

Clone depth.

end_point_id

String

endpointId

source

String

source

Table 10 CreateBuildJobSteps

Parameter

Type

Description

properties

Map<String,Object>

Build action.

module_id

String

Build module ID.

name

String

Build module name.

version

String

Build version.

enable

Boolean

Enable or not.

Status code: 400

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

POST https://{endpoint}/v3/jobs/48c66c6002964721be537cdc6ce0297b/query

Example Responses

Status code: 200

OK

{
  "result" : {
    "steps" : null,
    "arch" : "x86-64",
    "project_id" : "a287e712be6c404ca26e5f69040fa12b",
    "job_name" : "oychap213i2",
    "auto_update_sub_module" : "false",
    "flavor" : "2u8g",
    "parameters" : [ {
      "name" : "hudson.model.StringParameterDefinition",
      "params" : [ {
        "name" : "name",
        "value" : "codeBranch",
        "limits" : null
      }, {
        "name" : "type",
        "value" : "normalparam",
        "limits" : null
      }, {
        "name" : "defaultValue",
        "value" : "master",
        "limits" : null
      }, {
        "name" : "description",
        "value" : "Code branch, which is a predefined parameter",
        "limits" : null
      }, {
        "name" : "deletion",
        "value" : "false",
        "limits" : null
      }, {
        "name" : "defaults",
        "value" : "true",
        "limits" : null
      }, {
        "name" : "staticVar",
        "value" : "false",
        "limits" : null
      }, {
        "name" : "sensitiveVar",
        "value" : "false",
        "limits" : null
      } ]
    } ],
    "scms" : [ {
      "branch" : "master",
      "url" : "git@codehub.devcloud.cn-north-7.ulanqab.huawei.com:soso-test00001/an.git",
      "is_auto_build" : false,
      "scm_type" : "codehub",
      "end_point_id" : null,
      "web_url" : "https://devcloud.cn-north-7.ulanqab.huawei.com/codehub/2111746211/home",
      "source" : null,
      "build_type" : "branch",
      "depth" : "1",
      "repo_id" : "2111746211"
    } ],
    "host_type" : "devcloud"
  },
  "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.