REST API Developer's Guide

Get SDTs

Using LogicMonitor's REST API, you can programmatically get a list of SDTs or get information about a particular SDT.

Note: As with all of our API calls, authentication is required.

 

Get a list of SDTs

Returns a list of all SDTs

HTTP Method: GET

URI: /sdt/sdts

Request Parameters: By default, a list of 50 SDTs will be returned. You can include sort, filter, fields, size and offset parameters in your request to control what data is included in the response and how it is formatted. Note that query parameters are not considered part of the resource path, and should not be included the calculation of the LMv1 authentication signature.

Property

Syntax

Description

Example URI

sort sort={+ or -}property Sorts the response by the property specified in either increasing (+) or decreasing (-) order /sdt/sdts?sort=-id
filter filter=property:value Filters the response to include only the results that have the specified value for the specified property /sdt/sdts?filter=type:ServiceSDT
fields fields={list of properties separated by commas} Filters the response to only include the following fields for each object /sdt/sdts?fields=type,id
size size=integer The number of results to display. Max is 1000. /sdt/sdts?size=5
offset offset=integer The number of results to offset the displayed results by /sdt/sdts?offset=2

 

Example 1: Get a list of SDTs

The following request returns a list of all SDTs

Request:

curl -v --user 'apiUser:example' -X GET "https://api.logicmonitor.com/santaba/rest/sdt/sdts"

Response:

{
  "status" : 200,
  "errmsg" : "OK",
  "data" : {
    "total" : 8,
    "items" : [ {
      "id" : "S_10",
      "sdtType" : 3,
      "admin" : "lmsupport",
      "comment" : "",
      "weekDay" : 1,
      "monthDay" : 1,
      "hour" : 3,
      "minute" : 0,
      "endHour" : 5,
      "endMinute" : 0,
      "duration" : 120,
      "startDateTimeOnLocal" : "2015-08-01 03:00:00 MST",
      "startDateTime" : 1438423200853,
      "endDateTimeOnLocal" : "2015-08-01 05:00:00 MST",
      "endDateTime" : 1438430400853,
      "isEffective" : false,
      "type" : "ServiceSDT",
      "serviceId" : 9,
      "serviceName" : "163"
    }, {
      "id" : "S_29",
      "sdtType" : 4,
      "admin" : "cohlint",
      "comment" : "",
      "weekDay" : 1,
      "monthDay" : 0,
      "hour" : 3,
      "minute" : 0,
      "endHour" : 4,
      "endMinute" : 0,
      "duration" : 60,
      "startDateTimeOnLocal" : "2015-07-09 03:00:00 MST",
      "startDateTime" : 1436436000853,
      "endDateTimeOnLocal" : "2015-07-09 04:00:00 MST",
      "endDateTime" : 1436439600853,
      "isEffective" : false,
      "type" : "ServiceSDT",
      "serviceId" : 5,
      "serviceName" : "babala"
    },{
      "id" : "S_41",
      "sdtType" : 1,
      "admin" : "lily",
      "comment" : "sdt by mobile",
      "weekDay" : 1,
      "monthDay" : 0,
      "hour" : 0,
      "minute" : 0,
      "endHour" : 0,
      "endMinute" : 0,
      "duration" : 2103899,
      "startDateTimeOnLocal" : "2015-03-01 20:32:00 MST",
      "startDateTime" : 1425267120000,
      "endDateTimeOnLocal" : "2019-03-01 21:31:00 MST",
      "endDateTime" : 1551501060000,
      "isEffective" : true,
      "type" : "ServiceSDT",
      "serviceId" : 44,
      "serviceName" : "zxltest"
    } ],
    "searchId" : null
  }

 

Example 2: Get a list of SDTs

The following request returns the id, type and isEffective values for every SDT in api.logicmonitor.com, sorted in descending order by id:

Request:

curl -v --user 'api:example' -X GET "https://api.logicmonitor.com/santaba/rest/sdt/sdts?fields=id,type,isEffective&sort=-id" 

Response:

{
  "status" : 200,
  "errmsg" : "OK",
  "data" : {
    "total" : 8,
    "items" : [ {
      "id" : "S_6",
      "isEffective" : false,
      "type" : "ServiceSDT"
    }, {
      "id" : "S_30",
      "isEffective" : false,
      "type" : "ServiceSDT"
    }, {
      "id" : "S_29",
      "isEffective" : false,
      "type" : "ServiceSDT"
    }, {
      "id" : "S_10",
      "isEffective" : false,
      "type" : "ServiceSDT"
    }, ],
    "searchId" : null
  }

 

Get information about a particular SDT

Returns information about a particular SDT

HTTP Method:GET

URI: /sdt/sdts/{id}

Request Parameters: You can specify which fields are displayed in the response:

Property

Syntax

Description

Example URI

fields fields={list of properties separated by commas} Filters the response to only include the following fields for each object /sdt/sdts/{id}?fields=type,id

 

Example 1: Get information about a particular SDT

The following request returns the details for the SDT S_41:

Request:

curl -v --user 'api:example' -X GET "https://api.logicmonitor.com/santaba/rest/sdt/sdts/S_41" 

Response:

{
  "status" : 200,
  "errmsg" : "OK",
  "data" : {
    "id" : "S_41",
    "sdtType" : 1,
    "admin" : "lily",
    "comment" : "sdt by mobile",
    "weekDay" : 1,
    "monthDay" : 0,
    "hour" : 0,
    "minute" : 0,
    "endHour" : 0,
    "endMinute" : 0,
    "duration" : 2103899,
    "startDateTimeOnLocal" : "2015-03-01 20:32:00 MST",
    "startDateTime" : 1425267120000,
    "endDateTimeOnLocal" : "2019-03-01 21:31:00 MST",
    "endDateTime" : 1551501060000,
    "isEffective" : true,
    "type" : "ServiceSDT",
    "serviceId" : 44,
    "serviceName" : "zxltest"
  }

 

Example 2: Get information about a particular SDT

The following request returns the id and type for the Service SDT S_41:

Request:

curl -v --user 'api:example' -X GET "https://api.logicmonitor.com/santaba/rest/sdt/sdts/S_41" 

Response:

{
  "status" : 200,
  "errmsg" : "OK",
  "data" : {
    "id" : "S_41",
    "type" : "ServiceSDT"
  }