全部產品
Search
文件中心

Alibaba Cloud DevOps:GetLatestPipelineRun - 擷取最近一次流水線運行資訊

更新時間:Feb 26, 2026

通過 OpenAPI 擷取最近一次流水線運行資訊。

服務存取點與授權資訊

產品

資源

要求的權限

流水線

流水線運行執行個體

唯讀

請求文法

GET https://{domain}/oapi/v1/flow/organizations/pipelines/{pipelineId}/runs/latestPipelineRun

要求標頭

參數

類型

是否必填

描述

樣本值

x-yunxiao-token

string

個人存取權杖。

pt-0fh3****0fbG_35af****0484

請求參數

參數

類型

位置

是否必填

描述

樣本值

pipelineId

string

path

流水線 Id。

123

請求樣本

curl -X 'GET' \
  'https://{domain}/oapi/v1/flow/organizations/pipelines/123/runs/latestPipelineRun' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

返回參數

參數

類型

描述

樣本值

-

object

createTime

integer

開始時間。

1590730400000

creatorAccountId

string

建立人。

1222222222

globalParams

array

-

object

encrypted

boolean

是否加密。

false

key

string

參數 key。

key

value

string

參數值。

value

groups

array

-

object

id

integer

id。

1

name

string

名稱。

執行命令

modifierAccountId

string

更新人。

1222222222

pipelineId

integer

流水線 id。

123

pipelineRunId

integer

流水線運行 id,可通過 API ListPipelineRuns 擷取。

1

pipelineType

string

流水線類型。

default

sources

array

-

object

data

object

branch

string

預設分支。

master

cloneDepth

integer

複製深度。

1

credentialId

integer

服務憑證 id。

222

credentialLabel

string

認證顯示名稱。

企業公開金鑰

credentialType

string

認證類型。

region-ssh

events

array[string]

觸發事件。

isBranchMode

boolean

觸發過濾條件。

false

isCloneDepth

boolean

是否設定複製深度。

true

isSubmodule

boolean

是否子模組。

false

isTrigger

boolean

是否開啟提交觸發。

true

label

string

展示名稱。

cdup/ss

namespace

string

github 命名空間。

asasasas

repo

string

倉庫地址。

https://codeup.aliyun.com/test.git

serviceConnectionId

integer

服務串連 id。

12

triggerFilter

string

觸發過濾條件。

.*

webhook

string

webhook 地址。

https://flow.aliyun/webhook/asassasa

name

string

代碼源名稱。

範例程式碼源

sign

string

代碼源標識。

assaaaaaasasasa

type

string

代碼源類型 aliyunGit 阿里雲程式碼程式庫 customGitlab 自建 git giteeGit 碼雲 codeup Codeup git 通用 git gitlab gitlab bitbucket bitbucket githubOAuth github。

Codeup

stageGroup

array[string]

stages

array

階段詳情。

-

object

index

string

階段序號。

Group0-Stage0

name

string

階段名稱。

Java 構建

stageInfo

object

endTime

integer

結束時間。

1729178040000

jobs

array

工作清單。

-

object

actions

array

後續操作,具體參考文檔 https://www.alibabacloud.com/help/document_detail/2360596.html。

-

object

data

string

資料。

disable

boolean

是否有許可權調用,具體參考文檔 https://www.alibabacloud.com/help/document_detail/2360596.html。

true

displayType

string

顯示類型。

LOG

name

string

名稱。

構建日誌

order

integer

順序。

1

params

object

參數,具體參考文檔 https://www.alibabacloud.com/help/document_detail/2360596.html。

key

string

參數名稱。

title

string

標題。

構建日誌

type

string

後續操作類型,具體參考文檔 https://www.alibabacloud.com/help/document_detail/2360596.html。

GetVMDeployOrder

endTime

integer

結束時間。

1729178040000

id

integer

任務 id。

21212

jobSign

string

任務唯一標識。

job-1

name

string

任務名稱。

Java 構建

params

string

運行參數。

{}

result

string

結果。

{"data":{"RELEASE_INFO":"[]","ARTIFACTSV2":"[]","ARTIFACTS":"[]"},"requestId":"8bf5e28c-a58b-498e-a205-1c0ff5465c3c","successful":true}

startTime

integer

開始時間。

1729178040000

status

string

狀態 FAIL 運行失敗 SUCCESS 運行成功 RUNNING 運行中。

RUNNING

name

string

階段名稱。

Java 構建

startTime

integer

開始時間。

1729178040000

status

string

狀態 FAIL 運行失敗 SUCCESS 運行成功 RUNNING 運行中。

RUNNING

status

string

狀態 FAIL 運行失敗 SUCCESS 運行成功 RUNNING 運行中。

RUNNING

triggerMode

integer

觸發模式 1人工觸發 2定時觸發 3代碼提交觸發 5流水線觸發6WEBHOOK 觸發。

1

updateTime

integer

更新時間。

1590730400000

返回樣本

{
    "createTime": 1590730400000,
    "creatorAccountId": "1222222222",
    "globalParams": [
        {
            "encrypted": false,
            "key": "key",
            "value": "value"
        }
    ],
    "groups": [
        {
            "id": 1,
            "name": "執行命令"
        }
    ],
    "modifierAccountId": "1222222222",
    "pipelineId": 123,
    "pipelineRunId": 1,
    "pipelineType": "default",
    "sources": [
        {
            "data": {
                "branch": "master",
                "cloneDepth": 1,
                "credentialId": 222,
                "credentialLabel": "企業公開金鑰",
                "credentialType": "region-ssh",
                "events": [
                    
                ],
                "isBranchMode": false,
                "isCloneDepth": true,
                "isSubmodule": false,
                "isTrigger": true,
                "label": "cdup/ss",
                "namespace": "asasasas",
                "repo": "https://codeup.aliyun.com/test.git",
                "serviceConnectionId": 12,
                "triggerFilter": ".*",
                "webhook": "https://flow.aliyun/webhook/asassasa"
            },
            "name": "範例程式碼源",
            "sign": "assaaaaaasasasa",
            "type": "Codeup"
        }
    ],
    "stageGroup": [
        
    ],
    "stages": [
        {
            "index": "Group0-Stage0",
            "name": "Java構建",
            "stageInfo": {
                "endTime": 1729178040000,
                "jobs": [
                    {
                        "actions": [
                            {
                                "data": "",
                                "disable": true,
                                "displayType": "LOG",
                                "name": "構建日誌",
                                "order": 1,
                                "params": {
                                    "key": ""
                                },
                                "title": "構建日誌",
                                "type": "GetVMDeployOrder"
                            }
                        ],
                        "endTime": 1729178040000,
                        "id": 21212,
                        "jobSign": "job-1",
                        "name": "Java構建",
                        "params": "{}",
                        "result": "{"data":{"RELEASE_INFO":"[]","ARTIFACTSV2":"[]","ARTIFACTS":"[]"},"requestId":"8bf5e28c-a58b-498e-a205-1c0ff5465c3c","successful":true}",
                        "startTime": 1729178040000,
                        "status": "RUNNING"
                    }
                ],
                "name": "Java構建",
                "startTime": 1729178040000,
                "status": "RUNNING"
            }
        }
    ],
    "status": "RUNNING",
    "triggerMode": 1,
    "updateTime": 1590730400000
}

錯誤碼

訪問錯誤碼中心查看 API 相關錯誤碼。