Modifying Components in Bulk

As already mentioned, an exclusive CSV file should be created to handle bulk modifications to component details.

Entries in this file should be of the following format:

Element,action
Component,modify
componenttype,hostip/hostname,componentname,port,externalagents
<Modification to component1>
<Modification to component2>
.
.
.

For example, if you want to modify the port numbers of 2 IIS web servers, do the following:

Element,action
Component,modify componenttype,hostip,componentname,oldport,Newport,mtsenabled,externalagents
IIS web,192.168.10.96,iis96,7077,8088,no,ext43
IIS web,192.168.10.173,iis173,7077,7078,no,ext173

The CSV file can also be used to modify the details of components of multiple types at one shot. While doing so, make sure that you leave the columns not applicable for a component specification, blank. At the same time, ensure that the column names you specify in the CSV file are a super-set of the parameters supported by all the components that are being modified. In other words, the column names provided in the CSV file should correspond to the following:

  • the parameters that are common across all the components to be modified, and;
  • the parameters that are distinct/unique for each of the components being modified;

For instance, say you want to modify the nick name of an Oracle database server, and want to change the monitoring mode of an MS SQL server from agent-based to agentless. The specification in this case will be, as follows:

Element,action
Component,modify
componenttype,hostip,componentname,oldcomponentname, newcomponentname,port,sid,agentless,mode,os,externalagents,remoteagent
Oracle database,192.168.10.8,,ora8,ora08,1521,egora,,,,ext125,
Microsoft SQL,192.168.10.63, sql63,,,1433,,yes,perfmon,Windows2012,ext173,rem12

In the above specification, you can find that the column list includes the following:

  • parameters such as componenttype, hostip/hostname, port, and externalagents that are common to both the Oracle and MS SQL servers
  • the oldcomponentname, newcomponentname, and sid parameter that are available only for the Oracle component
  • the componentname, agentless, mode, OS, and remoteagent parameters that are relevant for only the MS SQL server being modified

From the above specification, it is also evident that columns not applicable to a component specification have been left blank.

If say, you want to add multiple SIDs to an Oracle database server, your specification should be as follows:

Element,action
Component,modify
componenttype,hostip,componentname,port,sid,externalagents
Oracle database,192.168.10.8,ora08,1521,"egora,egoracle",ext125

Note:

If an Oracle database server with multiple SIDs is added to the eG Enterprise system, then each SID will be registered as a separate Oracle database server in the eG Enterprise system.

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

Method: POST

Content-Type: multipart/form-data

Inputs to be Specified
Parameters Key values Example

Header

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:\modifycomponent.csv

}

Body

Default:

{

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

}

 

Success Response
Type Code Content

JSON

200

{

"Succeed": "Component has been modified successfully."

}

 

Failure Response
Type Code Content

JSON

401 UNAUTHORIZED

{

"Error": "Following component(s) could not be modifed.",

"Description": [

"The old component name or port does not exist. Component type :<Component Type>,Component name :<Component name>",

"The old component name or port does not exist. Component type :<Component Type>,Component name :<Component name>",

]

}

Modifying Components in Bulk Using Postman REST Client

Figure 1 : Modifying Components in bulk using Postman REST Client

Modifying Components in Bulk using cURL

To modify components 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/modifycomponent/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 modifying components in bulk using cURL.

Modifying Components in Bulk Using cURL

Figure 2 : Modifying Components in bulk using cURL