Cancel, Retry or Approve
Learn how to cancel, retry or approve executions in Buddy
信息
The documentation applies to models in the new version buddy.v1.1.0 For the REST API to work correctly, you should send the header X-Buddy-Media-Type: buddy.v1.1.0 You can read more about changes here.
Cancels, retries or approves the execution.
要求权限范围: WORKSPACE
, EXECUTION_RUN
资源URL
PATCH /workspaces/:domain/projects/:project_name/pipelines/:pipeline_id/executions/:execution_id
URL参数
Name | String | Description |
---|---|---|
domain 必填 | String | 工作区域名 |
execution_id 必填 | Integer | The numerical ID of the desired execution. |
pipeline_id 必填 | Integer | 所需流水线的数字ID |
project_name 必填 | String | 项目名称ID |
POST参数
名称 | 类型 | 描述 |
---|---|---|
operation 必填 | String | Can be one of RETRY , CANCEL , APPLY or APPLY_VARIABLES . |
variables | Variable[] | Required if operation is APPLY_VARIABLES . |
示例
请求
PATCH https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/executions/4
JSON
{
"operation": "APPLY_VARIABLES",
"variables": [
{
"key": "myVar1",
"value": "someValue"
}
]
}
示例响应
HTTP
Status: 200 OK
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999
JSON
{
"url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/executions/4",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/2/execution/56fa386c99f1e121d8b568b5",
"id": 4,
"start_date": "2016-03-29T08:12:04.132Z",
"finish_date": null,
"triggeredOn": "CLICK",
"refresh": false,
"status": "INPROGRESS",
"comment": "",
"branch": {
"url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/branches/master",
"html_url": "https://app.buddy.works/buddy/company-website/repository/branch/master",
"name": "master",
"default": true
},
"from_revision": {
"url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits/506a3963507943d6908154f4bc9646e829128a08",
"html_url": "https://app.buddy.works/buddy/company-website/repository/commit/506a3963507943d6908154f4bc9646e829128a08",
"revision": "506a3963507943d6908154f4bc9646e829128a08",
"author_date": "2016-01-19T12:36:33Z",
"commit_date": "2016-01-19T12:36:33Z",
"message": "init repo\n",
"committer": {
"url": "https://api.buddy.works/workspaces/buddy/member/1",
"html_url": "https://app.buddy.works/buddy/profile/1",
"id": 1,
"name": "Mike Benson",
"avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png"
},
"author": {
"url": "https://api.buddy.works/workspaces/buddy/member/1",
"html_url": "https://app.buddy.works/buddy/profile/1",
"id": 1,
"name": "Mike Benson",
"avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png"
}
},
"to_revision": {
"url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits/506a3963507943d6908154f4bc9646e829128a08",
"html_url": "https://app.buddy.works/buddy/company-website/repository/commit/506a3963507943d6908154f4bc9646e829128a08",
"revision": "506a3963507943d6908154f4bc9646e829128a08",
"author_date": "2016-01-19T12:36:33Z",
"commit_date": "2016-01-19T12:36:33Z",
"message": "init repo\n",
"committer": {
"url": "https://api.buddy.works/workspaces/buddy/member/1",
"html_url": "https://app.buddy.works/buddy/profile/1",
"id": 1,
"name": "Mike Benson",
"avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png"
},
"author": {
"url": "https://api.buddy.works/workspaces/buddy/member/1",
"html_url": "https://app.buddy.works/buddy/profile/1",
"id": 1,
"name": "Mike Benson",
"avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png"
}
},
"creator": {
"url": "https://api.buddy.works/workspaces/buddy/member/1",
"html_url": "https://app.buddy.works/buddy/profile/1",
"id": 1,
"name": "Mike Benson",
"avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png"
},
"pipeline": {
"url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/2",
"id": 2,
"name": "dev",
"on": "CLICK",
"refs": [
"refs/heads/master"
],
"last_execution_status": "INPROGRESS",
"last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08"
},
"action_executions": [
{
"status": "INPROGRESS",
"progress": 0.0,
"action": {
"url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/actions/5",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/5/edit",
"id": 5,
"name": "Upload files to dev",
"type": "FTP",
"trigger_time": "ON_EVERY_EXECUTION",
"last_execution_status": "INPROGRESS"
}
}
]
}