Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all articles
Browse latest Browse all 2677

Orion SWQL, Thwack! Now I got it

$
0
0

Orion SWQL or Solarwinds Query Language is a pseudo SQL type statements. If you know the basic structure of SQL, Select from join where order group by, you will easily pickup SWQL queries.

 

PURPOSE: This is an overly simplified guide for Keep the lights on SQL to Expert SQL users wanting to jump into Solarwinds Query Language as fast as possible.

 

Where is SWQL used?

  • Every Web Resource on the Web Console
  • Alerts
  • Reports
  • SDK/API scripting

 

Why should I use SWQL?

    Solarwinds has designed SWQL to be future proofed for users and development.

 

Note: A lot of this information exists in multiple places, I am just combining the different points to help provide a better picture to start creating queries easily.

 

Common SQL Constructs Supported

SWQL supports the following constructs from SQL:

    Note: If you know MS SQL, this will be exactly the same, except for the table names all start with Orion instead of dbo; however see the that * and Update or Deletes are not possible.

  • SELECT … FROM …
  • WHERE clauses
  • GROUP BY clauses and HAVING clauses
  • ORDER BY clauses
  • INNER JOIN
  • LEFT OUTER JOIN
  • RIGHT OUTER JOIN
  • UNION and UNION ALL
  • SELECT TOP n
  • SELECT DISTINCT
  • Subqueries in the SELECT clause
  • Subqueries in the FROM/JOIN clauses

  SWQL supports the following aggregate functions:

  • SUM
  • MAX
  • MIN
  • AVG
  • COUNT

  SWQL supports the following regular functions:

  • ISNULL
  • ABS

  Wildcards - 

The wildcard character in SWQL syntax is: %

Example: Node.Caption Like 'AX3%'

  Common SQL Constructs Not Supported

SWQL does not support the following common SQL constructs:

Note: You must use CRUD operations to create, read, update, or delete entities.

  • SELECT * FROM … (You must list the actual properties you want to select.)
  • UPDATE, INSERT, DELETE, etc. (You can only use SWQL to read data.)

 

Included in the Excel Spreadsheet

   

  • SWIS Examples.
    • Understand all of the different SWQL Functions. If you want to do more than just join a table, this included converting time, check values, and the more basic SQL type commands min,max, average.
  • SWIS Table Reference.
    • Want to know where to find the Node Data or the Applications, Storage or Virtual etc would be within SWQL? This covers the main key reference tables, the identifier id, and how to reference it up the chain from Component to Application to Node to Engine.
    • Some of this information came from Orion.NetObjectTypes. SWIS Parent and Column Details were added to see the relationship to the next table.
    • This section will be continuously updated. The main Core modules are currently mapped, and others are still being finalized.
  • Filtering by Status
    • Want to know what all of the 20+ Device and other Statuses and how convert from an ID to a human readable status? This tab is just for you. This can be referenced in Orion.StatusInfo

Viewing all articles
Browse latest Browse all 2677

Trending Articles



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