cancel
Showing results for 
Search instead for 
Did you mean: 

SolarWinds PerfStack API

SolarWinds PerfStack API

Since this is undocumented at the moment, I decided to start digging around.

API Endpoint

/api2/perfstack

https://swservername/api2/perfstack

Query Paramaters
  • count
  • resolution
  • startTime
  • endTime
  • details
  • relations
PerfStack Query Paramaters
  • offset
  • length
  • orderBy
  • sort
  • displayName
  • status
  • type
  • user
  • updateLastAccessed

MetaData

Endpoint: metadata/

States

Endpoint: metadata/states

Lists All States

https://swservername/api2/perfstack/metadata/states

Lists a single state by ID

metadata/states/{statusIds}

Example: https://swservername/api2/perfstack/metadata/states/1

Types

Endpoint: metadata/types

List all Types

https://swservername/api2/perfstack/metadata/types

List specific Type

metadata/types/{entityTypeCdl}

Entities

Endpoint:  entities/

Query Parameters

  • Length
  • Offset
Get Entity Info

Endpoint: entities/{entityIdsCdl}

Filters

  • entityId

Query Parameters – Used to Get Metrics

  • Count
  • Resolution
  • StartDate
  • EndDate

Examples:

Gets entity information for a single node based on entityID

https://swservername/api2/perfstack/entities/0_Orion.Nodes_2055/

Get Metrics for entityID, returns first measurement for each metric

https://swservername/api2/perfstack/entities/0_Orion.Nodes_2055/?count=1

Get Available Metrics For Entity

Endpoint:  entities/{entityIdsCdl}/metrics

Filters

  • entityId

Query Parameters – Used to Get Metrics

  • Count
  • Resolution
  • StartDate
  • EndDate

Examples:

Gets all metric types for a specific entity

https://swservername/api2/perfstack/entities/0_Orion.Nodes_2055/metrics

Get Metrics for entityID, returns first measurement for each metric

https://swservername/api2/perfstack/entities/0_Orion.Nodes_2055/metrics/?count=1

Get Relationships for Entity

Endpoint: entities/{entityIdsCdl}/relationships

Example: https://swservername/api2/perfstack/entities/0_Orion.Nodes_2055/relationships

States

Endpoint: entities/states

List all states

https://swservername/api2/perfstack/entities/states

List state by ID

Endpoint:  /states/{statusIds}

Example: https://swservername/api2/perfstack/entities/states/2

Types

Endpoint:  entities/types

List all Types

https://swservername/api2/perfstack/entities/types

List by TypeID

Endpoint:  entities/types/{entityTypeCdl}

Metrics

Endpoint: metrics/

Filters

  • entityId
  • metricId

Query Parameters

  • Count
  • Resolution
  • StartDate
  • EndDate
Get Measurement For Entity

Endpoint: metrics/{id}

Get Groups For Entity

Endpoint: metrics/{entityId}/groups

Get Measurement For Group

Endpoint: metrics/{entityId}/groups/{groupId}

Comments

Really great stuff man.   Impressive.

I'm trying to use your New-SWSession function and I keep getting the error of:

ERROR: New-SWSession : Exception setting "Name": "The 'Name'='Orion_IsSessionExp=' part of the cookie is invalid."

Looking at the code for it I think there is an error in it.  You create a new Cookie object, then you set the Name property of that Cookie object to "Id", but then in the very next line you set the same Name property of that Cookie Object to "/"…  Then, in the next line you once again change the Name of the Cookie object to the results of a replace on "ASP.NET_SessionId=" from the Session.Headers object with ''.  I'm trying to figure out what you were tying to do when you set that Cookie Name three times in a row.

Here's the section of code I'm referring to (Sorry I can't format it.  The Advanced Editor isn't available on replies for this kind of post for some reason…):

#Create a cookie in the Session Variable with the current SessionID

                $Cookie = New-Object System.Net.Cookie

                $Cookie.Name = "Id"

                $Cookie.Name = "/"

                #Best way I could figure out how to get the current SessionID from the Session; #Regex skills needed

                $Cookie.Name = $Session.Headers.'Set-Cookie'.Split(';')[0].Replace('ASP.NET_SessionId=','')

                $Cookie.Domain = $ServerName

Version history
Revision #:
1 of 1
Last update:
‎05-03-2017 12:29 PM
Updated by:
 
Contributors