Red Hat Training
A Red Hat training course is available for Red Hat JBoss Enterprise Application Platform
10.4. HTTP API を用いたデプロイ
10.4.1. HTTP API を使用したアプリケーションのデプロイ
概要
以下の手順に従って、HTTP API よりアプリケーションをデプロイできます。
前提条件
- 管理インターフェースのユーザーを追加します。リモート管理インターフェースの初期管理ユーザーを作成する方法は、を参照してください。 「管理インターフェースのユーザーの追加」
手順10.8 HTTP API を使用したアプリケーションのデプロイ
- 要件に関連する
deploy
またはundeploy
コマンドのいずれかを使用します。例10.2 デプロイおよびアンデプロイコマンド
Deploy ------------------------------ curl --digest -L -D - http://<host>:<port>/management --header "Content-Type: application/json" -d '{"operation" : "composite", "address" : [], "steps" : [{"operation" : "add", "address" : {"deployment" : "<runtime-name>"}, "content" : [{"url" : "file:<path-to-archive>}]},{"operation" : "deploy", "address" : {"deployment" : "<runtime-name>"}}],"json.pretty":1}' -u <user>:<pass> Example: ------- curl --digest -L -D - http://localhost:9990/management --header "Content-Type: application/json" -d '{"operation" : "composite", "address" : [], "steps" : [{"operation" : "add", "address" : {"deployment" : "example.war"}, "content" : [{"url" : "file:/home/$user/example.war"}]},{"operation" : "deploy", "address" : {"deployment" : "example.war"}}],"json.pretty":1}' -u user:password Undeploy ------------------------------ curl --digest -L -D - http://<host>:<port>/management --header "Content-Type: application/json" -d '{"operation" : "composite", "address" : [], "steps" : [{"operation" : "undeploy", "address" : {"deployment" : "<runtime-name>"}},{"operation" : "remove", "address" : {"deployment" : "<runtime-name>"}}],"json.pretty":1}' -u <user>:<pass> Example: ------- curl --digest -L -D - http://localhost:9990/management --header "Content-Type: application/json" -d '{"operation" : "composite", "address" : [], "steps" : [{"operation" : "undeploy", "address" : {"deployment" : "example.war"}},{"operation" : "remove", "address" : {"deployment" : "example.war"}}],"json.pretty":1}' -u user:password
注記
JSON 要求をプログラムで生成する方法の詳細は、を参照してください https://access.redhat.com/solutions/82463。