I'm trying to programmatically delete a node from our SolarWinds Orion environment as part of our server decommission process I am automating. I can't seem to find the correct endpoint to target in my POST to the API to do this, and I've searched the scheme documentation for our version (2024.1). I should note I have no issues getting the NodeID from the API - it's just the delete operation I cannot figure out...
Here's what I am currently trying to do, but it fails:
# Extract the NodeID and perform the DELETE operation
if ($response.results.Count -gt 0) {
$nodeID = $response.results[0].NodeID
Write-Host "Node ID: $nodeID"
# Construct the DELETE URI using NodeID
$deleteUri = "$baseUri/Invoke/Orion.Nodes/Delete"
$body = @{
NodeID = $nodeID
}
$deleteResponse = Invoke-RestMethod -Uri $deleteUri -Method Post -Headers $headers -Body ($body | ConvertTo-Json) -ContentType "application/json" -SkipCertificateCheck
And here's the error I get:
- Deleting Server01 from SolarWinds Orion: Node ID: 8296
Invoke-RestMethod: .\windows_server_decomm.ps1:475
Line |
475 | … eResponse = Invoke-RestMethod -Uri $deleteUri -Method Post -Headers $ …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| { "Message": "Verb Orion.Nodes.Delete: Not found", "ExceptionType":
| "SolarWinds.InformationService.Verb.VerbExecutorException", "FullException":
| "SolarWinds.InformationService.Verb.VerbExecutorException: Verb Orion.Nodes.Delete: Not found\r\n at
| SolarWinds.InformationService.Core.InformationService.Invoke[T](String entity, String verb, Action\u00601
| setupParameters, Func\u00602 extractReturnValue)" }