General information
After Agent is started – JBoss AS service is in stopped state – there is no autostart. To start the service – a start action needs to be called on the service.
JBoss AS service uses jboss_as prefix.
Actions
Status
This is a very important action which returns current state of the service.
GET /service/jboss_as/status
Return:
{ "state": "stopped" }
Available states
- stopped
- starting
- started
- configuring
- stopping
Configure
The configure command configures JBoss AS service. There are 3 types of things to configure:
- S3_PING config data
- JGroups GossipRouter host address
- Proxy list
Configure call is executed with following request:
POST /service/jboss_as/configure
Body of this request will wary. Every configure request will require body sent in config parameter.
While configuring service should respond with configuring state.
S3_PING
This command updates S3_PING credentials used to save cluster data in a S3 bucket. Usable only on EC2 environments. This command restarts JBoss AS service if it was running.
{"s3_ping":{"pre_signed_put_url":"http://s3.amazonaws.com/...","pre_signed_delete_url":"http://s3.amazonaws.com/..."}}
GossipRouter
This command updates GossipRouter host. Usable on non-EC2 environments. This command restarts JBoss AS service if it was running.
{"gossip_host":"10.1.0.1"}
Proxy list
This command updates mod_cluster proxy list for front-end instances.
{"proxy_list":{"10.1.0.1":{"host":"10.1.0.1","port":80}}}
Admin Credentials
This command updates the credentials for accessing /jmx-console and /admin-console. This command restarts JBoss AS service if it was running.
{"create_admin": {"user": "admin_user", "password": "secret"}}
Start
Start action starts the service. It cannot be executed when the service is in transition (state: starting, stopping) or in the configure process (state: configuring). This is a long-running call executed in background. Status action is returned.
There is no request body required.
POST /service/jboss_as/start
{ "state": "starting" }
Stop
Stop action stops the service. It cannot be executed when the service is in transition (state: starting, stopping) or in the configure process (state: configuring). This is a long-running call executed in background. Status action is returned.
There is no request body required.
POST /service/jboss_as/stop
Return:
{ "state": "stopping" }
Restart
Restart action restarts the service. It cannot be executed when the service is in transition (state: starting, stopping) or in the configure process (state: configuring). It can be executed when service is stopped. This is a long-running call executed in background. Status action is returned.
There is no request body required.
POST /service/jboss_as/restart
Example return:
{ "state": "starting" }
Deploy
Deploy action deploys new artifact in the service. Deploy action needs either a payload which is the artifact itself (WAR, EAR or configuration file) sent as an artifact parameter using multipart/form-data content type or the location to download the payload sent as an artifact parameter. Each deploy action deploys exactly one artifact. If the payload is the artifact itself, it is handled immediately, and a status of 'deployed' is returned. If the payload is a download location, the deploy action returns a status of 'pending', and handles the download and deploy in the background. In the latter case, a client needs to make an artifact call to see if the artifact fully deployed.
POST /service/jboss_as/artifacts
Example call using CURL to send artifact payload
curl -v -F "artifact=@node-info.war" http://dev:4567/services/jboss_as/artifacts
Example POST body when specifying a location to download the payload from
artifact=%7B%22location%22%3A%22http%3A%2F%2Fs3.amazonaws.com%2F%22%7D
JSON for above POST body
{ "location": "http://s3.amazonaws.com/" }
Example return:
{ "status": "pending" }
Artifact
Gets information about deployed artifact.
There is no request body required.
GET /service/jboss_as/artifacts/1
Example return:
{ "type": "application/octet-stream", "name": "node-info.war", "size": 2662 }
Artifacts
Get list of all deployed artifacts.
There is no request body required.
GET /service/jboss_as/artifacts
Example return:
{ "artifacts": [ { "name": "abc.war", "id": 1 }, { "name": "node-info.war", "id": 2 } ] }
Undeploy
Uneploy action removes artifact from the service. Each undeploy action removes exactly one artifact. This is not a long-running call. This call returns only status or error.
DELETE /service/jboss_as/artifacts/1
Example return:
No body is returned.
Comments