Changing the server state by using REST Administration APIs

System administrators can change the server state from Maintenance to Running, or from Running to Maintenance, by using REST Administration APIs.

About this task

For more information about maintenance mode, see Maintenance mode.

You change the server state from Maintenance to Running, or from Running to Maintenance, by using REST Administration APIs, or by using the IBM IoT MessageSight Web UI. For more information about using the IBM IoT MessageSight Web UI to change the server state, see Changing the server state by using the IBM IoT MessageSight Web UI.

Procedure

  1. Check the current server state by using the IBM IoT MessageSight REST API POST method with the following IBM IoT MessageSight configuration URI:

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

    • If the server status is Running, the server is running in production mode.
    • 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. Optional: If the server state is Stopped, you must start the server before you can continue. For more information about starting the server, see Starting, restarting and stopping the IBM IoT MessageSight server by using REST Administration APIs
  3. Set the server state to Maintenance or Running as required:
    • Set the server state to Maintenance by using IBM IoT MessageSight REST API POST method with the following IBM IoT MessageSight configuration URI:

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

      and provide configuration data in the payload of the POST method by using the following schema:
      
      {    
        "Service": "Server",
            "Maintenance": "start"
      }
      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.
    • Set the server state to Running by using IBM IoT MessageSight REST API POST method with the following IBM IoT MessageSight configuration URI:

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

      and provide configuration data in the payload of the POST method by using the following schema:
      
      {    
        "Service": "Server",
            "Maintenance": "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.