Would someone provide an example of the following rest calls:
1. Creating a node
2. Adding a monitoring template
Hi,
Node Create ::
1) using curl : Execute the below mentioned command and provide the node properties in CreateNode.txt file as in the example provided below. Here Guid needs to be unique.
curl -k -u admin: -X POST -H "Content-Type: application/json" https://localhost:17778/SolarWinds/InformationService/v3/Json/Create/Orion.
Nodes -d @CreateNode.txt
CreateNode.txt content
{"EntityType":"Orion.Nodes", "IPAddress":"10.10.10.1", "IPAddressGUID":"044648a4-0000-0000-0000-000000000000","Caption":"","DynamicIP":"false","EngineID":"1", "Status":"1", "UnManaged":"false", "Allow64BitCounters":"false", "SysObjectID":"", "MachineType":"", "VendorIcon":"", "ObjectSubType":"SNMP", "SNMPVersion":"2", "Community":"public", "RediscoveryInterval":"5", "PollInterval":"120", "StatCollection":"10"}
2) Using Powershell :
One of the users have come up with this Powershell script which makes rest call to create node.
Regarding adding monitoring template, Do you mean creating a new monitoring template or assigning it?
To be spesific,
I need to assign a monitoring template to a node.
The way the api seems to work it looks like I add the node to the monitoring template via a put?
Step 1 : Get NodeID for which application template needs to be assigned
curl -k -u admin: -X POST -H "Content-Type: application/json" https://localhost:17778/SolarWinds/InformationService/v3/Json/Query -d @GetNodeID.txt
Content of GetNodeID.txt
@{"query":"SELECT NodeID FROM Orion.Nodes WHERE IPAddress=@p","parameters":{"p":"Your Node IP"}}
Step 2 : Get Application Template ID for the application which needs to be assigned
curl -k -u admin: -X POST -H "Content-Type: application/json" https://localhost:17778/SolarWinds/InformationService/v3/Json/Query -d @GetAppTemplateID.txt
Content of GetAppTemplateID.txt
@{"query":"SELECT ApplicationTemplateID FROM Orion.APM.ApplicationTemplate WHERE Name=@template","parameters":{"template":"Your Application Template"}}
Step 3 : Get the credential ID of the credentials set
curl -k -u admin: -X POST -H "Content-Type: application/json" https://localhost:17778/SolarWinds/InformationService/v3/Json/Query -d @GetCredentialID.txt
Content of GetCredentialID.txt
@{"query":"SELECT ID FROM Orion.Credential WHERE CredentialOwner='APM' AND Name=@credential","parameters":{"credential":"Your APM Credential Name"}}
Step 4 : Create application
curl -k -u admin: -X POST -H "Content-Type: application/json" https://localhost:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.APM.Application/CreateApplication -d @CreateApplication.txt
Content of CreateApplication.txt
--Dummy example. Replace with NodeId, ApplicationTemplateID, CredentialID.
["87","9","9","false"] false is to 'Skip' the creation of application if duplicate