28.2. サポートされるナレッジストア REST API エンドポイント
ナレッジストア REST API は、Red Hat Process Automation Manager 内のスペースおよびプロジェクトを管理し、以前の内 REST API リクエストまたは jobs に関する情報を取得するエンドポイントを提供します。
28.2.1. スペース リンクのコピーリンクがクリップボードにコピーされました!
ナレッジストア REST API は Business Central のスペースを管理するための以下のエンドポイントをサポートします。ナレッジストア REST API のベース URL は http://SERVER:PORT/business-central/rest/ です。ユーザーロール rest-all では、すべての要求で HTTP の Basic 認証またはトークンベースの認証が必要です。
- [GET] /spaces
Business Central のすべてのスペースを返します。
サーバーの応答例 (JSON)
[ { "name": "MySpace", "description": null, "projects": [ { "name": "Employee_Rostering", "spaceName": "MySpace", "groupId": "employeerostering", "version": "1.0.0-SNAPSHOT", "description": "Employee rostering problem optimisation using Planner. Assigns employees to shifts based on their skill.", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-Employee_Rostering" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-Employee_Rostering" } ] }, { "name": "Mortgage_Process", "spaceName": "MySpace", "groupId": "mortgage-process", "version": "1.0.0-SNAPSHOT", "description": "Getting started loan approval process in BPMN2, decision table, business rules, and forms.", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-Mortgage_Process" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-Mortgage_Process" } ] } ], "owner": "admin", "defaultGroupId": "com.myspace" }, { "name": "MySpace2", "description": null, "projects": [ { "name": "IT_Orders", "spaceName": "MySpace", "groupId": "itorders", "version": "1.0.0-SNAPSHOT", "description": "Case Management IT Orders project", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-IT_Orders-1" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-IT_Orders-1" } ] } ], "owner": "admin", "defaultGroupId": "com.myspace" } ]- [GET] /spaces/{spaceName}
指定したスペースに関する情報を返します。
Expand 表28.1 要求パラメーター 名前 説明 タイプ 要件 spaceName取得するスペースの名前
文字列
必須
サーバーの応答例 (JSON)
{ "name": "MySpace", "description": null, "projects": [ { "name": "Mortgage_Process", "spaceName": "MySpace", "groupId": "mortgage-process", "version": "1.0.0-SNAPSHOT", "description": "Getting started loan approval process in BPMN2, decision table, business rules, and forms.", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-Mortgage_Process" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-Mortgage_Process" } ] }, { "name": "Employee_Rostering", "spaceName": "MySpace", "groupId": "employeerostering", "version": "1.0.0-SNAPSHOT", "description": "Employee rostering problem optimisation using Planner. Assigns employees to shifts based on their skill.", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-Employee_Rostering" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-Employee_Rostering" } ] }, { "name": "Evaluation_Process", "spaceName": "MySpace", "groupId": "evaluation", "version": "1.0.0-SNAPSHOT", "description": "Getting started Business Process for evaluating employees", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-Evaluation_Process" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-Evaluation_Process" } ] }, { "name": "IT_Orders", "spaceName": "MySpace", "groupId": "itorders", "version": "1.0.0-SNAPSHOT", "description": "Case Management IT Orders project", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-IT_Orders" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-IT_Orders" } ] } ], "owner": "admin", "defaultGroupId": "com.myspace" }- [POST] /spaces
Business Central でスペースを作成します。
Expand 表28.2 要求パラメーター 名前 説明 タイプ 要件 ボディ
新規スペースの
name、description、owner、defaultGroupId、およびその他のコンポーネント要求ボディ
必須
要求ボディ (JSON) 例
{ "name": "NewSpace", "description": "My new space.", "owner": "admin", "defaultGroupId": "com.newspace" }サーバーの応答例 (JSON)
{ "jobId": "1541016978154-3", "status": "APPROVED", "spaceName": "NewSpace", "owner": "admin", "defaultGroupId": "com.newspace", "description": "My new space." }- [PUT] /spaces
Business Central のスペースの
description、owner、およびdefaultGroupIdを更新します。要求ボディ (JSON) 例
{ "name": "MySpace", "description": "This is updated description", "owner": "admin", "defaultGroupId": "com.updatedGroupId" }サーバーの応答例 (JSON)
{ "jobId": "1592214574454-1", "status": "APPROVED", "spaceName": "MySpace", "owner": "admin", "defaultGroupId": "com.updatedGroupId", "description": "This is updated description" }- [DELETE] /spaces/{spaceName}
Business Central から指定したスペースを削除します。
Expand 表28.3 要求パラメーター 名前 説明 タイプ 要件 spaceName削除するスペースの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1541127032997-8", "status": "APPROVED", "spaceName": "MySpace", "owner": "admin", "description": "My deleted space.", "repositories": null }
28.2.2. プロジェクト リンクのコピーリンクがクリップボードにコピーされました!
ナレッジストア REST API は Business Central のプロジェクトを管理、ビルド、デプロイするための以下のエンドポイントをサポートします。ナレッジストア REST API のベース URL は http://SERVER:PORT/business-central/rest/ です。ユーザーロール rest-all では、すべての要求で HTTP の Basic 認証またはトークンベースの認証が必要です。
- [GET] /spaces/{spaceName}/projects
指定したスペースにあるプロジェクトを返します。
Expand 表28.4 要求パラメーター 名前 説明 タイプ 要件 spaceName取得するプロジェクトのスペース名
文字列
必須
サーバーの応答例 (JSON)
[ { "name": "Mortgage_Process", "spaceName": "MySpace", "groupId": "mortgage-process", "version": "1.0.0-SNAPSHOT", "description": "Getting started loan approval process in BPMN2, decision table, business rules, and forms.", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-Mortgage_Process" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-Mortgage_Process" } ] }, { "name": "Employee_Rostering", "spaceName": "MySpace", "groupId": "employeerostering", "version": "1.0.0-SNAPSHOT", "description": "Employee rostering problem optimisation using Planner. Assigns employees to shifts based on their skill.", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-Employee_Rostering" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-Employee_Rostering" } ] }, { "name": "Evaluation_Process", "spaceName": "MySpace", "groupId": "evaluation", "version": "1.0.0-SNAPSHOT", "description": "Getting started Business Process for evaluating employees", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-Evaluation_Process" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-Evaluation_Process" } ] }, { "name": "IT_Orders", "spaceName": "MySpace", "groupId": "itorders", "version": "1.0.0-SNAPSHOT", "description": "Case Management IT Orders project", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-IT_Orders" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-IT_Orders" } ] } ]- [GET] /spaces/{spaceName}/projects/{projectName}
指定したスペースにある指定したプロジェクト関する情報を返します。
Expand 表28.5 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectName取得するプロジェクトの名前
文字列
必須
サーバーの応答例 (JSON)
{ "name": "Employee_Rostering", "spaceName": "MySpace", "groupId": "employeerostering", "version": "1.0.0-SNAPSHOT", "description": "Employee rostering problem optimisation using Planner. Assigns employees to shifts based on their skill.", "publicURIs": [ { "protocol": "git", "uri": "git://localhost:9418/MySpace/example-Employee_Rostering" }, { "protocol": "ssh", "uri": "ssh://localhost:8001/MySpace/example-Employee_Rostering" } ] }- [POST] /spaces/{spaceName}/projects
指定したスペースにプロジェクトを作成します。
Expand 表28.6 要求パラメーター 名前 説明 タイプ 要件 spaceName新規プロジェクトが作成されるスペースの名前
文字列
必須
ボディ
新規プロジェクトの
name、groupId、version、description、およびその他のコンポーネント要求ボディ
必須
要求ボディ (JSON) 例
{ "name": "Employee_Rostering", "groupId": "employeerostering", "version": "1.0.0-SNAPSHOT", "description": "Employee rostering problem optimisation using Planner. Assigns employees to shifts based on their skill." }サーバーの応答例 (JSON)
{ "jobId": "1541017411591-6", "status": "APPROVED", "spaceName": "MySpace", "projectName": "Employee_Rostering", "projectGroupId": "employeerostering", "projectVersion": "1.0.0-SNAPSHOT", "description": "Employee rostering problem optimisation using Planner. Assigns employees to shifts based on their skill." }- [DELETE] /spaces/{spaceName}/projects/{projectName}
指定したスペースから指定したプロジェクトを削除します。
Expand 表28.7 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectName削除するプロジェクトの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1541128617727-10", "status": "APPROVED", "projectName": "Employee_Rostering", "spaceName": "MySpace" }- [POST] /spaces/{spaceName}/git/clone
指定した Git アドレスから指定したスペースにプロジェクトのクローンを作成します。
Expand 表28.8 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのクローンを作成するスペース名
文字列
必須
ボディ
クローンするプロジェクトの
name、description、Git リポジトリーのuserName、password、およびgitURL要求ボディ
必須
要求ボディ (JSON) 例
{ "name": "Employee_Rostering", "description": "Employee rostering problem optimisation using Planner. Assigns employees to shifts based on their skill.", "userName": "baAdmin", "password": "password@1", "gitURL": "git://localhost:9418/MySpace/example-Employee_Rostering" }サーバーの応答例 (JSON)
{ "jobId": "1541129488547-13", "status": "APPROVED", "cloneProjectRequest": { "name": "Employee_Rostering", "description": "Employee rostering problem optimisation using Planner. Assigns employees to shifts based on their skill.", "userName": "baAdmin", "password": "password@1", "gitURL": "git://localhost:9418/MySpace/example-Employee_Rostering" }, "spaceName": "MySpace2" }- [POST] /spaces/{spaceName}/projects/{projectName}/maven/compile
指定したスペースで指定したプロジェクトをコンパイルします (
mvn compileと同等)。Expand 表28.9 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectNameコンパイルするプロジェクトの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1541128617727-10", "status": "APPROVED", "projectName": "Employee_Rostering", "spaceName": "MySpace" }- [POST] /spaces/{spaceName}/projects/{projectName}/maven/test
指定したスペースで指定したプロジェクトをテストします (
mvn testと同等)。Expand 表28.10 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectNameテストするプロジェクトの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1541132591595-19", "status": "APPROVED", "projectName": "Employee_Rostering", "spaceName": "MySpace" }- [POST] /spaces/{spaceName}/projects/{projectName}/maven/install
指定したスペースで指定したプロジェクトをインストールします (
mvn installと同等)。Expand 表28.11 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectNameインストールするプロジェクトの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1541132668987-20", "status": "APPROVED", "projectName": "Employee_Rostering", "spaceName": "MySpace" }- [POST] /spaces/{spaceName}/projects/{projectName}/maven/deploy
指定したスペースで指定したプロジェクトをデプロイします (
mvn deployと同等)。Expand 表28.12 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectNameデプロイするプロジェクトの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1541132816435-21", "status": "APPROVED", "projectName": "Employee_Rostering", "spaceName": "MySpace" }
28.2.3. ジョブ (API 要求) リンクのコピーリンクがクリップボードにコピーされました!
ナレッジストア REST API の POST と DELETE 要求はすべて、返される要求詳細のほかに、各要求に関連付けられたジョブ ID を返します。ジョブ ID を使用すると、要求ステータスを確認したり、送信された要求を削除することができます。
ナレッジストア REST API 要求もしくは ジョブ には、以下のステータスがあります。
| ステータス | 説明 |
|---|---|
|
| ジョブが受け入れられ、処理中である。 |
|
| 要求に無効なコンテンツが含まれ、受け入れられなかった。 |
|
| 要求されたリソース (パス) が存在しない。 |
|
| リソースがすでに存在する。 |
|
| KIE Server でエラーが発生した。 |
|
| 要求が正常に完了した。 |
|
| 要求が失敗した。 |
|
| 要求が承認された。 |
|
| 要求が拒否された。 |
|
| 以下のいずれかの理由で要求のジョブ ID が見つからなかった。
|
ナレッジストア REST API は、送信済み API 要求の取得または削除用の以下のエンドポイントをサポートします。ナレッジストア REST API のベース URL は http://SERVER:PORT/business-central/rest/ です。ユーザーロール rest-all では、すべての要求で HTTP の Basic 認証またはトークンベースの認証が必要です。
- [GET] /jobs/{jobId}
指定されたジョブのステータスを返します (以前に送信された API 要求)。
Expand 表28.14 要求パラメーター 名前 説明 タイプ 要件 jobId取得するジョブの ID (例:
1541010216919-1)文字列
必須
サーバーの応答例 (JSON)
{ "status": "SUCCESS", "jobId": "1541010216919-1", "result": null, "lastModified": 1541010218352, "detailedResult": [ "level:INFO, path:null, text:Build of module 'Mortgage_Process' (requested by system) completed.\n Build: SUCCESSFUL" ] }- [DELETE] /jobs/{jobId}
指定したジョブ (以前に送信された API 要求) を削除します。ジョブがまだ処理されていない場合、この要求はジョブをジョブキューから削除します。実行中のジョブがキャンセルされたり停止されたりすることはありません。
Expand 表28.15 要求パラメーター 名前 説明 タイプ 要件 jobId削除するジョブの ID (例:
1541010216919-1)文字列
必須
サーバーの応答例 (JSON)
{ "status": "GONE", "jobId": "1541010216919-1", "result": null, "lastModified": 1541132054916, "detailedResult": [ "level:INFO, path:null, text:Build of module 'Mortgage_Process' (requested by system) completed.\n Build: SUCCESSFUL" ] }
28.2.4. ブランチ リンクのコピーリンクがクリップボードにコピーされました!
ナレッジストア REST API は Business Central のブランチを管理するための以下のエンドポイントをサポートします。ナレッジストア REST API のベース URL は http://SERVER:PORT/business-central/rest/ です。ユーザーロール rest-all では、すべての要求で HTTP の Basic 認証またはトークンベースの認証が必要です。
- [GET] /spaces/{spaceName}/projects/{projectName}/branches
指定のプロジェクトおよびスペースにあるブランチをすべて返します。
Expand 表28.16 要求パラメーター 名前 説明 タイプ 要件 spaceName取得するプロジェクトのスペース名
文字列
必須
projectNameブランチを取得するためのプロジェクト名
文字列
必須
サーバーの応答例 (JSON)
[ { "name":"master" } ]- [POST] /spaces/{spaceName}/projects/{projectName}/branches
指定のプロジェクトおよびスペースに、指定したブランチを追加します。
Expand 表28.17 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectName新しくブランチを作成する必要があるプロジェクトの名前
文字列
必須
ボディ
プロジェクトの
newBranchNameとbaseBranchName要求ボディ
必須
要求ボディ (JSON) 例
{ "newBranchName": "branch01", "baseBranchName": "master" }サーバーの応答例 (JSON)
{ "jobId": "1576175811141-3", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "newBranchName": "b1", "baseBranchName": "master", "userIdentifier": "bc" }- [DELETE] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}
指定のプロジェクトおよびスペースから、指定したブランチを削除します。
Expand 表28.18 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectNameブランチが配置されているプロジェクトの名前
文字列
必須
branchName削除するブランチの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1576175811421-5", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", "userIdentifier": "bc" }- [POST] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/compile
指定のプロジェクトおよびスペースで、指定したブランチをコンパイルします。
branchNameが指定されていない場合、要求は Master ブランチに適用されます。Expand 表28.19 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectNameブランチが配置されているプロジェクトの名前
文字列
必須
branchNameコンパイルするブランチの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1576175811233-4", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", }- [POST] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/install
指定のプロジェクトおよびスペースに、指定したブランチをインストールします。
branchNameが指定されていない場合、要求は Master ブランチに適用されます。Expand 表28.20 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectNameブランチが配置されているプロジェクトの名前
文字列
必須
branchNameインストールするブランチの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1576175811233-4", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", }- [POST] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/test
指定のプロジェクトおよびスペースで、指定したブランチをテストします。
branchNameが指定されていない場合、要求は Master ブランチに適用されます。Expand 表28.21 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトが配置されているスペースの名前
文字列
必須
projectNameブランチが配置されているプロジェクトの名前
文字列
必須
branchNameテストするブランチの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1576175811233-4", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", }- [POST] /spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/deploy
指定のプロジェクトおよびスペースで、指定したブランチをデプロイします。
branchNameが指定されていない場合、要求は Master ブランチに適用されます。Expand 表28.22 要求パラメーター 名前 説明 タイプ 要件 spaceNameプロジェクトのあるスペースの名前
文字列
必須
projectNameブランチが配置されているプロジェクトの名前
文字列
必須
branchNameデプロイするブランチの名前
文字列
必須
サーバーの応答例 (JSON)
{ "jobId": "1576175811233-4", "status": "APPROVED", "spaceName": "Space123", "projectName": "ProjABC", "branchName": "b1", }