Operation - CSE Management API
If enabled, the CSE provides a management API that allows to retrieve configuration and status information, stream logs and requests as well as to reset, shutdown and restart the CSE. This API is intended for operational tasks and monitoring of the CSE.
Management commands can be sent to the CSE via HTTP requests.
Enabling CSE Management
The CSE management API is disabled by default. To enable it, set the enableManagementEndpoint setting in the configuration file to 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. Also, initiate a manual registration refresh. |
requests | Stream a live output of the current requests of the CSE in JSON format as well as enable, disable and get the status of request recording. |
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
This will return the current configuration of the CSE in JSON format.
Get the CSE's Log Output
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.
Get the CSE's Log Level
Set the CSE's Log Level
Shutdown the CSE
Restart the CSE
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: