7.5. HTTP API를 사용하여 애플리케이션 배포
애플리케이션을 curl
명령과 함께 HTTP API를 사용하여 JBoss EAP에 배포할 수 있습니다. HTTP API 사용에 대한 자세한 내용은 HTTP API 섹션을 참조하십시오.
7.5.1. 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" : "composite", "address" : [], "steps" : [{"operation" : "add", "address" : {"deployment" : "test-application.war"}, "content" : [{"url" : "file:/path/to/test-application.war"}]},{"operation" : "deploy", "address" : {"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" : "composite", "address" : [], "steps" : [{"operation" : "undeploy", "address" : {"deployment" : "test-application.war"}},{"operation" : "remove", "address" : {"deployment" : "test-application.war"}}],"json.pretty":1}'
JSON 요청을 프로그래밍 방식으로 생성하는 방법에 대해 자세히 알아보려면 이 Red Hat 지식베이스 문서를 참조하십시오.
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}'