Hello,
I was able to add Orion node using the below per
$url = "https://server:17778/SolarWinds/InformationService/v3/Json/Create/Orion.Nodes"
Invoke-RestMethod -Uri $url -Method POST -Body $body -Credential $Credential -ContentType application/json
But when I attempted to set the custom properties for the node per the link PowerShell script to modify a NODE Custom Property via Rest API/JSON
using the code below,
$swisUri = "swis://server/Orion/Orion.Nodes/NodeID=$($NodeID)/CustomProperties"
$url = "https://server:17778/SolarWinds/InformationService/v3/Json/$swisUri"
$customProp = @{
AssignmentGroup='Supportgroup';
Category='Physical';
NodeApplication='Application';
Comments='Application server';
}
$body = ConverTo-Json $customProp
Invoke-RestMethod -Uri $url -Method POST -Body $body -Credential $Credential -ContentType application/json
I did not get any error, but the custom properties of the node were not set.
Per the link
, there is a work-around using:
POST https://servername:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Reporting/ExecuteSQL
["Insert into NodesCustomProperties (NodeID) VALUES (13)"]
How can I construct the Insert statement in the json body above?
Thank you.