Adding Components
This API aids in adding new components to the eG Enterprise.
Note:
A few key values of the Body parameter are optional. These optional key values are mentioned separately in the below table.
URL: http://<eG manager IP:port>/api/eg/orchestration/addcomponent
Method: POST
Content-Type: application/json
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 |
Example containing both Default and Optional key values: { "hostip":"192.168.10.175", "componenttype":"Oracle Database", "componentname":"ora8", "port":"1521" , "sid":"egoracle", "ispassive":"no", "externalagents":"agent1" } Example containing both Default and Optional key values: { "hostip":"192.168.10.175", "componenttype":"Oracle Database", "componentname":"ora8", "port":"1521" , "sid":"egoracle", "ispassive":"no", "externalagents":"agent1" } |
Body |
Default: { "hostip":"IP address of the component", "componenttype":"ComponentType", "componentname":"nick name of the component", "port":"port at which the component listens" } |
|
Optional: { "sid":"comma-separated list of SIDs", "'externalagents":"comma-separated list of external agents assigned to the server", "agentless":"yes/no", "os":"Operating System of the server", "mode":"Mode using which metrics are collected", "encrypttype":"Password/Keybased", "keyfilename":"Key file name", "remoteagent":"The remote agent that monitors the target", "remoteport":"the port at which Rexec/SSH listens", "remoteuser":"Valid user name on the target", "remotepwd":"A valid password", "internalagentassignment":"yes/no", "internalagent":"IP address/nick name of the internal agent", "mtsenabled":"yes/no", "virtualenv":"yes/no", "virtualserver":"Virtual server name", "ispassive":"yes/no" } |
Type | Code | Content |
---|---|---|
JSON |
200 |
{ "Succeed": "Component has been added successfully." } |
Type | Code | Content |
---|---|---|
JSON |
401 |
{ "Error": "Component already exist under this type." } |
{ "Error": "Cannot add agent based component for this component type." } |
Figure 1 : Example to add components using Postman REST Client
Adding Components using cURL
To add components 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/addcomponent" -H "managerurl:http://<eG Manager IP:Port>" -H "user:<eG username or domain/eG username>" -H "pwd:Base64 encoded password" -H "Content-Type: application/json" --data-raw "{'componenttype': 'ComponentType', 'hostip': 'IP address of the component', 'componentname': 'nick name of the component', 'port': 'port at which the component listens', 'agentless': 'yes/no', 'remoteagent': 'The remote agent that monitors the target', 'mode': 'Mode using which metrics are collected', 'sid': 'comma-separated list of SIDs', 'externalagents': 'comma-separated list of external agents assigned to the server', 'os': 'Operating System of the server', 'encrypttype': 'Password/Keybased', 'remoteuser': 'Valid user name on the target', 'remoteport': 'the port at which Rexec/SSH listens', 'remotepwd': 'A valid password', 'internalagentassignment': 'yes/no', 'internalagent': 'IP address/nick name of the internal agent', 'mtsenabled': 'yes/no', 'virtualenv': 'yes/no', 'virtualserver': 'Virtual server name', 'ispassive':'yes/no'}"
Note that the command specified above contains both the Default and Optional key values. Figure 2 shows an example of adding components using cURL.