We are trying to use the Orion API to set a node or group into maintenance . Please can one of the members please post the format as I'm certainly no expert.
Many thanks
Are you using the PowerShell SDK or the REST API with another language? When you say maintenance do you mean unmanaging or suppressing alerts (mute)?
The following should help with getting started
https://github.com/solarwinds/OrionSDK/wiki/REST
The Orion.Nodes entity has verbs for Unmanage and Remanage tasks, you can see these and their parameters using SWQL Studio
Examples using curl can be seen here
https://thwack.solarwinds.com/t5/Orion-SDK-Discussions/how-to-remanage-node-via-curl-rest-api/m-p/283222#M6086
Great, many thanks Tony !
Apologies mrxinu, using the Rest API and trying to unmanage and remanage prior to our maintenance proceedures.
Last question if I may;
Instead on using objectid, can custom property be used?
Ah, gotcha. So this is going to talk about unmanaging them using the PowerShell module, but it's similar to how you would do it with the REST endpoints.
https://github.com/solarwinds/OrionSDK/wiki/Unmanaging-Entities
You'll need the four things they talk about here: netObjectID (e.g., "N:123"), the start time in UTC, the end time in UTC, and then "false" (you can read about that on that wiki link).
Then you POST to the endpoint to invoke that verb and submit an array of those values in JSON. The request looks like this:
https://github.com/solarwinds/OrionSDK/wiki/REST#invoke-request
In the case of unmanaging the URL would be this:
https://example.com:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Nodes/Unmanage
And the body would look like this with the content-type set to 'application/json':
[ "N:123", "start_utc_timestamp_here", "end_utc_timestamp_here", "false"]
Yes, but you have to do some work ahead of time. Ultimately you have to give the verb what it needs, but you can query for the NodeID ahead of time.
You would submit this JSON to the query endpoint below as a POST with the content-type set to 'application/json':
https://example.com:17778/SolarWinds/InformationService/v3/Json/Query
{ "query": "SELECT NodeID FROM Orion.Nodes AS Nodes WHERE Nodes.CustomProperties.City = 'Austin'"}
At that point you'll have the NodeIDs you need to put together the NetObjectID ("N:" + NodeID) to make the request to unmanage it.