Configuring the licensed usage for IBM Watson IoT Platform - Message Gateway and accepting the license by using REST Administration APIs

System administrators can change the configured licensed usage for IBM® Watson IoT Platform - Message Gateway and accept the license by using a single REST Administration API.

About this task

You can set the licensed usage of your IBM Watson IoT Platform - Message Gateway and accept the license by using a single REST Administration API. The IBM Watson IoT Platform - Message Gateway server will start in maintenance mode until the license is accepted.

The license information is available in the /opt/ibm/imaserver/http/license directory for the Production, Non-Production, and IdleStandby license types, and in the /opt/ibm/imaserver/http/license/developer directory for the Developers license type. The license files are named LA_langcode.html where langcode is a two-character language code, for example, LA_en.html.

Procedure

  • To set the licensed usage of IBM Watson IoT Platform - Message Gateway and accept the license, use the IBM Watson IoT Platform - Message Gateway REST API POST method.
    1. Use the following IBM Watson IoT Platform - Message Gateway configuration URI:

      curl -X POST http://<admin-endpoint-IP:Port>/ima/v1/configuration

    2. Provide object configuration data in the payload of the POST method by using the following schema. Set the required license usage as the value of the LicensedUsage property, and set the value of the Accept property to true to accept the license. For more information about the different license usages, see the license files in the /opt/ibm/imaserver/http/license and the /opt/ibm/imaserver/http/license/developer directories.
      
      {  
       "LicensedUsage": "LicenseType",       
       "Accept": true              
      }
      
      • Replace LicenseType with one of the following licensed usage values:
        Developers
        For non-production development and testing on a single-user developer machine.
        Non-Production
        For use in a development and test environment.
        Production
        For use in a production environment.
        IdleStandby
        For use in a high availability environment.
      • After the license is accepted, it cannot be unaccepted by setting the value of the Accept property to false.
      Note: When the server is started for the first time, the LicensedUsage property value is set to Developers. The server starts in maintenance mode.
      You can view the server status by using the following REST API GET method:
      curl -X GET http://127.0.0.1:9089/ima/v1/service/status/Server
      The server status shows:
       
      {
        "Version":"v1",
        "Server": {
          "Name": "RDDockDev1:9089",
          "UID": "poHdWvCE",
          "Status": "Running",
          "State": 9,
          "StateDescription": "Running (maintenance)",
          "ServerTime": "2016-04-12T19:01:23.512Z",
          "UpTimeSeconds": 27,
          "UpTimeDescription": "0 days 0 hours 0 minutes 27 seconds",
          "Version": "2.0 20160610-0700",
          "ErrorCode": 387,
          "ErrorMessage": "IBM MessageSight is not fully functional until you accept
           the license agreement using IBM IoT MessageSight REST API."
        }
      }

      For more information about viewing server status, see Show the status of an IBM Watson IoT Platform - Message Gateway server and services

  • View the value of the current license type by using the following REST API GET method:
    curl -X GET http://127.0.0.1:9089/ima/v1/configuration/LicensedUsage

    An example response to the GET method:

    
    {
      "Version":"v1",
      "LicensedUsage": "Developers",
      "Accept": false
    }
  • Accept the current license, or change the value of the current licensed usage and accept the new license type.
    • If the value that is set for LicensedUsage is correct, you can accept the license by using the following REST API POST method:
      
      curl -X POST \
         -H  'Content-Type: application/json'  \
         -d  '{
               "Accept": true 
              }
          '   \
      http://127.0.0.1:9089/ima/v1/configuration
      

      The server automatically restarts in production mode, using the current license that is specified.

    • If the value that is set for LicensedUsage is not correct, you can change the license type and accept the updated license by using the following REST API POST method:
      
      curl -X POST \
         -H  'Content-Type: application/json'  \
         -d  '{
               "LicensedUsage":"Production"|"Non-Production"|"IdleStandby|"Developers",
               "Accept": true 
              }
          '   \
      http://127.0.0.1:9089/ima/v1/configuration
      

      The server to automatically restarts in production mode, using the license that is specified.

Example

The following example shows setting IBM Watson IoT Platform - Message Gateway licensed usage to Non-Production without accepting the license:

curl -X POST \
   -H  'Content-Type: application/json'  \
   -d  '{
         "LicensedUsage": "Non-Production"
        }
    '   \
http://127.0.0.1:9089/ima/v1/configuration
An example response to the POST method:

{        
  "Version": "v1",
  "Code": "CWLNA6011",
  "Message": "The requested configuration change has completed successfully."
}
As the license is not accepted, when you view the server status by using the REST API GET method:
curl -X GET http://127.0.0.1:9089/ima/v1/service/status/Server
The server status shows:
 
{
  "Version":"v1",
  "Server": {
    "Name": "RDDockDev1:9089",
    "UID": "poHdWvCE",
    "Status": "Running",
    "State": 9,
    "StateDescription": "Running (maintenance)",
    "ServerTime": "2016-04-12T19:01:23.512Z",
    "UpTimeSeconds": 27,
    "UpTimeDescription": "0 days 0 hours 0 minutes 27 seconds",
    "Version": "2.0 20160610-0700",
    "ErrorCode": 387,
    "ErrorMessage": "IBM MessageSight is not fully functional until you accept the license agreement using IBM IoT MessageSight REST API."
  }
}
The following example shows setting IBM Watson IoT Platform - Message Gateway licensed usage to Non-Production and accepting the license by using cURL:

curl -X POST \
   -H  'Content-Type: application/json'  \
   -d  '{
         "LicensedUsage": "Non-Production",
         "Accept": true 
        }
    '   \
http://127.0.0.1:9089/ima/v1/configuration
An example response to the POST method:

{        
  "Version": "v1",
  "Code": "CWLNA6011",
  "Message": "The requested configuration change has completed successfully."
}

What to do next

Check the server status to verify that the IBM Watson IoT Platform - Message Gateway server has successfully restarted. It might take a few seconds for the server to stop and restart. You can view the server status by using the following REST API GET method:
curl -X GET http://127.0.0.1:9089/ima/v1/service/status/Server
The server status shows:

{
  "Version":"v1",
  "Server": {
    "Name": "RDDockDev1:9089",
    "UID": "poHdWvCE",
    "Status": "Running",
    "State": 1,
    "StateDescription": "Running (production)",
    "ServerTime": "2016-04-27T15:59:51.491-05:00",
    "UpTimeSeconds": 27,
    "UpTimeDescription": "0 days 0 hours 0 minutes 27 seconds",
    "Version": "2.0 20160610-0700",
    "ErrorCode": 0,
    "ErrorMessage": ""
  }
}
View the value of the current license type by using the following REST API GET method:
curl -X GET http://127.0.0.1:9089/ima/v1/configuration/LicensedUsage
An example response to the GET method:
{
  "Version":"v1",
  "LicensedUsage": "Non-Production",
  "Accept": true
}

You can restart the IBM Watson IoT Platform - Message Gateway server manually by using REST Administration APIs. For more information about restarting IBM Watson IoT Platform - Message Gateway, see Restart the IBM Watson IoT Platform - Message Gateway server.