Overview
We are building (python) what is called in the industry "API connector software". Any company that builds / releases software of substance will provide API endpoint(s) you can access and manipulate data. SolarWinds is a bit confusing and does a poor job of supporting this type of access. As of Jan 2025 SolarWinds still does not have the ability to issue API Keys. Supposedly you can get Bearer Tokens but you must create a SWIS user acct. Have not gotten that far. One thing SolarWinds does allow is if you have authorized access to a software package i.e.: SAM 2024.4.1 and such then as an authorized user you can perform some generic (SWIS) API calls (gets only). These are not using OrionSDK. There is a lot of confusion. OrionSDK, SWQL, SWIS, SWIS Verbs, SWQL Studio and PowerShell. There is info that says you need to use OrionSDK and others say not needed and yet others who say it's not supported any longer. Well in part they are correct. I do have API calls (very few) working without OrionSDK installed. When we open a support ticket with SolarWinds they say that's outside of support and need to go to Thwack. Well, Thwack sorry to say does not have much. All the things I have manage to get working has not been from anything I have found in Thwack. Could be me and my search and begging abilities.
Goal:
We have chosen Django and by this Python to build our connector software and underlying LLM and some AI being tested. As it applies to SolarWinds it will be used to monitor / manage SolarWinds SAM 'Events, Alerts, Ack / nack', node custom properties manipulation and update of Nodes etc. This data and data from other software platforms we are also using API (way easier on other platforms) to extract from we are able to build a complete MPOG App for a large NOC.
So far:
In regards to SolarWinds SAM we are using generic python request code (some minor tweaks for SAM API compatibility) to access SAM Endpoint 'SolarWinds/InformationService/v3/Json/Query' . We are using Orion.Nodes and Orion.NodesCustomProperties tables for testing. Standard table gets work fine. Things like COUNT and special SELECTS and JOINS are tossing 400's. We are sure the syntax is correct but no go. Also should mention we do have SWQL Studio up and running to verify access using AD and BasicAuth Creds. And NO we did not have to install OrionSDK to get SWQL Studio.
Example (views.py):
#solarwinds_server = 'https://your server name here:17774' # SOLARWINDS_API_TENANT_URL_PROD and creds from .env
solarwinds_server = SOLARWINDS_API_TENANT_URL_PROD
username = SOLARWINDS_USER
password = SOLARWINDS_PASS
endpoint = f'{solarwinds_server}/SolarWinds/InformationService/v3/Json/Query'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
query = {
'query': 'SELECT TOP 5 NodeID, Caption, IPAddress, NodeName, Status FROM Orion.Nodes'
}
response = requests.get(endpoint, params=query, headers=headers, auth=HTTPBasicAuth(username, password), verify=False)
if response.status_code == 200:
nodes = response.json()['results']
for node in nodes:
print(f"NodeID: {node['NodeID']}, Caption: {node['Caption']}, IPAddress: {node['IPAddress']}, NodeName: {node['NodeName']}, Status: {node['Status']}")
else:
print(f"Failed to retrieve Data. Status code: {response.status_code}, Response: {response.text}")
return HttpResponse('Test solarwinds_search')
Ask:
If anyone has any further verified info to add to this work in progress all would be appreciated.