7.5.2. HTTP API を使用した管理対象ドメインでのアプリケーションのデプロイ
デフォルトでは、HTTP API は http://HOST:PORT/management
でアクセスできます (例: http://localhost:9990/management
)。
アプリケーションのデプロイ
デプロイメントをコンテンツリポジトリーに追加します。
$ curl --digest -L -D - http://HOST:PORT/management --header "Content-Type: application/json" -u USER:PASSWORD -d '{"operation" : "add", "address" : {"deployment" : "test-application.war"}, "content" : [{"url" : "file:/path/to/test-application.war"}],"json.pretty":1}'
デプロイメントを指定のサーバーグループに追加します。
$ curl --digest -L -D - http://HOST:PORT/management --header "Content-Type: application/json" -u USER:PASSWORD -d '{"operation" : "add", "address" : {"server-group" : "main-server-group","deployment":"test-application.war"},"json.pretty":1}'
サーバーグループにアプリケーションをデプロイします。
$ curl --digest -L -D - http://HOST:PORT/management --header "Content-Type: application/json" -u USER:PASSWORD -d '{"operation" : "deploy", "address" : {"server-group" : "main-server-group","deployment":"test-application.war"},"json.pretty":1}'
アプリケーションのアンデプロイ
割り当てられたサーバーグループすべてからデプロイメントを削除します。
$ curl --digest -L -D - http://HOST:PORT/management --header "Content-Type: application/json" -u USER:PASSWORD -d '{"operation" : "remove", "address" : {"server-group" : "main-server-group","deployment":"test-application.war"},"json.pretty":1}'
コンテンツリポジトリーからデプロイメントを削除します。
$ curl --digest -L -D - http://HOST:PORT/management --header "Content-Type: application/json" -u USER:PASSWORD -d '{"operation" : "remove", "address" : {"deployment" : "test-application.war"}, "json.pretty":1}'