Configuring the licensed usage for Eclipse Amlen and accepting the license by using REST Administration APIs

System administrators can change the configured licensed usage for Eclipse Amlen and accept the license by using a single REST Administration API.

You can set the licensed usage of your Eclipse Amlen and accept the license by using a single REST Administration API. The Eclipse Amlen server will start in maintenance mode until the license is accepted.
  • To set the licensed usage of Eclipse Amlen and accept the license, use the Eclipse Amlen REST API POST method.
    1. Use the following Eclipse Amlen 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:
      
      {  
       "LicensedUsage": "LicenseType",       
       "Accept": true              
      }
      
      Where:
      • LicenseType
        Specifies the licensed usage. Specify one of:
        Developers
        For use in a development and test environment.
        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.
      • Accept: true|false
        Specifies the acceptance of the licensed usage.
        To accept the license, set Accept to true.
        Once the license is accepted, it cannot be unaccepted by setting the value to false.
      Note: When server is started for the first time, the LicensedUsage is set to Developers. The server will start 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": "Eclipse Amlen is not fully functional until you accept the license agreement using Eclipse Amlen REST API."
        }
      }

      For more information about viewing server status, see Show the status of an Eclipse Amlen 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.

The following example shows setting Eclipse Amlen 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 Eclipse Amlen 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."
}
Check the server status to verify that the Eclipse Amlen 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 Eclipse Amlen server manually by using REST Administration APIs. For more information about restarting Eclipse Amlen, see Restart the Eclipse Amlen server.