Starting, restarting and stopping the Eclipse Amlen server by using REST Administration APIs

System administrators can restart and stop the Eclipse Amlen server by using REST Administration APIs.

You can restart and stop the server by using REST Administration APIs or by using the Amlen WebUI. For more information about using the Amlen WebUI to restart and stop the server, see Restarting, stopping, and viewing the status of the Eclipse Amlen server by using the Amlen WebUI. You can start the server by using docker or systemctl commands.
  1. Check the status of the Eclipse Amlen server, by using the Eclipse Amlen REST API GET method with the following Eclipse Amlen service URI:

    http://<admin-endpoint-IP:port>/ima/v1/service/status

    • If the server status is Running, the server is running. You can restart or stop the server by using REST Administration APIs.
    • If the server status is Maintenance, the server is in maintenance mode. For more information about maintenance mode, see Maintenance mode.
    Note: If the server is not running, a failure to connect error is received in response to the REST call. You can start the server by using docker or systemctl commands.
  2. Choose an appropriate action:
    • To start the server in a Docker environment, use the following command:

      docker start <container name>

    • To start the server on a Host OS, use the following command:

      systemctl start imaserver

    • To restart the server use the Eclipse Amlen REST API POST method with the following Eclipse Amlen service URI:

      http://<admin-endpoint-IP:port>/ima/v1/service/restart

      • To restart the server in maintenance mode, provide configuration data in the payload of the POST method by using the following schema:
        
        {    
          "Service": "Server", 
              "Maintenance": "start"|"stop"
        }
        Where:
        Maintenance: "start"|"stop"
        Optional.
        If this option is set to start, the server comes up in maintenance mode on restart. If set to stop, the server comes up in production mode on restart.
      • To restart the server and to specify whether the store is cleaned as part of the shutdown process, provide configuration data in the payload of the POST method by using the following schema:
        
        {    
          "Service": "Server", 
              "CleanStore": true|false
        }
        Where:
        CleanStore: true|false
        Optional.
        If this option is set to true, then the store is cleaned as part of the shutdown process. The server does not need to be in maintenance mode for the store to be cleaned.
        Note: You cannot clean the store of an Eclipse Amlen server that is a member of a cluster.
    • To stop the server, use the Eclipse Amlen REST API POST method with the following Eclipse Amlen service URI:

      http://<admin-endpoint-IP:port>/ima/v1/service/stop

The following example uses cURL to show how a GET method is used to view the status of the server:
curl -X GET http://127.0.0.1:9089/ima/v1/service/status
The following example shows a successful example response to the GET method used to view the status of the server:

{
  "Version":"v1",
  "Server": {
    "Name": "TestSystem:9089",
    "UID": "aFWxYf32",
    "Status": "Running",
    "State": 1,
    "StateDescription": "Running (production)",
    "ServerTime": "2016-03-04T14:46:53.081Z",
    "UpTimeSeconds": 4134,
    "UpTimeDescription": "0 days 1 hours 8 minutes 54 seconds",
    "Version": "2.0 20160304-0400",
    "ErrorCode": 0,
    "ErrorMessage": ""
  },
  "Container": {
    "UUID":"034c91ce828a4f5c2c21d7cd7f04628368b63bd308825ec2d9dab5096ff04ca0"
  },
  "HighAvailability": {
    "Status": "Inactive",
    "Enabled": false
  },
  "Cluster": {
    "Status": "Inactive",
    "Enabled": false
  },
  "Plugin": {
    "Status": "Inactive",
    "Enabled": false
  },
  "MQConnectivity": {
    "Status": "Active",
    "Enabled": true
  },
  "SNMP": {
    "Status": "Active",
    "Enabled": true
  }
}

The following example uses cURL to show how a POST method is used to restart the server in production mode without cleaning the store:

curl -X POST \
   -H  'Content-Type: application/json'  \
   -d  '{                       
         "Service": "Server",       
           "CleanStore": false
        }
  '   \
http://127.0.0.1:9089/ima/v1/service/restart
An example response to the POST method:
{           
          "Version": "v1",   
            "Code": "CWLNA6011",   
            "Message": "The requested configuration change has completed successfully ."
          }
The following example uses cURL to show how a POST method is used to stop the server:

curl -X POST \
   -H  'Content-Type: application/json'  \
   -d  '{                       
         "Service": "Server" 
        }
  '   \
http://127.0.0.1:9089/ima/v1/service/stop
An example response to the POST method:
{           
          "Version": "v1",   
            "Code": "CWLNA6011",   
            "Message": "The requested configuration change has completed successfully ."
          }