Deleting Remote Agents in Bulk
The CSV file that is specifically created for deleting a number of remote agents in bulk, should contain the following entries:
Element,action
RemoteAgent,delete
agentname
<Nickname of remote agent1>
<Nickname of remote agent2>
<Nickname of remote agent3>
.
.
.
For instance:
Element,action
RemoteAgent,delete
agentname
rem8
rem10
external12
Once the CSV file (let's say, the name of the file is deleteremagent.csv) is created on the eG manager, invoke the URL command mentioned below from the eG REST API Client to update the eG manager with all the modifications contained in the CSV file.
URL: http://<eG manager IP:port>/api/eg/orchestration/deleterremoteagent/bulk
Method: POST
Content-Type: multipart/form-data
Parameters | Key values | Example |
---|---|---|
Headers |
managerurl: Base URL of the eG Manager i.e., http://<IP address of the eG console:Port> user: eG username or domain/eG username pwd: Base64 encoded password |
{ "file": G:\deleteremagent.csv } |
Body |
Default: { "file" : "Full path to the CSV file" } |
Type | Code | Content |
---|---|---|
JSON |
200 |
{ "Succeed": "Remote agent has been deleted successfully." } |
Type | Code | Content |
---|---|---|
JSON |
401 UNAUTHORIZED |
{ "Error": "Following remote agent(s) could not be deleted.", "Description": [ "The remote agent you are trying to delete does not exist. Agent name :<name of the remote agent>", "The remote agent you are trying to delete does not exist. Agent name :<name of the remote agent>" ] } |
Figure 1 : Deleting remote agents in bulk using Postman REST Client
Deleting Remote Agents in Bulk using cURL
To delete remote agents in bulk through the REST API using cURL, the command should be specified in the following format:
curl --location --request POST "http://<eG Manager IP:Port>/api/eg/orchestration/deleteremoteagent/bulk" -H "managerurl:http://<eG Manager IP:Port>" -H "user:<eG username or domain/eG username>" -H "pwd:Base64 encoded password" -H "Content-Type: multipart/form-data" --form "file=@ Full path to the CSV file"
Figure 2 shows an example of deleting remote agents in bulk using cURL.