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.
i2:Administratorpermission, use command access control to specify the user group to give access to the administrator role. For more information, see Configuring command access control.
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
- If the curl utility is not available on your server, download it from the project website at https://curl.haxx.se/download.html.
- Open a command prompt and use curl to log in to the i2 Analyze server and retrieve an authorization cookie:
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.
curl -i --cookie-jar cookie.txt -d j_username=user_name -d j_password=password http://host_name/conext_root/j_security_checkWhen 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.
- The following command is an example of a POST to the admin endpoint to reload the live configuration:
When the command completes, the response from the request is displayed. If the retrieval is successful, the first line of the response is:
curl -i --cookie cookie.txt -X POST http://host_name/conext_root/api/v1/admin/config/reload
HTTP/1.1 200 OKIf you see the
HTTP/1.1 403 Forbiddenresponse 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:Administratorpermission, see Configuring command access control to provide the user with the permission.
reloadmethod updates the configuration without requiring a server restart, but any logged-in users are logged out from i2 Analyze when you run it.