One of the operational plugins. It allows to remotely control the running application.
This plugin is disabled by default and allows configuring the available
commands. This configuration is made via the #operations
config.
For example:
Dictionary new
at: #operations put: (
Dictionary new
at: 'application-control'
put: {
#enabled -> true.
#commands -> #('shutdown')} asDictionary;
yourself
);
yourself
To get a list of supported commands, print the result of
ApplicationControlPlugin availableCommands collect: #methodName as: Array
Available commands:
shutdown
Gracefully shutdowns the running application
This is a JSON RPC API.
- Endpoint:
/application-control
- Allowed HTTP methods:
POST
- Supported media types:
application/json
- Authentication: Required
- Authorization: Requires
execute:application-control
- Expected Responses:
200 OK
when used for Procedure Calls202 Accepted
when used for Notifications
POST /operations/application-control HTTP/1.1
Content-Type: application/json
Accept: application/json
{
"jsonrpc" : "2.0",
"method" : "shutdown"
}
HTTP/1.1 202 Accepted
POST /operations/application-control HTTP/1.1
Content-Type: application/json
Accept: application/json
{
"jsonrpc" : "2.0",
"id" : 1,
"method" : "shutdown"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"jsonrpc": "2.0",
"result": "Remote SHUTDOWN command was received.",
"id": 1
}
POST /operations/application-control HTTP/1.1
Content-Type: application/json
Accept: application/json
{
"jsonrpc" : "2.0",
"id" : 1,
"method" : "xxx"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"message": "The method does not exist / is not available.",
"code": -32601
}
}