パイプラインAPIとは、パイプラインサービスの特定の機能をさまざまな言語からhttp経由で呼び出すためのAPIです。
パイプラインAPIを使用するためには、パイプラインサービスのAPI設定が有効である必要があります。また、パイプラインサービスで発行したAPIキーが必要です。
初めてAPI設定を有効にした場合はAPIキーが発行され、下部「APIキー」項目に表示されます。
初めてAPIキーを発行する場合は、上記「パイプラインサービスのAPI設定を有効にする」の手順で発行されます。APIキーを再発行する場合は、上記手順を参考にしてパイプラインコーディネーターで「API設定」画面を表示し、下部にある「APIキー」項目の「更新」ボタンをクリックします。「APIキー」項目に新しいAPIキーが表示されます。
APIを使用する時に、httpヘッダにX-Pipelinewebapi:APIキーを設定してください。
リクエストのURLは以下のような形式です。
http://[ホスト名]:[ポート番号]/pipelineapi/[API指定]/[レスポンスタイプ]
ホスト名 | パイプラインサービスのホスト名を指定します。 |
---|---|
ポート番号 | パイプラインサービスのポート番号を指定します。インストール時のデフォルト値は25080です。インストール時に変更した場合は、変更したポート番号を指定してください。 |
API指定 | 実行するパイプラインAPIのパスを指定します。APIリストのURLの項目を参照してください。 |
レスポンスタイプ | xml,json,htmのいずれかを指定します。 パイプラインサービスが返すレスポンスは、XML(text/xml), JSON(text/javascript) ,HTML(text/html)の3つのコンテントタイプがあります。省略可能で、省略した場合はXMLになります。 |
それぞれのAPIサービスを使用するにはHTTPメソッドを指定します。
リクエストで指定されたレスポンスタイプ(XML,JSON,HTML)のいずれかの形式で返ります。
例えば、パイプライン一覧取得(list)のリクエストに対するレスポンスはそれぞれ以下のようになります。(サーバーアドレスはhostname、ポート番号は25080とします)
<リクエストURL> http://hostname:25080/pipelineapi/list/xml
<?xml version="1.0" encoding="UTF-8"?> <PipelineList> <PipeLine> <Id>pl_00001</Id><Name>パイプラインーサンプル</Name><Runmode>run</Runmode> <Createdate>2007-08-31T19:58:36.752 JST</Createdate> <Updatedate>2007-09-14T07:37:15.692 JST</Updatedate> <Description>Please write description</Description> </PipeLine> <PipeLine> <Id>pl_00002</Id><Name>パイプライン-テスト</Name><Runmode>stop</Runmode> <Createdate>2007-08-31T19:58:56.907 JST</Createdate> <Updatedate>2007-08-31T19:58:56.907 JST</Updatedate> <Description>Please write description</Description> </PipeLine> <PipeLine> <Id>pl_00005</Id><Name>新規パイプライン</Name><Runmode>stop</Runmode> <Createdate>2007-09-07T17:22:51.473 JST</Createdate> <Updatedate>2007-09-07T23:57:32.252 JST</Updatedate> <Description>Please write description</Description> </PipeLine> <PipeLine> <Id>pl_00006</Id><Name>SfDC</Name><Runmode>stop</Runmode> <Createdate>2007-09-10T17:40:55.334 JST</Createdate> <Updatedate>2007-09-10T18:25:03.015 JST</Updatedate> <Description>Please write description</Description> </PipeLine> <PipeLine> <Id>pl_00007</Id><Name>新規パイプライン</Name><Runmode>run</Runmode> <Createdate>2007-09-14T02:50:15.913 JST</Createdate> <Updatedate>2007-09-14T02:53:58.568 JST</Updatedate> <Description>Please write description</Description> </PipeLine> </PipelineList>
<リクエストURL> http://hostname:25080/pipelineapi/list/json
{"PipelineList": {"PipeLine": [ {"Name":"パイプラインーサンプル","Description":"Please write description","Updatedate":"2007-09-14T07:37:15.692 JST", "Id":"pl_00001","Createdate":"2007-08-31T19:58:36.752 JST","Runmode":"run"}, {"Name":"パイプライン-テスト","Description":"Please write description","Updatedate":"2007-08-31T19:58:56.907 JST", "Id":"pl_00002","Createdate":"2007-08-31T19:58:56.907 JST","Runmode":"stop"}, {"Name":"新規パイプライン","Description":"Please write description","Updatedate":"2007-09-07T23:57:32.252 JST", "Id":"pl_00005","Createdate":"2007-09-07T17:22:51.473 JST","Runmode":"stop"}, {"Name":"SfDC","Description":"Please write description","Updatedate":"2007-09-10T18:25:03.015 JST", "Id":"pl_00006","Createdate":"2007-09-10T17:40:55.334 JST","Runmode":"stop"}, {"Name":"新規パイプライン","Description":"Please write description","Updatedate":"2007-09-14T02:53:58.568 JST", "Id":"pl_00007","Createdate":"2007-09-14T02:50:15.913 JST","Runmode":"run"} ] } }
<リクエストURL> http://hostname:25080/pipelineapi/list/htm
<?xml version="1.0" encoding="UTF-8"?> <table> <tr> <td>pl_00001</td><td>パイプラインーサンプル</td><td>run</td> <td>2007-08-31T19:58:36.752 JST</td><td>2007-09-14T07:37:15.692 JST</td><td>Please write description</td> </tr> <tr> : : <tr> <td>pl_00007</td><td>新規パイプライン</td><td>run</td> <td>2007-09-14T02:50:15.913 JST</td><td>2007-09-14T02:53:58.568 JST</td><td>Please write description</td> </tr> </table>
APIリストの凡例は以下になります。
URL | APIのURL |
---|---|
説明 | APIの説明 |
リクエスト | リクエストで設定できるパラメータ |
レスポンス | レスポンスノードの説明 |
更新履歴になります。
バージョン | 内容 |
---|---|
0.0.1 | 作成 |
0.0.2 | WSHのキットを追加、ヘルプの更新をしました |
0.0.3 | CoordinatorClientのキットを追加、新規にAPIを追加しました |
URL | http://[hostname]:[port]/pipelineapi/list | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /list | ||||||||||||||||||||||||||||||||||
説明 | パイプライン一覧のリストを返します | ||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
<リクエスト> GET /pipelineapi/list/xml HTTP/1.1 X-Pipelinewebapi: 1d1687d0-ec6e-4a78-ad66-be9c024c34f1-0deafe00f429d31e0f62ff2baaf5789d Connection: close Accept: */* Content-Type: application/x-www-form-urlencoded Host: 192.168.5.165:38080 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 1323 Server: ASTERIA HTTP Daemon/1.01 Date: Thu, 13 Sep 2007 21:51:53 GMT Connection: close <?xml version="1.0" encoding="UTF-8"?> <PipelineList> <PipeLine> <Id>pl_00001</Id> <Name>パイプラインーサンプル</Name> <Runmode>run</Runmode> <Createdate>2007-08-31T19:58:36.752 JST</Createdate> <Updatedate>2007-09-14T05:10:38.627 JST</Updatedate> <Description>Please write description</Description> </PipeLine> <PipeLine> <Id>pl_00002</Id> <Name>パイプライン-テスト</Name> <Runmode>stop</Runmode><Createdate>2007-08-31T19:58:56.907 JST</Createdate> <Updatedate>2007-08-31T19:58:56.907 JST</Updatedate> <Description>Please write description</Description> </PipeLine> <PipeLine> <Id>pl_00005</Id> <Name>新規パイプライン</Name> <Runmode>stop</Runmode> <Createdate>2007-09-07T17:22:51.473 JST</Createdate> <Updatedate>2007-09-07T23:57:32.252 JST</Updatedate> <Description>Please write description</Description> <Args> <Item> <Name>parameter name</Name> <Value>default value</Value> </Item> </Args> </PipeLine> </PipelineList> |
URL | http://[hostname]:[port]/pipelineapi/exec | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /exec | ||||||||||||||||||
説明 | パイプラインを実行します。idで実行するパイプラインを指定します | ||||||||||||||||||
| |||||||||||||||||||
<リクエスト> POST /pipelineapi/exec/xml HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close Host: 192.168.5.165:38080 User-Agent: libwww-perl/5.805 Content-Length: 38 Content-Type: application/x-www-form-urlencoded X-PIPELINEWEBAPI: 1d1687d0-ec6e-4a78-ad66-be9c024c34f1-0deafe00f429d31e0f62ff2baaf5789d pipelineid=pl_00001&filename=plrun.dat <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 120 Server: ASTERIA HTTP Daemon/1.01 Date: Thu, 13 Sep 2007 22:47:15 GMT Connection: close <?xml version="1.0" encoding="UTF-8"?> <ExecuteResponse> <Status>OK</Status> <Message>Success</Message> </ExecuteResponse> |
URL | http://[hostname]:[port]/pipelineapi/requestlist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /requestlist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
説明 | リクエストの一覧を返します | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<リクエスト> GET /pipelineapi/requestlist/xml?id=pl_00001&date=20070914 HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close Host: 192.168.5.165:38080 User-Agent: libwww-perl/5.805 Content-Type: application/x-www-form-urlencoded X-PIPELINEWEBAPI: 1d1687d0-ec6e-4a78-ad66-be9c024c34f1-0deafe00f429d31e0f62ff2baaf5789d <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 670 Server: ASTERIA HTTP Daemon/1.01 Date: Thu, 13 Sep 2007 21:35:19 GMT Connection: close <?xml version="1.0" encoding="UTF-8"?> <RequestList> <Request> <RequestId>pl_00001-20070914_05-000002</RequestId> <PipelineId>pl_00001</PipelineId> <Name>パイプラインーサンプル</Name> <Status>Finish</Status> <Stage>Complete</Stage> <BeginDate>2007-09-14 05:11:12</BeginDate> </Request> <Request> <RequestId>pl_00001-20070914_05-000001</RequestId> <PipelineId>pl_00001</PipelineId> <Name>パイプラインーサンプル</Name> <Status>Finish</Status> <Stage>Complete</Stage> <BeginDate>2007-09-14 05:11:11</BeginDate> </Request> <Info> <Index>0</Index> <Prev>-1</Prev> <Next>-1</Next> <Count>2</Count> <Error>false</Error> <Date>20070914</Date> <Id>pl_00001</Id> </Info></RequestList> |
URL | http://[hostname]:[port]/pipelineapi/requestdetail | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /requestdetail | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
説明 | リクエストの詳細を表示します | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<リクエスト> GET /pipelineapi/requestdetail/xml?requestid=pl_00027-20091127_20-000001&requestlog=true&applog=true HTTP/1.1 Cookie: SESSIONID=0FDF71FD697841368C45AA76C47AC128 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:38080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 3858 Server: ASTERIA HTTP Daemon/1.01 Date: Sun, 29 Nov 2009 07:16:54 GMT Connection: close Set-Cookie: SESSIONID=0FDF71FD697841368C45AA76C47AC128;Path=/ <?xml version="1.0" encoding="UTF-8"?> <RequestDetail> <RequestId>pl_00027-20091127_20-000001</RequestId> <PipelineId>pl_00027</PipelineId> <Name>EndPipeline</Name> <Status>Finish</Status> <Stage>Complete</Stage> <BeginTime>2009-11-27 08:13:52</BeginTime> <EndTime>2009-11-27 08:13:52</EndTime> <SensorTime>00:00</SensorTime> <FilterTime>00:00</FilterTime> <JointTime>00:00</JointTime> <SensorFile><![CDATA[ センサーファイル内容がここに入ります。 ]]></SensorFile> <FileSize>3.8KB</FileSize> <RequestLog> // requestlog=trueの場合 <Log> <Date>2009/11/27 20:13:52</Date><Stage></Stage><Event>Start</Event> <Status>Start</Status><ActionOrder>0</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Sensor</Stage><Event>Start</Event> <Status>Process</Status><ActionOrder>0</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Sensor</Stage><Event>Start</Event> <Status>Process</Status><ActionOrder>1</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Sensor</Stage><Event>End</Event> <Status>Process</Status><ActionOrder>1</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Sensor</Stage><Event>End</Event> <Status>Process</Status><ActionOrder>0</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Filter</Stage><Event>Start</Event> <Status>Process</Status><ActionOrder>0</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Filter</Stage><Event>End</Event> <Status>Process</Status><ActionOrder>0</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Joint</Stage><Event>Start</Event> <Status>Process</Status><ActionOrder>0</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Joint</Stage><Event>Start</Event> <Status>Process</Status><ActionOrder>1</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Joint</Stage><Event>End</Event> <Status>Process</Status><ActionOrder>1</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage>Joint</Stage><Event>End</Event> <Status>Process</Status><ActionOrder>0</ActionOrder><Message></Message> </Log> <Log> <Date>2009/11/27 20:13:52</Date><Stage></Stage><Event>End</Event> <Status>Finish</Status><ActionOrder>0</ActionOrder><Message></Message> </Log> </RequestLog> <AppLog> // applog=trueの場合 <Log> <Index>2</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> センサーリクエストの送信を開始します。: pl_00027-20091127_20-000001</Message> </Log> <Log> <Index>3</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> センサーリクエストの送信を終了しました。: pl_00027-20091127_20-000001</Message> </Log> <Log> <Index>4</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> Processorの実行を開始します。: Filter</Message> </Log> <Log> <Index>5</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> Processorの実行を終了しました。: Filter</Message> </Log> <Log> <Index>6</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> Processorの実行を開始します。: Joint</Message> </Log> <Log> <Index>7</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> ジョイントアクションの初期化が完了しました。: postFileDataAction</Message> </Log> <Log> <Index>8</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> ジョイントアクションの実行を開始します。: postFileDataAction</Message> </Log> <Log> <Index>9</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> ジョイントアクションの実行が終了しました。: postFileDataAction</Message> </Log> <Log> <Index>10</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> ジョイントアクションの処理が終了しました。: postFileDataAction</Message> </Log> <Log> <Index>11</Index><Date>20:13:52</Date><Type>INFO</Type> <Message> Processorの実行を終了しました。: Joint</Message> </Log> </AppLog> </RequestDetail> |
URL | http://[hostname]:[port]/pipelineapi/requestretry | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /requestretry | ||||||||||||||||
説明 | エラーが発生しているパイプラインのリクエストに対してリトライをします | ||||||||||||||||
| |||||||||||||||||
<リクエスト> PUT /pipelineapi//requestretry/xml HTTP/1.1 X-Pipelinewebapi: 1d1687d0-ec6e-4a78-ad66-be9c024c34f1-0deafe00f429d31e0f62ff2baaf5789d Connection: close Accept: */* Content-Type: application/x-www-form-urlencoded Content-Length: 37 Host: 192.168.5.165:38080 requestid=pl_00007-20070914_02-000002 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 118 Server: ASTERIA HTTP Daemon/1.01 Connection: close Date: Thu, 13 Sep 2007 17:57:30 GMT <?xml version="1.0" encoding="UTF-8"?> <ExecuteResponse> <Status>OK</Status> <Message>Success</Message> </ExecuteResponse> |
URL | http://[hostname]:[port]/pipelineapi/requestcancel | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /requestcancel | ||||||||||||||||
説明 | パイプラインのリクエストをキャンセルしてリクエストを停止状態にします | ||||||||||||||||
| |||||||||||||||||
<リクエスト> DELETE //pipelineapi//requestcancel/xml HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close Host: 192.168.5.165:38080 User-Agent: libwww-perl/5.805 Content-Type: application/x-www-form-urlencoded X-PIPELINEWEBAPI: 1d1687d0-ec6e-4a78-ad66-be9c024c34f1-0deafe00f429d31e0f62ff2baaf5789d Content-Length: 37 requestid=pl_00007-20070914_02-000003 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 118 Server: ASTERIA HTTP Daemon/1.01 Connection: close Date: Thu, 13 Sep 2007 17:57:30 GMT <?xml version="1.0" encoding="UTF-8"?> <ExecuteResponse> <Status>OK</Status> <Message>Success</Message> </ExecuteResponse> |
URL | http://[hostname]:[port]/pipelineapi/resume | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /resume | ||||||||||||||||
説明 | パイプラインを開始状態にします | ||||||||||||||||
| |||||||||||||||||
<リクエスト> PUT /pipelineapi/resume/xml HTTP/1.1 Cookie: SESSIONID=12CABF8561C14661AD26ED41F2913A97 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:38080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Content-Length: 19 pipelineid=pl_00001 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 118 Server: ASTERIA HTTP Daemon/1.01 Connection: close Date: Fri, 24 Apr 2009 09:18:22 GMT Set-Cookie: SESSIONID=12CABF8561C14661AD26ED41F2913A97;Path=/ <?xml version="1.0" encoding="UTF-8"?> <ExecuteResponse> <Status>OK</Status> <Message>Success</Message> </ExecuteResponse> |
URL | http://[hostname]:[port]/pipelineapi/suspend | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /suspend | ||||||||||||||||
説明 | パイプラインを停止状態にします | ||||||||||||||||
| |||||||||||||||||
<リクエスト> PUT /pipelineapi/suspend/xml HTTP/1.1 Cookie: SESSIONID=1132A6383FDD4A898039DECA238348D1 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:38080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Content-Length: 19 pipelineid=pl_00001 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 118 Server: ASTERIA HTTP Daemon/1.01 Connection: close Date: Fri, 24 Apr 2009 09:21:52 GMT Set-Cookie: SESSIONID=1132A6383FDD4A898039DECA238348D1;Path=/ <?xml version="1.0" encoding="UTF-8"?> <ExecuteResponse> <Status>OK</Status> <Message>Success</Message> </ExecuteResponse> |
URL | http://[hostname]:[port]/pipelineapi/version | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /version | ||||||||||||||
説明 | バージョン情報を取得します | ||||||||||||||
| |||||||||||||||
<リクエスト> GET /pipelineapi/version/xml HTTP/1.1 Cookie: SESSIONID=4C46A49937784AD39FFB87B3C6FE4AD3 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:38080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 177 Server: ASTERIA HTTP Daemon/1.01 Date: Fri, 24 Apr 2009 09:46:06 GMT Connection: close Set-Cookie: SESSIONID=4C46A49937784AD39FFB87B3C6FE4AD3;Path=/ <?xml version="1.0" encoding="UTF-8"?> <Response> <Version>製品バージョン文字列</Version> </Response> |
URL | http://[hostname]:[port]/pipelineapi/systemdb | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /systemdb | ||||||||||||||||||||||||||||||||
説明 | システムDBのテーブル一覧、テーブル内容を取得します | ||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
<テーブル名一覧:リクエスト> GET /pipelineapi/systemdb/xml?pagesize=50 HTTP/1.1 Cookie: SESSIONID=0388A6BB154845F9B619C1B015008CBC User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:38080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <テーブル名一覧:レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 317 Server: ASTERIA HTTP Daemon/1.01 Date: Fri, 24 Apr 2009 09:40:18 GMT Connection: close Set-Cookie: SESSIONID=0388A6BB154845F9B619C1B015008CBC;Path=/ <?xml version="1.0" encoding="UTF-8"?> <Result> <Info> <Index>0</Index> <Prev>-1</Prev> <Next>-1</Next> <Count>3</Count> </Info> <Header> <Item>tablename</Item> </Header> <Record><Item>ACTIVEMQ_ACKS</Item></Record> <Record><Item>ACTIVEMQ_LOCK</Item></Record> <Record><Item>ACTIVEMQ_MSGS</Item></Record> <Status>OK</Status> </Result> <テーブル内容:リクエスト> GET /pipelineapi/systemdb/xml?tablename=ACTIVEMQ_LOCK&pagesize=50 HTTP/1.1 Cookie: SESSIONID=3855E48A2FD342E18EDEEB1FF810AB88 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:38080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <テーブル内容:レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 423 Server: ASTERIA HTTP Daemon/1.01 Date: Fri, 24 Apr 2009 09:48:29 GMT Connection: close Set-Cookie: SESSIONID=3855E48A2FD342E18EDEEB1FF810AB88;Path=/ <?xml version="1.0" encoding="UTF-8"?> <Result> <Info> <Index>0</Index> <Prev>-1</Prev> <Next>-1</Next> <Count>1</Count> </Info> <Header> <Item><Name>ID</Name><Type>BIGINT</Type><Key>false</Key></Item> <Item><Name>TIME</Name><Type>BIGINT</Type><Key>false</Key></Item> <Item><Name>BROKER_NAME</Name><Type>VARCHAR</Type><Key>false</Key></Item> </Header> <Record> <Item>1</Item> <Item isnull="true" /> <Item isnull="true" /> </Record> <Status>OK</Status> </Result> |
URL | http://[hostname]:[port]/pipelineapi/statusdb | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /statusdb | ||||||||||||||||||||||||||||||||
説明 | ステータスDBのテーブル一覧、テーブル内容を取得します | ||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
<テーブル名一覧:リクエスト> GET /pipelineapi/statusdb/xml?pagesize=50 HTTP/1.1 Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:35080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <テーブル名一覧:レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 232 Server: ASTERIA HTTP Daemon/1.01 Date: Sat, 16 May 2009 06:54:30 GMT Connection: close Set-Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521;Path=/ <?xml version="1.0" encoding="UTF-8"?> <Result> <Info> <Index>0</Index><Prev>-1</Prev><Next>-1</Next><Count>1</Count> </Info> <Header> <Item>tablename</Item> </Header> <Record> <Item>STATUS20090516</Item> </Record> <Status>OK</Status> </Result> <テーブル内容:リクエスト> GET /pipelineapi/statusdb/xml?tablename=STATUS20090516&pagesize=50 HTTP/1.1 Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:35080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <テーブル内容:レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 1029 Server: ASTERIA HTTP Daemon/1.01 Date: Sat, 16 May 2009 06:56:41 GMT Connection: close Set-Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521;Path=/ <?xml version="1.0" encoding="UTF-8"?> <Result> <Info> <Index>0</Index><Prev>-1</Prev><Next>-1</Next><Count>2</Count> </Info> <Header> <Item><Name>REQUESTID</Name><Type>VARCHAR</Type><Key>false</Key></Item> <Item><Name>PIPELINEID</Name><Type>VARCHAR</Type><Key>false</Key></Item> <Item><Name>CREATED</Name><Type>TIMESTAMP</Type><Key>false</Key></Item> <Item><Name>LASTUPDATED</Name><Type>TIMESTAMP</Type><Key>false</Key></Item> <Item><Name>STAGE</Name><Type>VARCHAR</Type><Key>false</Key></Item> <Item><Name>STATUS</Name><Type>VARCHAR</Type><Key>false</Key></Item> <Item><Name>ERRORMSG</Name><Type>VARCHAR</Type><Key>false</Key></Item> <Item><Name>ERROR</Name><Type>INTEGER</Type><Key>false</Key></Item> </Header> <Record> <Item>pl_00009-20090516_15-000001</Item><Item>/pipeline.pl_00009</Item><Item>2009-05-16 15:34:17.841000000</Item> <Item>2009-05-16 15:34:19.247000000</Item><Item></Item><Item>Finish</Item><Item></Item><Item>0</Item> </Record> <Record> <Item>pl_00009-20090516_15-000002</Item><Item>/pipeline.pl_00009</Item> <Item>2009-05-16 15:49:09.379000000</Item><Item>2009-05-16 15:49:10.386000000</Item> <Item></Item><Item>Finish</Item><Item></Item><Item>0</Item> </Record> <Status>OK</Status> </Result> |
URL | http://[hostname]:[port]/pipelineapi/actiondb | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /actiondb | ||||||||||||||||||||||||||||||||
説明 | アクションDBのテーブル一覧、テーブル内容を取得します | ||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
<テーブル名一覧:リクエスト> GET /pipelineapi/actiondb/xml?pagesize=50 HTTP/1.1 Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:35080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <テーブル名一覧:レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 229 Server: ASTERIA HTTP Daemon/1.01 Date: Sat, 16 May 2009 06:40:33 GMT Connection: close Set-Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521;Path=/ <?xml version="1.0" encoding="UTF-8"?> <Result> <Info> <Index>0</Index><Prev>-1</Prev><Next>-1</Next><Count>1</Count> </Info> <Header> <Item>tablename</Item> </Header> <Record> <Item>sampletable</Item> </Record> <Status>OK</Status> </Result> <テーブル内容:リクエスト> GET /pipelineapi/actiondb/xml?tablename=sampletable&pagesize=50 HTTP/1.1 Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:35080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <テーブル内容:レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 425 Server: ASTERIA HTTP Daemon/1.01 Date: Sat, 16 May 2009 06:49:16 GMT Connection: close Set-Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521;Path=/ <?xml version="1.0" encoding="UTF-8"?> <Result> <Info> <Index>0</Index><Prev>-1</Prev><Next>-1</Next><Count>2</Count> </Info> <Header> <Item><Name>item1</Name><Type>VARCHAR</Type><Key>false</Key></Item> <Item><Name>item2</Name><Type>VARCHAR</Type><Key>false</Key></Item> <Item><Name>item3</Name><Type>VARCHAR</Type><Key>false</Key></Item> </Header> <Record> <Item>1</Item><Item>2</Item><Item>3</Item> </Record> <Record> <Item>4</Item><Item>5</Item><Item>6</Item> </Record> <Status>OK</Status> </Result> |
URL | http://[hostname]:[port]/pipelineapi/pipelinecache | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /pipelinecache | ||||||||||||||||
説明 | パイプラインアクションのキャッシュをクリアします | ||||||||||||||||
| |||||||||||||||||
<リクエスト> DELETE /pipelineapi/pipelinecache/xml?pipelineid=pl_00009&sensor=true&filter=true&joint=true HTTP/1.1 Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:35080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 118 Server: ASTERIA HTTP Daemon/1.01 Connection: close Date: Sat, 16 May 2009 07:01:00 GMT Set-Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521;Path=/ <?xml version="1.0" encoding="UTF-8"?> <ExecuteResponse> <Status>OK</Status> <Message>Success</Message> </ExecuteResponse> |
URL | http://[hostname]:[port]/pipelineapi/deletetable | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /deletetable | ||||||||||||||||
説明 | アクションDBのテーブルのデータをクリアします | ||||||||||||||||
| |||||||||||||||||
<リクエスト> DELETE /pipelineapi/deletetable/xml?table=sampletable HTTP/1.1 Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:35080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 140 Server: ASTERIA HTTP Daemon/1.01 Connection: close Date: Sat, 16 May 2009 07:03:51 GMT Set-Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521;Path=/ <?xml version="1.0" encoding="UTF-8"?> <ExecuteResponse> <Status>OK</Status> <Message>Success</Message> <RowCount>2</RowCount> </ExecuteResponse> |
URL | http://[hostname]:[port]/pipelineapi/droptable | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Client Argument URL | /droptable | ||||||||||||||||
説明 | アクションDBのテーブルをドロップします | ||||||||||||||||
| |||||||||||||||||
<リクエスト> DELETE /pipelineapi/droptable/xml?table=sampletable HTTP/1.1 Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521 User-Agent: CoordinatorClient/1.0 Connection: close Content-Type: application/x-www-form-urlencoded Host: localhost:35080 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 <レスポンス> HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Content-Length: 140 Server: ASTERIA HTTP Daemon/1.01 Connection: close Date: Sat, 16 May 2009 07:06:16 GMT Set-Cookie: SESSIONID=6161A03E2D7B48A6AA9E9F6C846EE521;Path=/ <?xml version="1.0" encoding="UTF-8"?> <ExecuteResponse> <Status>OK</Status> <Message>Success</Message> <RowCount>0</RowCount> </ExecuteResponse> |
APIキット一式をリンクからダウンロードできます。
apikit-0.0.3.zip: version 0.0.3
APIキットの内容は下記になります。
apikit-0.0.3.zip /ruby asteria-client-ruby-0.0.3.tar.gz /perl asteria-client-perl-0.0.3.tar.gz /coordinatorclient asteria-client-coordinatorclient-0.0.3.zip /java asteria-client-java-0.0.3.zip /wsh asteria-client-wsh-0.0.3.zip /php asteria-client-php-0.0.3.tar.gz
module API { // クライアント interface Client { // GET メソッドでリクエストを送信 ResponseResult get( url , data ) ; ResponseResult get( url , data , headers ) ; // POST メソッドでリクエストを送信 ResponseResult post( url , data ) ; ResponseResult post( url , data , headers ) ; // PUT メソッドでリクエストを送信 ResponseResult put( url , data ) ; ResponseResult put( url , data , headers ) ; // DELETE メソッドでリクエストを送信 ResponseResult delete( url , data ) ; ResponseResult delete( url , data , headers ) ; } // レスポンスオブジェクト interface ResponseResult { // response int status() ; // OK, Error , SystemError , Unknown のいずれかを示す整数値 int format() ; // XML, Json , Html , Unknown のいずれかを示す整数値 Object response() ; // それぞれのコンテントタイプに合わせたObject string text() ; // レスポンスボディの文字列 } }
GETメソッドでHTTP通信を行います
url はAPIリストにのいずれかのURLを指定します。 EX パイプライン一覧を取得する場合は /list
data はクエリ文字列を指定します。指定方法は言語に依存します
headers はHTTPヘッダに値を設定します。指定方法は言語に依存します
POSTメソッドでHTTP通信を行います
urlにはAPIリストにのいずれかのURLを指定します。 EX パイプラインを実行する場合は /exec
data はクエリ文字列を指定します。指定方法は言語に依存します
headers はHTTPヘッダに値を設定します。指定方法は言語に依存します
PUTメソッドでHTTP通信を行います
urlにはAPIリストにのいずれかのURLを指定します。 EX パイプラインを開始する場合は /resume
data はクエリ文字列を指定します。指定方法は言語に依存します
headers はHTTPヘッダに値を設定します。指定方法は言語に依存します
DELETEメソッドでHTTP通信を行います
urlにはAPIリストにのいずれかのURLを指定します。 EX アクションのキャッシュをクリアする場合は /pipelinecache
data はクエリ文字列を指定します。指定方法は言語に依存します
headers はHTTPヘッダに値を設定します。指定方法は言語に依存します
OK, Error , SystemError , Unknown のいずれかの整数値を返します
XML, Json , Html , Unknown のいずれかを示す整数値返します
それぞれのコンテントタイプに合わせたObject,結果は言語に依存します
レスポンスの文字列を返します。結果は言語に依存します
Method | URL | Method | URL | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GET |
| POST |
|
||||||||||||||||
PUT |
| DELETE |
|
全てのキットはBSD ライセンスになります。
ResponseResultのresponseは以下のコンテントタイプごとに、
#!/usr/bin/ruby require 'asteria' api_key = '1d1687d0-ec6e-4a78-ad66-be9c024c34f1-0deafe00f429d31e0f62ff2baaf5789d' api = ASTERIA::Client.new( api_key , '192.168.5.165' , 25080 ) xmlresult = api.get( "/list/xml" , "" ) print "#{xmlresult.text}"
ResponseResultのresponseは以下のコンテントタイプごとに、
#!/usr/bin/perl use ASTERIA::Client ; $api_key = "1d1687d0-ec6e-4a78-ad66-be9c024c34f1-0deafe00f429d31e0f62ff2baaf5789d" ; $apiclient = ASTERIA::Client->new( { license => $api_key , hostname => "192.168.5.165" , port => 25080 } ); $result = $apiclient->post( "/exec/xml" , { pipelineid => "pl_00001" , filename => "plrun.dat" } ) ; $txt = $result->text ; print "$txt" ;
ResponseResultのresponseは以下のコンテントタイプごとに、
import com.infoteria.asteria.net.http.speaker.Client ; import com.infoteria.asteria.net.http.speaker.ClientException ; import com.infoteria.asteria.net.http.speaker.ResponseResult ; public class Sample { public static void main( String[] args ) throws ClientException { String key = "1d1687d0-ec6e-4a78-ad66-be9c024c34f1-0deafe00f429d31e0f62ff2baaf5789d" ; String host = "192.168.5.165" ; int port = 25080 ; Client client = new Client( key , host , port ) ; try { ResponseResult result = client.get( "/list/xml" , null ) ; String text = result.getText() ; System.out.println( text ) ; } catch ( ClientException e ) { e.printStackTrace() ; } } }
以下の手順でパイプラインAPIのフローコンポーネントサンプルを使用できます。
javaキットの中の flowpipelineapi.jar を[Install Dir]/flow/lib/flowlib 以下にコピーします。
デザイナーでコピーしたコンポーネントのファイルをダウンロードします。 ダウンロー後、デザイナーを再起動します。
![]() |
![]() |
実行した結果内容
ResponseResultのresponseは以下のコンテントタイプごとに、
<?php include_once 'client.php'; $apikey = "Your License Key"; $host ="192.168.5.165" ; $port = 25080 ; $apiclient = new Client( $apikey , $host , $port ) ; $result = $apiclient->get( "/list" ) ; echo $result->text ; ?>
ResponseResultのresponseは以下のコンテントタイプごとに、
<job> <script language="VBScript" src="client.vbs" /> <script language="VBScript" > Dim transport ,response set transport = new Client transport.License = "your license key" transport.Host = "192.168.5.165" transport.ContextPath = "/pipelineapi" transport.Port = 25080 Set response = transport.GetMethod( "/list" , "" ) WScript.Echo "Status : " & response.status WScript.Echo "Format : " & response.status WScript.Echo "Content : " & response.response </script> </job>
Dim strXMLDoc Dim intRet Dim strURL Dim strKey Dim strAPI Dim objXML strURL = "http://yourpipelinehostname:25080/pipelineapi/exec" strKey = "pipelineid=pl_00001" strAPI = "your license key" Set objXML = WScript.CreateObject("MSXML2.ServerXMLHTTP") objXML.open "POST", strURL, False objXML.setRequestHeader "Content-Type", " application/x-www-form- urlencoded" objXML.setRequestHeader "Content-Length", len(strKey) objXML.setRequestHeader "X-PIPELINEWEBAPI", strAPI objXML.send strKey strXMLDoc = objXML.responseText intRet = objXML.status MsgBox intRet MsgBox strXMLDoc Set objXML = Nothing