Server management over HTTP

Normally the command line tool emgclient is used to examine connectors more closely, pausing them, and more. The command uses MGP to communicate with emgd, using the information in the client.cfg file. The same commands are used by EMG Portal.

As of EMG 7.2.12, there is now a new way of performing these operations, based on JSON over HTTP. This provides a more portable API for third party systems.

First, please define an incoming HTTP connector, and set the option XAUTH. You can use both USERS and USERDB, as long as there is a user with the role ADMIN. The authorization is done using Basic Auth. The client can then make HTTP requests to the following end points.

  • /admin/info – Return the licensing information, basically the same information as printed by “emgd -v”.
  • /admin/info/reload – Reload the emgd configuration, the same operation as running “emgd -reload”.
  • /admin/connectors – Return the list of enabled connectors.
  • /admin/queue/aConnectorName – Return the first 10 entries in the queue for the specified connector.
  • /admin/connector/aConnectorName/hold – Pause outgoing traffic for the specified connector.
  • /admin/connector/aConnectorName/unhold – Resume outgoing traffic for the specified connector.
  • /admin/connector/aConnectorName/forceclose/aParameter – When aParameter is 1 all instances of the given connector is forced to close, and when it is 0, the connector instances are allowed to connect again.
  • /admin/connector/aConnectorName/bounce – Force all connector instances to close, and then immediately afterwards allow them to reconnect again.
  • /admin/connector/aConnectorName/clear – Remove all messages in the queue on the specified connector.
  • /admin/connector/aConnectorName/moveall/anotherConnectorName – Move all messages in the queue to another connector.