更新时间:2025-11-20 GMT+08:00
分享

取消构建任务

功能介绍

此API用于根据构建任务实例ID取消构建任务。

URI

PATCH /assembling/v1/builds/{build_id}

表1 路径参数

参数

是否必选

参数类型

描述

build_id

String

构建任务实例ID。获取方法,请参考根据构建任务ID获取构建任务实例列表

请求消息

表2 请求Header参数

参数

是否必选

参数类型

描述

Content-Type

String

消息体的类型(格式),默认取值为“application/json;charset=utf8”。

X-Auth-Token

String

调用接口的认证方式分为Token和AK/SK两种,如果您使用的Token方式,此参数为必填,请填写Token的值。Token获取方式,请参考获取用户Token

响应消息

表3 响应参数

参数

参数类型

描述

build_id

String

构建ID。

job_id

String

任务ID。

job_name

String

任务名称。

enterprise_project_id

String

企业项目ID。

index

Integer

构建在其任务下的索引号。

started_at

String

创建时间。

ended_at

String

结束时间。

build_state

String

状态。

repo_type

String

仓库类型。

repo_endpoint

String

仓库接入地址。

repo_web_url

String

仓库的web访问地址。

repo

String

具体仓库地址。

branch

String

代码分支。

commit_id

String

代码提交ID。

committer

String

代码提交者。

commit_time

String

代码提交时间。

commit_comment

String

代码提交评论。

language

String

软件构建语言。

swr_repository

String

软件/镜像归档后的访问地址。

swr_repo_page

String

镜像访问url。

archive_result

Object

归档详细信息。

base_image

String

构建指定的基础镜像。

seccomp_path

String

挂载相对路径。

type

String

构建类型

  • auto:自动触发
  • user:手动触发

creator

String

构建创建人。

code_repo_anatomy

Object

代码仓库的详细形式,请参考表4 代码仓库参数

os

Object

构建使用的系统信息。请参考表5 OS参数

表4 代码仓库参数

参数

参数类型

描述

name

String

仓库名称。

archiveURL

String

二进制包下载地址。

表5 OS参数

参数

参数类型

描述

arch

String

架构信息。

请求示例

响应示例

{
  "build_id": "kzqjkrvbglqbczhm82kkjlh0ixe2o2wv8v85fpmv",
  "job_id": "qexh8qwfmuvlv1y078delx51vn0tsjsmsb23e0e0",
  "job_name": "",
  "enterprise_project_id": "",
  "index": 4,
  "started_at": "2025-11-14 08:00:42 +0000 UTC",
  "ended_at": "2025-11-14 08:00:54 +0000 UTC",
  "build_state": "Cancel",
  "repo_type": "BinObs",
  "repo_endpoint": "",
  "repo_web_url": "",
  "repo": "obs://demo/MainLoop.jar",
  "branch": "",
  "commit_id": "",
  "committer": "",
  "commit_time": "",
  "commit_comment": "",
  "language": "java",
  "swr_repository": {
    "1754123329469": "test.com/test/test-0802-1:afdafds"
  },
  "swr_repo_page": {
    "1754123329469": "https://test.com/dockyard/v2/domains/paas_servicestage_test/namespaces/test/repositories?repository=test-0802-1&is_public=false&description=&category=other"
  },
  "archive_result": {},
  "base_image": "",
  "seccomp_path": "",
  "type": "user",
  "creator": "paas_servicestage_test",
  "code_repo_anatomy": null,
  "os": {
    "arch": "x86_64"
  }
}

状态码

状态码

描述

200

操作成功。

400

错误的请求。

错误码

请参考ServiceStage错误码

相关文档