Skip to content

Operation - CSE Management

If enabled, the CSE provides a management interface that allows to manage some aspects of the CSE as well as to retrieve information about the CSE's operation. Management commands can be sent to the CSE via HTTP requests.

Enabling CSE Management

The CSE management interface is disabled by default. To enable it, set the enableManagementEndpoint setting in the configuration file to true:

Enable CSE Management
[http]
enableManagementEndpoint = true

Management Commands

The CSE management interface provides several commands that can be used to manage the CSE and retrieve information about its operation. The commands are sent as HTTP requests to the management endpoint, which is located at /__mgmt__ of the CSE's HTTP server.

Command Description
help Show a list of available management commands.
config Get the current configuration of the CSE in JSON format.
log Stream the live log output of the CSE. The log will continue to stream until the connection is closed.
loglevel Get or set the log level of the CSE. The log level can be set to info, debug, warn, error, or off.
registrations Get the current registrations of the CSE in JSON format. This includes the registrations to remote CSEs, service providers and the registrations of local AEs.
reset Reset the CSE to its initial state. This will clear all resources from the CSE.
restart Shutdown the CSE to restart it. The CSE will not restart internally, but it will exit with an exit code 82. See also the example below.
shutdown Shutdown the CSE normally. The CSE will exit with an exit code 0.
status Get the current status of the CSE in JSON format. This includes information about the CSE resources, operational parameters and requests.

Examples

The following examples show how to use the management commands via curl.

Get the CSE's Configuration

Get CSE Configuration
curl -X GET http://localhost:8080/__mgmt__/config

This will return the current configuration of the CSE in JSON format.

Get the CSE's Log Output

Get CSE Log Output
curl -X GET http://localhost:8080/__mgmt__/log

This will stream the live log output of the CSE. The log will continue to stream until the connection is closed, e.g. by pressing Ctrl+C in the terminal.

Set the CSE's Log Level

Set CSE Log Level to Debug
curl -X GET http://localhost:8080/__mgmt__/log/debug
Disable CSE Log Output
curl -X GET http://localhost:8080/__mgmt__/log/off

Shutdown the CSE

Shutdown CSE
curl -X GET http://localhost:8080/__mgmt__/shutdown

Restart the CSE

Restart CSE
curl -X GET http://localhost:8080/__mgmt__/restart
This will shutdown the CSE and exit with an exit code 82.

The CSE will not restart automatically. To support this one needs to check the exit code of the CSE and restart it manually or via a script.

The following example code shows how to restart the CSE automatically using a shell script:

Restart CSE with Bash Shell
while true; do
    python -m acme
    if [ $? -ne 82 ]; then
        break
    fi
done
Restart CSE with Fish Shell
while true
    python -m acme
    if test $status -ne 82
        break
    end
end