Working with Agents in the AE REST API
You can create a new Agent or download a pre-configured Agent using the AE REST API.
This page includes the following:
Creating a New Agent Object
When you create a new Agent, you need to define all the pages relevant for the Agent object.
Request: POST https://{host}:{port}/ae/api/v1/{client}/system/agents
You can use a POST request to create a new Agent object. The POST request sends the name of the Agent and the template that is used to create it. The template name has to be defined in the UC_OBJECT_TEMPLATE variable.
Example
{ "name": "WIN01", "template": "<WIN>" }
After the request is sent, the response has the status 200 OK and the new Agent object is available in the Agents list in the Client called in the request.
Note: To use this functionality, you have to be a User in the Client in which you want to create the Agent object and you must have the right to access the Administration perspective.
More information:
Downloading Pre-Configured Agents
When you download a pre-configured Agent, you do not have to make any additional definitions, as the Agent object is pre-configured.
Request: POST https://{host}:{port}/ae/api/v1/{client}/system/agentpacks
You can use a POST request to download a pre-configured agent. After the request is sent, the response has the status 201 Created and includes the agent.zip file. The zip file includes a bin folder, which contains the respective .jar and .ini files. The latest version of the agent is downloaded.
You can also use this functionality to change any parameters and/or to add a ServiceManager.
Example
{ "platform": "SQL", "name": "TEST09", "config_update" : "[GLOBAL]\nname=TEST08", "service_manager" : { "operating_system" : "Windows", "operating_system_architecture" : "x64", "config_update" : "[GLOBAL]\nport=8873" } }
The relevant parameters of the INI file are populated accordingly. The name parameter is optional. However, if both parameters, name and config_update, are defined, the definition of the name parameter is used.
UNIX (Linux) Agents
You must set the SSL_CERT_DIR and SSL_CERT_FILE environment variables with the User which will start the Agent.
These variables allow you to load the certificates from the SSL store. The certificates can be stored either in one file per certificate or all certificates in one .pem file :
-
SSL_CERT_DIR location of the trusted CA certificates with each certificate in a separate file, for example,/etc/ssl/certs/
-
SSL_CERT_FILE location of the .pem file with all the trusted CA certificates, for example, /etc/pki/tls/certs/ca-bundle.crt
Using Scripts
You can use scripts to easily create, download and extract agent packs, as well as start agents running on a Windows or UNIX system.
We have gathered a number of deployment script examples for SQL, REST, Windows, and UNIX agents. They allow you to deploy and start the agents without having to create your own script. You can also merge separate scripts used in the examples into one large script.
More information:
See also: