Deleting External 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
ExternalAgent,delete
agentname
<Nickname of external agent1>
<Nickname of external agent2>
<Nickname of external agent3>
.
.
.

For instance:

Element,action
ExternalAgent,delete
agentname
ext8
ext10
ext12

Once the CSV file (let's say, the name of the file is deleteexternalagent.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/deleteexternalagent/bulk

Method: POST

Content-Type: multipart/form-data

Inputs to be Specified
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:\deleteexternalagent.csv

}

Body

Default:

{

"file" : "Full path to the CSV file"

}

 

Success Response
Type Code Content

JSON

200

{

"Succeed": "External agent has been deleted successfully."

}

 

Failure Response
Type Code Content

JSON

401 UNAUTHORIZED

{

"Error": "Following external agent(s) could not be deleted.",

"Description": [

"The external agent you are trying to delete does not exist. Agent name :<name of the external agent>",

"The external agent you are trying to delete does not exist. Agent name :<name of the external agent>"

]

}

Figure 1 : Example to delete external agents in bulk using Postman REST Client

Deleting External Agents in Bulk using cURL

To delete external 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/deleteexternalagent/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 external agents in bulk using cURL.

Figure 2 : Deleting external agents in bulk using cURL