華為云計(jì)算 云知識(shí) 本接口用于查詢(xún)用戶(hù)工作流的實(shí)例列表ListWorkflowInstance
本接口用于查詢(xún)用戶(hù)工作流的實(shí)例列表ListWorkflowInstance

 

接口說(shuō)明

本接口用于查詢(xún)用戶(hù)工作流的實(shí)例列表。

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

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

project_id
 
string path

項(xiàng)目ID。

limit
 
integer query

請(qǐng)求返回的最大記錄條數(shù)。分頁(yè)查詢(xún),每頁(yè)顯示的條目數(shù)量,最大數(shù)量200,超過(guò)200后只返回200

graph_name
 
string query

工作流名稱(chēng)。

start_time
 
string query

查詢(xún)開(kāi)始時(shí)間,格式:yyyy-MM-ddTHH:mm:ssZ,UTC時(shí)間。若起始時(shí)間未填寫(xiě),以終止時(shí)間前推3天為起始時(shí)間

end_time
 
string query

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

status
 
string query

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

最小長(zhǎng)度:0

最大長(zhǎng)度:64

枚舉值:

success

fail

running

timeout

cancel

offset
 
integer query

查詢(xún)的起始位置。start大于等于1,最大1000,不設(shè)置則取默認(rèn)值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, // 滿(mǎn)足條件的運(yùn)行實(shí)例個(gè)數(shù)。 "is_truncated": true, // 表明是否本次返回的結(jié)果列表被截?cái)唷?"next_marker": "TRIGGERCALaa76d0ccc918619a2853ce2c5965c592ca6d8dfa1c39635029dacea2", // 如果本次沒(méi)有返回全部結(jié)果,響應(yīng)請(qǐng)求中將包含此字段,用于標(biāo)明本次請(qǐng)求列舉到的最后一個(gè)工作流實(shí)例。后續(xù)請(qǐng)求可以指定Marker等于該值來(lái)列舉剩余的工作流實(shí)例。 如果is_truncated為false,該字段不會(huì)返回。 "executions": [{ // 實(shí)例信息列表。 "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>", // 工作流實(shí)例URN。 "started_at": "2020-04-23T13:37:43.847Z", // 工作流實(shí)例啟動(dòng)時(shí)間。 "execution_type": "APICALL", // 工作流執(zhí)行方式。 "stopped_at": "", // 工作流停止時(shí)間。 "execution_state": "RUNNING", // 工作流運(yùn)行狀態(tài)。 "execution_name": "<execution_name>" // 工作流名稱(chēng)。 }] }

名稱(chēng) 類(lèi)型 必選 描述
Date
 
string  
Content-Length
 
string  
Content-Type
 
string  
X-Request-Id
 
string  
名稱(chēng) 類(lèi)型 必選 描述
count
 
integer

滿(mǎn)足條件的運(yùn)行實(shí)例個(gè)數(shù)。

executions
 
Array of Execution objects

實(shí)例信息列表

is_truncated
 
boolean

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

next_offset
 
integer

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

200 executions
名稱(chēng) 類(lèi)型 必選 描述
graph_urn
 
string

工作流URN

execution_urn
 
string

工作流實(shí)例URN

started_at
 
string

工作流實(shí)例啟動(dòng)時(shí)間

execution_type
 
string

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

stopped_at
 
string

工作流停止時(shí)間。

execution_state
 
string

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

execution_name
 
string

工作流名稱(chēng)。

返回碼: 400
 
名稱(chēng) 類(lèi)型 必選 描述
error_msg
 
string

錯(cuò)誤詳細(xì)描述

error_code
 
integer

簡(jiǎn)單錯(cuò)誤碼

request_id
 
string

請(qǐng)求唯一標(biāo)識(shí)ID

返回碼: 500
 
名稱(chēng) 類(lèi)型 必選 描述
error_msg
 
string

錯(cuò)誤詳細(xì)描述

error_code
 
integer

簡(jiǎn)單錯(cuò)誤碼

request_id
 
string

請(qǐng)求唯一標(biāo)識(shí)ID

請(qǐng)求示例
示例 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, // 滿(mǎn)足條件的運(yùn)行實(shí)例個(gè)數(shù)。 "is_truncated": true, // 表明是否本次返回的結(jié)果列表被截?cái)唷?"next_marker": "TRIGGERCALaa76d0ccc918619a2853ce2c5965c592ca6d8dfa1c39635029dacea2", // 如果本次沒(méi)有返回全部結(jié)果,響應(yīng)請(qǐng)求中將包含此字段,用于標(biāo)明本次請(qǐng)求列舉到的最后一個(gè)工作流實(shí)例。后續(xù)請(qǐng)求可以指定Marker等于該值來(lái)列舉剩余的工作流實(shí)例。 如果is_truncated為false,該字段不會(huì)返回。 "executions": [{ // 實(shí)例信息列表。 "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>", // 工作流實(shí)例URN。 "started_at": "2020-04-23T13:37:43.847Z", // 工作流實(shí)例啟動(dòng)時(shí)間。 "execution_type": "APICALL", // 工作流執(zhí)行方式。 "stopped_at": "", // 工作流停止時(shí)間。 "execution_state": "RUNNING", // 工作流運(yùn)行狀態(tài)。 "execution_name": "<execution_name>" // 工作流名稱(chēng)。 }] }

示例 1
 
 
SDK
點(diǎn)擊  數(shù)據(jù)工坊  (DWR) SDK, 下載SDK或查看SDK文檔。SDK的安裝、認(rèn)證方式等在SDK文檔中對(duì)應(yīng)語(yǔ)言類(lèi)型的【使用】目錄下。
錯(cuò)誤碼
請(qǐng)參考 錯(cuò)誤碼說(shuō)明