Configuring the server name by using REST Administration APIs

System administrators can set and view the configured name of a server by using REST Administration APIs.

You can configure a server name by using a REST Administration API, or by using the Amlen WebUI. For more information about using the Amlen WebUI to configure a server name, see Configuring the server name by using the Amlen WebUI.

If the Eclipse Amlen server is an active cluster member, do not change ServerName.

  • To set the server name, use the Eclipse Amlen REST API POST method.
    1. Use the following Eclipse Amlen configuration URI:

      http://<admin-endpoint-IP:Port>/ima/configuration

    2. Provide ServerName object configuration data in the payload of the POST method by using the following schema. Content-type is set to application/json.
      
      {    
        "ServerName": "string",
        "Version": "v1"
      }
      Where:
      • ServerName
        Specifies the server name.
        The maximum length of the name is 64 characters.
        Names can contain characters in the ranges a-z, A-Z, 0-9 and the special character - only.
        The default value of ServerName is a string that has the following format: <server_node_name>:<admin-endpoint-port>. This default value does not change when the admin-endpoint port is changed.
  • To view the server name, use the Eclipse Amlen REST API GET method with the following Eclipse Amlen configuration URI:

    http://<admin-endpoint-IP:Port>/ima/configuration/ServerName

The following example shows a POST method to set the server name to "myServer.TestSystem" by using cURL:


curl -X POST \
   -H  'Content-Type: application/json'  \
   -d  '{                       
           "ServerName":"myServer.TestSystem:9089"
        }
       '   \
http://127.0.0.1:9089/ima/v1/configuration/

The following example shows an example response to the POST method:


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

The following example shows a GET method to view the server name by using cURL:


curl -X GET http://127.0.0.1:9089/ima/v1/configuration/ServerName

The following example shows an example response to the GET method:


{
  "ServerName": "myServer.TestSystem:9089",
  "Version": "v1"
}

The following example shows a POST method to set the server name to the default value by using cURL:


curl -X POST \
   -H  'Content-Type: application/json'  \
   -d  '{                       
           "ServerName": null
        }
       '   \
http://127.0.0.1:9089/ima/v1/configuration/

The following example shows an example response to the GET method:


{
  "ServerName": "ServerA.mycompany.com:9089",
  "Version": "v1"
}