華為云計算 云知識 本接口用于查詢用戶工作流的實例列表ListWorkflowInstance
本接口用于查詢用戶工作流的實例列表ListWorkflowInstance

 

接口說明

本接口用于查詢用戶工作流的實例列表。

URL
GET  https://dwr.cn-south-1.myhuaweicloud.com/v3/{project_id}/workflowexecutions 
請求參數(shù)
名稱 類型 IN 必選 描述
X-Auth-Token
 
string header

用戶Token。通過調(diào)用 IAM 服務(wù)獲取用戶Token接口獲取(相應(yīng)消息頭中X-Subject-Token的值)。

project_id
 
string path

項目ID。

limit
 
integer query

請求返回的最大記錄條數(shù)。分頁查詢,每頁顯示的條目數(shù)量,最大數(shù)量200,超過200后只返回200

graph_name
 
string query

工作流名稱。

start_time
 
string query

查詢開始時間,格式:yyyy-MM-ddTHH:mm:ssZ,UTC時間。若起始時間未填寫,以終止時間前推3天為起始時間

end_time
 
string query

查詢終止時間,格式:yyyy-MM-ddTHH:mm:ssZ,UTC時間。若終止時間未填寫,以起始時間后退3天未終止時間。若均未填寫,默認查詢最近3天數(shù)據(jù)。

status
 
string query

需要過濾的流程實例狀態(tài)

最小長度:0

最大長度:64

枚舉值:

success

fail

running

timeout

cancel

offset
 
integer query

查詢的起始位置。start大于等于1,最大1000,不設(shè)置則取默認值1。

返回參數(shù)
返回碼: 200

HTTP/1.1 200 OK Date: Thu, 27 Aug 2020 12:38:10 GMT Content-Length: 100 Content-Type: application/json X-Request-ID: 6a63a18b8bab40ffb71ebd9cb80d0085 { "count": 1, // 滿足條件的運行實例個數(shù)。 "is_truncated": true, // 表明是否本次返回的結(jié)果列表被截斷。 "next_marker": "TRIGGERCALaa76d0ccc918619a2853ce2c5965c592ca6d8dfa1c39635029dacea2", // 如果本次沒有返回全部結(jié)果,響應(yīng)請求中將包含此字段,用于標明本次請求列舉到的最后一個工作流實例。后續(xù)請求可以指定Marker等于該值來列舉剩余的工作流實例。 如果is_truncated為false,該字段不會返回。 "executions": [{ // 實例信息列表。 "graph_urn": "urn:fgs:<region_id>:<project_id>:graph:<graph_name>", // 工作流URN。 "execution_urn": "urn:fgs:<region_id>:<project_id>:execution:<graph_name>:<execution_name>:<domain_id>", // 工作流實例URN。 "started_at": "2020-04-23T13:37:43.847Z", // 工作流實例啟動時間。 "execution_type": "APICALL", // 工作流執(zhí)行方式。 "stopped_at": "", // 工作流停止時間。 "execution_state": "RUNNING", // 工作流運行狀態(tài)。 "execution_name": "<execution_name>" // 工作流名稱。 }] }

名稱 類型 必選 描述
Date
 
string  
Content-Length
 
string  
Content-Type
 
string  
X-Request-Id
 
string  
名稱 類型 必選 描述
count
 
integer

滿足條件的運行實例個數(shù)。

executions
 
Array of Execution objects

實例信息列表

is_truncated
 
boolean

表明是否本次返回的結(jié)果列表被截斷。true:表示本次沒有返回全部結(jié)果。false:表示本次已經(jīng)返回了全部結(jié)果。

next_offset
 
integer

如果本次沒有返回全部結(jié)果,響應(yīng)請求中將包含此字段,用于標明本次請求列舉到的最后一個工作流實例。后續(xù)請求可以指定Marker等于該值來列舉剩余的工作流實例。如果is_truncated為false,該字段不會返回。

200 executions
名稱 類型 必選 描述
graph_urn
 
string

工作流URN

execution_urn
 
string

工作流實例URN

started_at
 
string

工作流實例啟動時間

execution_type
 
string

工作流執(zhí)行方式。APICALL代表為通過API方式觸發(fā)。

stopped_at
 
string

工作流停止時間。

execution_state
 
string

工作流運行狀態(tài)。success,fail,running,timeout,cancel

execution_name
 
string

工作流名稱。

返回碼: 400
 
名稱 類型 必選 描述
error_msg
 
string

錯誤詳細描述

error_code
 
integer

簡單錯誤碼

request_id
 
string

請求唯一標識ID

返回碼: 500
 
名稱 類型 必選 描述
error_msg
 
string

錯誤詳細描述

error_code
 
integer

簡單錯誤碼

request_id
 
string

請求唯一標識ID

請求示例
示例 1
 
"/v3/{project_id}/workflowexecutions?next_marker={marker}&limit={limit}&graph_name={graph_name}"
 
"GET /v3/{project_id}/workflowexecutions?next_marker={marker}&limit={limit}&graph_name={graph_name}&execution_type={execution_type} HTTP/1.1\nHost: dwr.cn-north-4.myhuaweicloud.com\nX-Auth-Token: authorization\nContent-Type: application/json\nContent-Length: length\nDate: date"
返回示例
返回碼:200

HTTP/1.1 200 OK Date: Thu, 27 Aug 2020 12:38:10 GMT Content-Length: 100 Content-Type: application/json X-Request-ID: 6a63a18b8bab40ffb71ebd9cb80d0085 { "count": 1, // 滿足條件的運行實例個數(shù)。 "is_truncated": true, // 表明是否本次返回的結(jié)果列表被截斷。 "next_marker": "TRIGGERCALaa76d0ccc918619a2853ce2c5965c592ca6d8dfa1c39635029dacea2", // 如果本次沒有返回全部結(jié)果,響應(yīng)請求中將包含此字段,用于標明本次請求列舉到的最后一個工作流實例。后續(xù)請求可以指定Marker等于該值來列舉剩余的工作流實例。 如果is_truncated為false,該字段不會返回。 "executions": [{ // 實例信息列表。 "graph_urn": "urn:fgs:<region_id>:<project_id>:graph:<graph_name>", // 工作流URN。 "execution_urn": "urn:fgs:<region_id>:<project_id>:execution:<graph_name>:<execution_name>:<domain_id>", // 工作流實例URN。 "started_at": "2020-04-23T13:37:43.847Z", // 工作流實例啟動時間。 "execution_type": "APICALL", // 工作流執(zhí)行方式。 "stopped_at": "", // 工作流停止時間。 "execution_state": "RUNNING", // 工作流運行狀態(tài)。 "execution_name": "<execution_name>" // 工作流名稱。 }] }

示例 1
 
 
SDK
點擊  數(shù)據(jù)工坊  (DWR) SDK, 下載SDK或查看SDK文檔。SDK的安裝、認證方式等在SDK文檔中對應(yīng)語言類型的【使用】目錄下。
錯誤碼
請參考 錯誤碼說明