Function API

Function API PRODUCT     AVGIDEA, INC. 

AFX で作成したファンクションを API 経由で実行、停止やステータス情報の取得が可能です。API での操作時にはあらかじめ API キーを作成し、アプリケーションやシェルスクリプト等で使用することができます。


共通パラメータ

% curl -X POST -H 'content-type: application/json' -d '{"accesskey":"<accesskey>", "secret":"secretkey", "component":"function", "action":"<action>" ... }' https://<endpoint url>

パラメータ


ファンクション実行

ADP コンソールから作成したファンクションを API 経由で実行することができます。

% curl -X POST -H 'content-type: application/json' -d '{"accesskey":"<accesskey>", "secret":"secretkey", "component":"function", "action":"request", "name":"linetest", "datasource":"ds1", "file":"data1.csv"}' https://<endpoint url>

{"data":"Kxf9K3L9T83Ke0pwMIOn","status":"success"}

パラメータ

File または Line ファンクション

戻り値


ファンクションの停止

実行中のファンクションを API 経由で停止することができます。ファンクションの実行は「running」から「terminated」のステータスに遷移します。

% curl -X POST -H 'content-type: application/json' -d '{"accesskey":"<accesskey>", "secret":"secretkey", "component":"function", "action":"terminate", "id":"Kxf9K3L9T83Ke0pwMIOn"}' https://<endpoint url>

{"data":"Termination request sent","status":"success"}

パラメータ

戻り値


実行一覧の取得

% curl -X POST -H 'content-type: application/json' -d '{"accesskey":"<accesskey>", "secret":"secretkey", "component":"function", "action":"list", "status":"success"}' https://<endpoint url> | jq

{

  "data": [

    {

      "name": "linetest",

      "registeredAt": "2024-04-16T02:23:26.512039Z",

      "id": "Kxf9K3L9T83Ke0pwMIOn",

      "logs": [

        {

          "registeredAt": "2024-04-16T02:23:28.514009Z",

          "text": "Start processing Kxf9K3L9T83Ke0pwMIOn"

        },

        {

          "registeredAt": "2024-04-16T02:23:29.296281Z",

          "text": "Finished processing Kxf9K3L9T83Ke0pwMIOn"

        }

      ],

      "status": "success",

      "updatedAt": "2024-04-16T02:23:29.258Z"

    },

...

}

パラメータ

戻り値