Help Center/ CodeArts Build/ API Reference/ Task APIs/ Obtaining build task Details
Updated on 2023-12-06 GMT+08:00

Obtaining build task Details

Function

Obtaining 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

Indicates the ID of the build task. The value is a string of 32 characters consisting of digits and letters at the end of the browser URL when you edit the build task file.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

get_all_params

No

String

Enter true or false to control whether the returned parameters are complete.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. Obtain the value by calling the IAM service interface. (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

Object

Template query result

error

String

An error message is returned.

status

String

Returned status information.

Table 5 CreateBuildJobRequestBody

Parameter

Type

Description

arch

String

Architecture Using Machines

project_id

String

ID of the project to which the build task belongs.

job_name

String

Task Name

auto_update_sub_module

String

Indicates whether to automatically update submodules.

flavor

String

Executor Specifications

parameters

Array of CreateBuildJobParameter objects

List of build execution parameters

scms

Array of CreateBuildJobScm objects

Build Execution SCM

steps

Array of CreateBuildJobSteps objects

Build Execution Steps

host_type

String

Host Type

build_config_type

String

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 Construction 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

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

display_name

String

Name of a parameter.

name

String

Parameter

Table 9 CreateBuildJobScm

Parameter

Type

Description

branch

String

Branch

url

String

Code Repository Address

repo_id

String

Specifies the 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

Indicates whether to automatically 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>

Specific Construction Procedure

module_id

String

Indicates the ID of the building module.

name

String

Building Module Name

version

String

Build version

enable

Boolean

Whether to enable this feature.

Status code: 400

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 401

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 403

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 404

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 500

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Example Requests

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

Example Responses

Status code: 200

OK

{
  "result" : {
    "steps" : [ {
      "properties" : {
        "image" : "maven3.5.3-jdk8-open",
        "snapshotArtifact" : {
          "displayName" : "",
          "value" : ""
        },
        "userPrivateRepositories" : [ ],
        "deal" : "notDeal",
        "dependencyCheckParam" : " ",
        "userPublicRepositories" : [ ],
        "settingMode" : "auto",
        "doCheck" : "disable",
        "junitCoverageSwitch" : false,
        "coverageReportPath" : "**/site/jacoco",
        "releaseArtifact" : {
          "displayName" : "",
          "value" : ""
        },
        "cacheOption" : "cached",
        "command" : "# Function: packaging\n# Parameter description:\n#-Dmaven.test.skip=true: Skip the unit test.\n#-U: The dependency update is checked for each build. This avoids the problem that the snapshot version dependency in the cache is not updated, but some performance is affected.\n#-e -X: prints debugging information. You are advised to use this parameter to locate difficult build problems.\n#-B: Run in batch mode to avoid the ArrayIndexOutOfBoundsException exception during log printing.\n# Scenario: Used for packaging projects when unit tests are not required.\nmvn package -Dmaven.test.skip=true -U -e -X -B\n\n# Function: packaging; executing unit tests, but ignoring unit test case failures. Dependency updates are checked for each build.\n#Application scenario: Unit tests need to be executed, and the unit test report service provided by the build is used to collect statistics on the execution status.\n# Usage condition: Select Process Unit Test Result in Unit Test and enter the correct path of the test result file.\n#mvn package -Dmaven.test.failure.ignore=true -U -e -X -B\n\n# Function: Pack and release dependency packages to the private dependency library.\n#Application scenario: The build result of the current project needs to be released to the private dependency repository for other Maven projects to reference.\n#Note: The target repository to be uploaded is the CodeArts private dependency repository. Note that the target repository must be different from the software release repository.\n#mvn deploy -Dmaven.test.skip=true -U -e -X -B",
        "file" : "**/TEST*.xml",
        "dependencyProjectDir" : "./",
        "ignoreTest" : false,
        "pomMode" : "no",
        "dependencySettings" : "~/.m2/settings.xml"
      },
      "module_id" : "devcloud2018.codeci_action_20043.action",
      "name" : "Build with Maven",
      "version" : null,
      "enable" : true
    }, {
      "properties" : {
        "image" : "shell4.2.46-git1.8.3-zip6.00",
        "buildVersion" : "",
        "file" : "**/target/*.?ar",
        "groupId" : "",
        "name" : ""
      },
      "module_id" : "devcloud2018.codeci_action_20018.action",
      "name" : "Uploading Software Packages to Release Repos",
      "version" : null,
      "enable" : true
    } ],
    "arch" : "x86-64",
    "project_id" : "a287e712be6c404ca26e5f69040fa12b",
    "job_name" : "oychap213i2",
    "job_id" : "35b6c7da9e644dbbb7e333579f89dcda",
    "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 in the system.",
        "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.