Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all articles
Browse latest Browse all 3719

Set node custom properties using PowerShell Rest API

$
0
0

Hello,

 

I was able to add Orion node using the below per Re: SWIS REST/JSON API

$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 Re: SWIS REST/JSON API , 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.


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>