Using the admin endpoints

The reload endpoints support the POST method, which you must call through a command-line tool such as postman or curl. The endpoint requires authentication, which means that you must log in to the server as an administrator and retrieve a cookie before you can POST to reload.

Before you begin

To use the admin endpoints, you must log in as a user that has the administrator permission. To provide a user with the i2:Administrator permission, use command access control to specify the user group to give access to the administrator role. For more information, see Configuring command access control.

About this task

The following steps demonstrate how to use curl to POST to the admin endpoints.

You can find the REST API reference documentation at the following URL on the i2 Analyze server: http://host_name/conext_root/doc. For example, http://localhost/opal/doc.

Procedure

  1. If the curl utility is not available on your server, download it from the project website at https://curl.haxx.se/download.html.
  2. Open a command prompt and use curl to log in to the i2 Analyze server and retrieve an authorization cookie:
    curl -i --cookie-jar cookie.txt
         -d j_username=user_name
         -d j_password=password
         http://host_name/conext_root/j_security_check
    This command connects to the specified i2 Analyze server as the specified user, retrieves the authentication cookie, and saves it to a local file named cookie.txt. The LTPA token in the cookie is valid for 2 hours.
    When the command completes, the response from the request is displayed. If the retrieval is successful, the first line of the response is:
    HTTP/1.1 302 Found
After you retrieve and save the cookie, you can POST to the admin endpoints. When you POST to the admin endpoints, include the cookie file that you received when you logged in.
  1. The following command is an example of a POST to the admin endpoint to reload the live configuration:
    curl -i --cookie cookie.txt
         -X POST 
         http://host_name/conext_root/api/v1/admin/config/reload
    When the command completes, the response from the request is displayed. If the retrieval is successful, the first line of the response is:
    HTTP/1.1 200 OK
    If you see the HTTP/1.1 403 Forbidden response code, the user for which you retrieved the token does not have the command access control administrator permission, or the token has expired:
    • If your token has expired, you can get a new one by running the command in step 2 again.
    • If your user does not the command access control i2:Administrator permission, see Configuring command access control to provide the user with the permission.
    Warning: The reload method updates the configuration without requiring a server restart, but any logged-in users are logged out from i2 Analyze when you run it.