AE REST API - Working with Agents

You can download a pre-configured agent and create a new Agent object. This function is available for WIN, UNIX, SQL and REST.

Prerequisite! The Packs required for a Centralized Agent Upgrade (CAU) must be installed before you can download an Agent from the Administration perspective. You can download the CAU packs from https://marketplace.automic.com/. Once you have downloaded them, you have to install them in Client 0. You can do so from the Packs page in the Administration perspective. For more information, see Centralized Agent Upgrade (CAU).

Important! This version of Automic Automation includes two versions of the x64 Linux and Windows Agents: one OS native and one Java-based Agent. Therefore, there are two different CAU packs available for download. The respective pack name distinguishes them clearly. Make sure you download the correct one to avoid any issues.

Creating a New 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.

To use this functionality, the system must know where to reach the corresponding JCP and REST endpoints. You can configure them using the JCP_ENDPOINT and REST_ENDPOINT parameters in the UC_SYSTEM_SETTINGS variable.

More information:

Downloading Pre-Configured Agents

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 TLS/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

Important! There is no differentiation between OS and Java-based x64 Linux and Windows Agents. Which version of the Agent is downloaded depends on the CAU pack that you downloaded.

More information:

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: