Dynatrace REST API Overview (WIP)

REST API Overview #

Written against Netcool Version 8.1

Please see link below for Netcool HTTP API docs:
https://help.dynatrace.com/dynatrace-api/

REST API Authentication #

Access to the REST APIs is protected by Basic Authentication.

Create an Api Token by navigating to Settings > Integration > Dynatrace API

https://ijp39459.live.dynatrace.com/#settings/integration/apikeys

Example Connection Configuration #

edgeCore connects to the Netcool HTTP API using a Web Data Connection.  An example Connection Configuration is presented below:

Connection Property Example
Connection Name NCOM HTTP API
Destination https://<NetcoolHttpApiEndpoint>
SSO Handler Basic Auth
SSO Credentials Username: <netcool user> and Password: <netcool password>

Example Feed Configurations #

edgeCore makes requests to the Netcool HTTP API using the JSON Feed.  Below are defaults for all Netcool Feeds configuration properties unless other is specified:

Default Feed Property Value
Request Headers None
Rule Name BaseData
Logging Production
Poll Period 60
Enable Server Subscription Yes

List below are a series of sample JSON Feed Configurations that make requests to the supported AppDynamics REST API:

Netcool Get Active Incidents #
Feed Property Value
Feed Name NCOM Get Alerts
Start URI /objectserver/restapi/alerts/status
HTTP Method GET
JSON Path  $.rowset.rows[*].[‘Node’,’Summary’]
Netcool Get All Alerts Sorted by Severity, Acknowledged, Last Occurrence #
Feed Property Value
Feed Name NCOM Get All Alerts Sorted by Severity, Acknowledged Last Occurrence
Start URI encoded:      /objectserver/restapi/alerts/status?orderby=Severity%20DESC%2C%20Acknowledged%20ASC%2C%20LastOccurrence%20DESC
unencoded:  /objectserver/restapi/alerts/status?orderby=Severity DESC, Acknowledged ASC, LastOccurrence DESC
HTTP Method GET
JSON Path  $.[‘rowset’][‘rows’][*]
Netcool Get All Severity=5 Alerts #
Feed Property Value
Feed Name NCOM Get All Severity 5 Alerts
Start URI encoded:      /objectserver/restapi/alerts/status?orderby=Severity%20DESC%2C%20Acknowledged%20ASC%2C%20LastOccurrence%20DESC
unencoded:  /objectserver/restapi/alerts/status?orderby=Severity DESC, Acknowledged ASC, LastOccurrence DESC
HTTP Method GET
JSON Path  $.[‘rowset’][‘rows’][*]
Netcool Get Table Catalog #
Feed Property Value
Feed Name NCOM Get Table Catalog
Start URI  /objectserver/restapi/catalog/tables
HTTP Method GET
JSON Path  $.
Netcool Get Users #
Feed Property Value
Feed Name NCOM Get Users
Start URI  /objectserver/restapi/security/users
HTTP Method GET
JSON Path $.rowset.rows
Netcool Get Groups #
Feed Property Value
Feed Name NCOM Get Groups
Start URI  /objectserver/restapi/master/groups
HTTP Method GET
JSON Path $.rowset.rows

Example Write Back Feed Configuration #

Netcool Acknowledge Alert #
Feed Property Value
Feed Name NCOM Acknowledge Alert
Start URI  /objectserver/restapi/alerts/status/{nodeVar.RowSerial}/
HTTP Method PATCH
Request Body {

“rowset”: {
“coldesc”: [
{
“type”: “integer”,
“name”: “Acknowledged”
}
],
“rows”: [
{
“Acknowledged”: 1
}
]
}
}

Netcool De-acknowledge Alert #
Feed Property Value
Feed Name NCOM Deacknowledge Alert
Start URI  /objectserver/restapi/alerts/status/{nodeVar.RowSerial}/
HTTP Method PATCH
Request Body {

“rowset”: {
“coldesc”: [
{
“type”: “integer”,
“name”: “Acknowledged”
}
],
“rows”: [
{
“Acknowledged”: 0
}
]
}
}

Netcool Assign Group #
Feed Property Value
Feed Name NCOM Assign Group
Start URI /objectserver/restapi/alerts/status/{nodeVar.RowSerial}/
HTTP Method PATCH
Request Body {

“rowset”: {
“coldesc”: [
{
“type”: “integer”,
“name”: “GroupGID”
}
],
“rows”: [
{
“GroupGID”: {nodeVar.GroupGID}
}
]
}
}

Netcool Assign Usr #
Feed Property Value
Feed Name NCOM Assign User
Start URI  /objectserver/restapi/alerts/status/{nodeVar.RowSerial}/
HTTP Method PATCH
Request Body {

“rowset”: {
“coldesc”: [
{
“type”: “integer”,
“name”: “OwnerUID”
}
],
“rows”: [
{
“OwnerGID”: {nodeVar.OwnerUID}
}
]
}
}

Reference HTTP API Requests #

cURL  Reference Request (alerts.status)

curl –user edge:edge http://<NetcoolHttpEndPoint>/objectserver/restapi/alerts/status

cURL Reference Request (database/table)

curl –user edge:edge http://<NetcoolHttpEndPoint>/objectserver/restapi/database/table

Filtering Query to alerts.status (Node=’hostname.domain’)

curl –user edge:edge http:/<NetcoolHttpEndPoint>/objectserver/restapi/alerts/status?filter=Node%3D%27hostname.domain%27

Specifying the Columns List to Return (ex: Serial,Node,Summary)

curl –user edge:edge http://<NetcoolHttpEndPoint>/objectserver/restapi/alerts/status?collist=Serial%2CNode%2CSummary

Specifying the OrderBy parameter to Return (ex: Serial ASC)

curl –user edge:edge http://<NetcoolHttpEndPoint>/objectserver/restapi/alerts/statusstatus?orderby=Serial%20ASC

Specifying the Filter, Collist, OrderBy parameters in one request (ex: Serial ASC)

curl –user edge:edge http://<NetcoolHttpEndPoint>/objectserver/restapi/alerts/statusstatus?filter=Node%3D%27hostname.domain %27&collist=Serial%2CNode%2CSummary&Serial%20ASC&orderby=Serial%20ASC

Alternative Approach Configuring the JSON Restful Post with a SQL Command

curl -k -L -X POST -H ‘Content-Type: application/json’ -d ‘{
“sqlcmd” : “select * from alerts.status;”
}’ -u ‘edge:edge’ ‘http://sol-deathstar.edge.internal:8080/objectserver/restapi/sql/factory

Feed Name: AlertsCommand

Start URI: /objectserver/restapi/sql/factory

HTTP Method: POST

Request Body:

{
“sqlcmd”: “select * from alerts.status;”
}

Request Header:  Key: Content-Type  Value: application/json