callリファレンス
ワークフローのステップの一つであるcallで使える関数について記載します。
feed
parse
XML形式のデータ(例えばRSSフィードなど)を解析して、フィードのタイトルとその中に含まれるエントリー(項目)をJSON形式のデータに変換します。
引数 |
説明 |
---|---|
xml |
解析するXML形式のデータ |
例
step:
call: feed.parse
args:
xml: ${atomBody.body}
result: feed
http
get
指定されたURLにHTTP GETリクエストを送信します。
引数 |
説明 |
---|---|
|
|
|
|
|
|
|
|
戻り値
Map<string, any>
HTTPリクエストの結果。
status: HTTPステータスコード。
body: レスポンスボディ。
例
steps:
get:
call: http.get
args:
url: ${"https://httpbin.org/get"}
timeout: 10
headers:
"Content-Type": application/json
query:
"hl": "ja"
"q": "q"
result: response
done:
return: ${response}
post
指定されたURLにHTTP POSTリクエストを送信します。
引数 |
説明 |
---|---|
|
|
|
|
|
|
|
|
|
|
戻り値
Map<string, any>
HTTPリクエストの結果。
status: HTTPステータスコード。
body: レスポンスボディ。
例
steps:
post:
call: http.post
args:
url: ${"https://httpbin.org/post"}
timeout: 10
headers:
"Content-Type": application/json
body:
"key": "value"
result: response
done:
return: ${response}
put
指定されたURLにHTTP PUTリクエストを送信します。
引数 |
説明 |
---|---|
|
|
|
|
|
|
|
|
|
|
戻り値
Map<string, any>
HTTPリクエストの結果。
status: HTTPステータスコード。
body: レスポンスボディ。
例
steps:
put:
call: http.put
args:
url: ${"https://httpbin.org/put"}
timeout: 10
headers:
"Content-Type": application/json
body:
"key": "value"
result: response
done:
return: ${response}
delete
指定されたURLにHTTP DELETEリクエストを送信します。
引数 |
説明 |
---|---|
|
|
|
|
|
|
|
|
|
|
戻り値
Map<string, any>
HTTPリクエストの結果。
status: HTTPステータスコード。
body: レスポンスボディ。
例
steps:
delete:
call: http.delete
args:
url: ${"https://httpbin.org/delete"}
timeout: 10
headers:
"Content-Type": application/json
body:
"key": "value"
result: response
done:
return: ${response}
patch
指定されたURLにHTTP PATCHリクエストを送信します。
引数 |
説明 |
---|---|
|
|
|
|
|
|
|
|
|
|
戻り値
Map<string, any>
HTTPリクエストの結果。
status: HTTPステータスコード。
body: レスポンスボディ。
例
steps:
patch:
call: http.patch
args:
url: ${"https://httpbin.org/patch"}
timeout: 10
headers:
"Content-Type": application/json
body:
"key": "value"
result: response
done:
return: ${response}
request
HTTPリクエストを送信します。 これは汎用関数ですが、ほとんどの場合、 http.get
や http.post
などの特定の関数を使う方が簡単です。 詳細については、HTTPリクエストの作成 を参照してください。
引数 |
説明 |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
戻り値
Map<string, any>
HTTPリクエストの結果。
status: HTTPステータスコード。
body: レスポンスボディ。
例
steps:
request:
call: http.request
args:
method: GET
url: ${"https://httpbin.org/get"}
timeout: 10
headers:
"Content-Type": application/json
query:
"hl": "ja"
"q": "q"
result: response
done:
return: ${response}
sys
sleep
指定した秒数分実行を一時停止します。
引数 |
説明 |
---|---|
|
|
例
meta:
description: 秒数ループ
steps:
seconds:
for:
in: '${array.range(10)}'
as: i
steps:
push:
assign:
message: "loop ${i}"
sleep:
call: sys.sleep
args:
seconds: 1
sleepUntil
指定された時間まで待機します。
引数 |
説明 |
---|---|
|
|
例
meta:
description: 時間指定待機
steps:
set:
assign:
setDate: ${"2024-09-13T18:50:00"}
sleepUntil:
call: sys.sleepUntil
args:
date: setDate
done:
return: "done"