Managing Components in Bulk
To manage components in bulk, you can create a dedicated CSV file for this purpose and configure it with entries related to each component to be managed. Given below is the format of the entries in such a file:
Element,action
Component,manage
componenttype,componentname,port,sid
<Component1 to be managed>
<Component2 to be managed>
.
.
.
For instance:
Element,action
Component,manage
componenttype,componentname,port,sid
Microsoft Windows,win1,,
AGate,agte10,3900,
Oracle Database,ora55,1521,multi
Note that the column names used in the CSV file are the same as the input parameters of the ‘ManageComponent’ command supported by the eG REST API.
Note:
- If an Oracle database server with multiple SIDs is to be managed, then the entry for the Oracle server in your CSV file should not include a comma-separated list of SIDs; instead, you should provide a separate entry for each SID to be managed.
- If one/more column names in your CSV file are not applicable to a component specification, then make sure that such columns are left empty in the specification.
Once the CSV file (let's say, the name of the file is managecomponent.csv) is created on the eG manager, invoke the URL command mentioned in the below table 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/managecomponent/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:\managecomponent.csv } |
Body |
Default: { "file" : "Full path to the CSV file" } |
Type | Code | Content |
---|---|---|
JSON |
200 |
{ "Succeed": "Component has been managed successfully." } |
Type | Code | Content |
---|---|---|
JSON |
401 UNAUTHORIZED |
{ "Error": "Following component(s) could not be managed.", "Description": [ "The selected component does not exist. Component type :<Component TYpe>,Component name :<hostname of the component>", ] } |
Figure 1 : Managing components in bulk using cURL
Managing Components in Bulk using cURL
To manage components s 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/managecomponent/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 managing components in bulk using cURL.