NAV Navbar
cURL Python Ruby Response
  • Introduction
  • Request Headers
  • Authentication
  • Errors
  • Pagination
  • API Endpoint Types
  • Users (/user)
  • Devices (/cdt_device)
  • Interfaces (/cdt_port)
  • Groups (/group)
  • Discovery Configuration (/discover_config)
  • Message (/message)
  • Events (/event_record)
  • Introduction

    The Statseeker API provides access to view, and edit, Statseeker configuration settings, as well to retrieve and manipulate time-series data via an interface other than that provided by the Statseeker’s web GUI. Most of the processes and objects that you are used to interacting with in Statseeker (network discovery, users, groups, devices, interfaces, alerts, reporting data, etc.) are exposed as resources from the API standpoint and, through querying the API, these resources can be returned as data objects which you can review and modify.

    The API adheres to basic RESTful API principles:

    All API responses are returned in JSON (JavaScript Object Notation) format.

    Request Headers

    All requests should include the following HTTP headers:


    Header Mandatory Value Notes
    Accept no application/json This specifies the media type accepted in the response
    Content-Type no application/json This specifies the media type of the content being sent to the API
    Authorization yes Basic [base-64 encoded username:password] The Basic keyword indicates the authentication method being used and the base-64 encoded username:password pair provides the credentials needed to access the API. See Authentication for further details.

    Authentication

    
    curl \ 
       -H "Accept: application/json" \ 
       -H "Content-Type: application/json" \
       -u user:pword \
       "http://your.statseeker.server/api/v2.1"
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    # install with: $ gem install rest-client
    require 'rest_client'
    
    # api root endpoint
    $uri = 'http:/your.statseeker.server/api/v2.1/'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?&indent=3'
    
    # send request
    response = RestClient::Request.new({
                method: :get,
                url: $uri + $rspFormat,
                user: $user,
                password: $pword,
            }).execute
    
    # output respose to screen
    puts "#{response.to_str}"
    

    The Statseeker API uses the same HTTP Basic Access (BA) authentication used by Statseeker web interface (i.e. username:password). The admin user account (created during the Statseeker installation process) is configured with API access by default and, when creating additional Statseeker users, API access can be assigned:

    This basic authentication must be included in the HTTP Authorization header for every request sent to the API, see below for examples of supplying this authorization.

    Errors

    Statseeker uses RESTful HTTP response codes to indicate success or failure of API requests


    Code Message Notes
    200 Success Successful API request
    400 Bad Request Malformed request, check request syntax and supplied parameters
    401 Unauthorized Authorization error, check the supplied username and password
    404 Not Found The specified endpoint cannot be located
    500 Server Error Something has gone wrong on Statseeker's end

    Pagination

    The API automatically paginates the response when large data sets are returned. By default, the API will return 50 results per response and provide links to the First, Next, Previous, and Last sets within the data.

    The number of results returned in a single response can be modified from the default value of 50 by setting the limit parameter on the request.

    The following example HTTP request will return 200 results per response http://your.statseeker.server/api/v2.1/cdt_port/?&limit=200

    When moving through paginated data with the pagination links (Next, Previous, etc) the request url is altered to append an offset request parameter. Following on from the example above, the response to that request would contain a link to the next page in the results, this link would specify: http://your.statseeker.server/api/v2.1/cdt_port/?&limit=200&offset=200

    API Endpoint Types

    The API allows you to add, retrieve and modify data relating to a large number of data-object/resource types. These resources are related to either the network hardware that your Statseeker server is monitoring, or various configuration settings (user accounts, thresholds and alerts, automated processes, network configuration details, etc.) applied to your Statseeker server.

    Endpoint Example Description
    / http://your.statseeker.server/api/v2.1/ The root endpoint for the API.
    This level of the API contains all of the resources available on your server.
    /{resource} http://your.statseeker.server/api/v2.1/user The resource endpoint, for running get, update, and delete queries on specific resources
    /{resource}/describe http://your.statseeker.server/api/v2.1/user/describe The describe endpoint, for running describe queries on specific resources
    /{resource}/execute http://your.statseeker.server/api/v2.1/discover/execute The execute endpoint, for running execute queries on specific resources
    /{resource}/{id} http://your.statseeker.server/api/v2.1/user/1234 The ID endpoint, for running get, update, and delete queries on a specific entry within a resource
    /{resource}/{id}/{field} http://your.statseeker.server/api/v2.1/user/1234/name The field endpoint, for running update queries on a field of a specific entry within a resource

    Root Endpoint /api/{version}

    The base (root) endpoint for the API is:

    , where:

    Version References Message
    v1 Version 1 of the API, this is a legacy, read-only api, and is not covered in this document
    v2, v2.0 Version 2 of the API, the initial implementation of the Statseeker RESTful Read-Write API
    v2.1 Version 2.1 of the API, added access to all time-series data (device\interface metrics) collected by Statseeker
    latest Currently, Version 2.1 of the API

    Versioning

    The base endpoint of /api/latest will return the latest version of the API installed on your Statseeker server. This version is identified in every response from the API in the api_version key.

    You can access an API version, other than the latest, by altering your base URL to specify the version you want to use. E.g. /api/v1 will return API v1, or /api/v2 will return API v2.0.

    There may be multiple revisions released for a given API version, these revisions address issues relating to bugs within the API itself, and issues relating to Custom Data Type (CDT) packages that the API can interact with. The API will always use the latest revision available for the specified API version.

    GET /

    
    curl \
       -H "Accept: application/json" \
       -H "Content-Type: application/json" \
       -X GET \
       -u user:pword \
       "http://your.statseeker.server/api/v2.1/?links=none&indent=3"
    
    
    require 'rest_client'
    
    $user = 'admin'
    $pword = 'statseeker'
    
    
    $rspFormat = '?links=none&indent=3'
    
    $uri = 'http://10.2.16.30/api/v2.1/'
    
    response = RestClient::Request.new({
          method: :get,
          url: $uri + $rspFormat,
          user: $user,
          password: $pword,
        }).execute
        puts "#{response.to_str}"
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "admin"
    pword = "statseeker"
    
    # API root endpoint
    rootUri = "http://10.2.16.30/api/v2.1/"
    
    # optional response formatting
    rspFormat = "?links=none&indent=3"
    
    # set URL to be used
    url = rootUri + rspFormat
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request and 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    {
       "info":"The Statseeker RESTful API",
       "version":"2.1",
       "data":{
          "objects":[
             {
                "status":{
                   "errcode":0,
                   "success":true
                },
                "data":[
                   {
                      "name":"group"
                   },
                   {
                      "name":"object"
                   },
                   {
                      "name":"user"
                   },
                   {
                      "name":"cdt_apcon_port"
                   },
                   {
                      "name":"cdt_checkpoint_firewall"
                   },
                   {
                      "name":"cdt_cisco_activeDS0"
                   },
                   {
                      "name":"cdt_cisco_call_stats"
                   },
                   {
                      "name":"cdt_cisco_firewall_connections"
                   },
                   {
                      "name":"cdt_cisco_ipsla"
                   },
                   {
                      "name":"cdt_cisco_wan_3g"
                   },
                   {
                      "name":"cdt_cisco_wan_3g_nearby_cells"
                   },
                   {
                      "name":"cdt_cpu"
                   },
                   {
                      "name":"cdt_cpu_alcatel"
                   },
                   {
                      "name":"cdt_cpu_cisco"
                   },
                   {
                      "name":"cdt_cpu_cisco_asa"
                   },
                   {
                      "name":"cdt_cpu_cisco_nexus"
                   },
                   {
                      "name":"cdt_cpu_cisco_san"
                   },
                   {
                      "name":"cdt_cpu_foundry"
                   },
                   {
                      "name":"cdt_cpu_foundry_mlx"
                   },
                   {
                      "name":"cdt_cpu_juniper"
                   },
                   {
                      "name":"cdt_cpu_netscreen"
                   },
                   {
                      "name":"cdt_cpu_procurve"
                   },
                   {
                      "name":"cdt_cpu_server"
                   },
                   {
                      "name":"cdt_device"
                   },
                   {
                      "name":"cdt_filesystem"
                   },
                   {
                      "name":"cdt_framerelay"
                   },
                   {
                      "name":"cdt_framerelay_cisco"
                   },
                   {
                      "name":"cdt_framerelay_juniper"
                   },
                   {
                      "name":"cdt_framerelay_nortel"
                   },
                   {
                      "name":"cdt_juniper_firewall"
                   },
                   {
                      "name":"cdt_juniper_ping"
                   },
                   {
                      "name":"cdt_memory"
                   },
                   {
                      "name":"cdt_memory_alcatel"
                   },
                   {
                      "name":"cdt_memory_cisco"
                   },
                   {
                      "name":"cdt_memory_cisco_nexus"
                   },
                   {
                      "name":"cdt_memory_cisco_san"
                   },
                   {
                      "name":"cdt_memory_foundry"
                   },
                   {
                      "name":"cdt_memory_foundry_mlx"
                   },
                   {
                      "name":"cdt_memory_juniper"
                   },
                   {
                      "name":"cdt_memory_netscreen"
                   },
                   {
                      "name":"cdt_memory_procurve"
                   },
                   {
                      "name":"cdt_memory_server"
                   },
                   {
                      "name":"cdt_port"
                   },
                   {
                      "name":"cdt_port_nbar"
                   },
                   {
                      "name":"cdt_printer"
                   },
                   {
                      "name":"cdt_printer_general"
                   },
                   {
                      "name":"cdt_temperature"
                   },
                   {
                      "name":"cdt_temperature_alcatel"
                   },
                   {
                      "name":"cdt_temperature_apc_env"
                   },
                   {
                      "name":"cdt_temperature_cisco"
                   },
                   {
                      "name":"cdt_temperature_foundry"
                   },
                   {
                      "name":"cdt_temperature_foundry_mlx"
                   },
                   {
                      "name":"cdt_temperature_juniper"
                   },
                   {
                      "name":"cdt_temperature_netscreen"
                   },
                   {
                      "name":"cdt_ups"
                   },
                   {
                      "name":"cdt_ups_apc"
                   },
                   {
                      "name":"cdt_ups_generic"
                   },
                   {
                      "name":"cdt_virtual_memory"
                   },
                   {
                      "name":"cdt_ranges"
                   },
                   {
                      "name":"config_build"
                   },
                   {
                      "name":"discover"
                   },
                   {
                      "name":"discover_config"
                   },
                   {
                      "name":"discover_hosts"
                   },
                   {
                      "name":"event"
                   },
                   {
                      "name":"event_record"
                   },
                   {
                      "name":"threshold_event"
                   },
                   {
                      "name":"threshold_record"
                   },
                   {
                      "name":"license"
                   },
                   {
                      "name":"message"
                   },
                   {
                      "name":"nim_options"
                   },
                   {
                      "name":"task"
                   },
                   {
                      "name":"threshold"
                   }
                ],
                "type":"object",
                "data_total":72
             }
          ],
          "errmsg":"ok",
          "success":true,
          "time":1524030761
       },
       "revision":"5"
    }
    
    Parameters Type/Valid Values Description
    links
    • only - only return the links object, no data object
    • none - only return the data object, no links object
    • html - return html links. If the response is being displayed in a browser then the links may be clicked to send a GET request for the associated object/field.
    • htmlonly - only return html links, no data object
    Modifies how the links contained within the response object are presented
    indent Positive integer Number of characters to indent when formatting code blocks for display

    Resource Endpoint /{resource}

    The Statseeker RESTful API contains many resources allowing you to access and interact with both the data that Statseeker has collected on your network, as well as the configuration options used by Statseeker to collect and manage that data. Some of object types available at the resource level endpoint include:

    For a complete list of all resources available from your Statseeker installation you can:

    GET /{resource}

    Example: return specified details on all devices in the group AU_Servers, the fields to return are:

    • name
    • id
    • community
    • ipaddress
    • snmp_version
    
    curl \
       -H "Accept: application/json" \
       -H "Content-Type: application/json" \
       -X GET \
       -u user:pword \
       "http://your.statseeker.server/api/v2.1/cdt_device/?fields=name,id,community,ipaddress,snmp_version&groups=AU_Servers&indent=3"
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "cdt_device/"
    
    # specify fields to be returned and filters to use
    getFields = "?fields=name,id,community,ipaddress,snmp_version&groups=AU_Servers"
    
    # optional response formatting
    rspFormat = "&indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + rspFormat
    
    # send request 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'cdt_device/'
    
    # set fields to return
    $fields = '?fields=name,id,community,ipaddress,snmp_version&groups=AU_Servers'
    
    
    # send request
    response = RestClient::Request.execute(
       :method => :get,
       :url => $baseUri + $targetEndpoint + $fields + $rspFormat, 
       :headers => { 
          :content_type => :json,
       },
       :user => $user,
       :password => $pword
    )
    #output response to screen
        puts "#{response.to_str}"
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "objects": [
          {
            "status": {
              "errcode": 0,
              "success": true
            },
            "data": [
              {
                "snmp_version": 2,
                "ipaddress": "10.116.4.172",
                "name": "Brisbane-Server1",
                "community": "public",
                "id": 551
              },
              {
                "snmp_version": 2,
                "ipaddress": "10.116.4.180",
                "name": "Brisbane-Server2",
                "community": "public",
                "id": 552
              },
              {
                "snmp_version": 2,
                "ipaddress": "10.116.4.186",
                "name": "Sydney-Server1",
                "community": "public",
                "id": 555
              },
              {
                "snmp_version": 2,
                "ipaddress": "10.116.4.187",
                "name": "Sydney-Server2",
                "community": "public",
                "id": 556
              },
              {
                "snmp_version": 2,
                "ipaddress": "10.116.4.194",
                "name": "Melbourne-Server1",
                "community": "public",
                "id": 557
              }
            ],
            "type": "cdt_device",
            "data_total": 5
          }
        ],
        "errmsg": "ok",
        "success": true,
        "time": 1496188135
      },
      "links": [
        {
          "link": "/api/v2.1/cdt_device?fields=name,id,community,ipaddress,snmp_version&groups=AU_Servers&indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/cdt_device/describe",
          "rel": "describedby"
        },
        {
          "link": "/api/v2.1/cdt_device/551",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/552",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/555",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/556",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/557",
          "rel": "item"
        }
      ],
      "api_version": "2.1"
    }
    
    

    Return details pertaining to the specified resource.

    Parameters Type/Valid Values Description
    fields A comma separated list of field names The list of fields that will be returned in the response. This parameter will be ignored if fields_adv is also specified.
    E.g. fields=id,name,location
    fields_adv A JSON string A JSON string detailing the fields to be returned, the formats to be used when returning time-series data, as well as any filtering options to be applied to the response data.
    E.g. fields_adv={"Device Name":{"field":"name"}, "IP":{"field":"ipaddress"},"Location":{"field":"sysLocation"},"SNMP Polling":{"field":"snmp_poll","filter":{"query":"=%27off%27"}}}
    limit Positive integer The number of items to return per 'page' of the response, see Pagination for details. The API will automatically paginate response data with a default limit=50.
    E.g. limit=100
    offset Positive integer The number of result items to skip, see Pagination for details. The API will automatically paginate response data with a default offset={limit}.
    E.g. offset=100
    groups A comma separated list of group names or group IDs A list of groups to be used to filter the response data, only data associated with members of the specified groups will be returned
    grouping_mode
    • AND
    • OR
    The mode to use when processing multiple group parameters, i.e. whether to use logical "and" or "or" operators when selecting multiple groups.
    filter An SQL filter string A filter to be applied to the response data
    E.g. Filter the results to only include those devices with SNMP polling set to "off":
    "SNMP Polling":{"field":"snmp_poll","filter":{"query":"=%27off%27"}}

    When the fields parameter has been specified, the following additional parameters may be used.

    Parameters Type/Valid Values Description
    {field}_formats Comma separated list, see Timeseries Data: Stats and Formats The formats to request from the API for the given field, required for timeseries data fields
    {field}_filter String The filter to apply to the given field
    {field}_filter_format String The format to use for the filter, required for timeseries data fields
    {field}_timefilter String The timefilter to use for the given field, required for timeseries data fields
    {field}_tz String The timezone to use for the {field}_timefilter
    {field}_sort Comma separated list Comma separated list specifying the sort hierarchy and direction, in the following format:
    {field}_sort={rank}{direction}
    and for Time-series data:
    {field}_sort={rank}{direction}{format}
    E.g. name_sort=1,ascRxUtil_sort=1,desc,avg
    {field}_states Comma separated list The states to use for the given field

    POST /{resource}

    Example: Creating Multiple Groups (named B1 and B2)

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X POST \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/group/?indent=3" \
        -d '{"data":[{"name":"B1"},{"name":"B2"}]}' 
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # api user credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "group/"
    
    # optional response formatting
    rspFormat = "?indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + rspFormat
    
    
    # data
    data = json.dumps({"data":[{"name":"B1"},{"name":"B2"}]})
    
    # send request 
    r = requests.post(url, headers=headers, auth=(user, pword), data=data)
    
    # print response to the screen
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http:/your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?indent=3'
    
    # set target endpoint
    $targetEndpoint = 'group/'
    
    
    # set payload in json format
    $group1 = {
       :name => 'B1',
     }
    $group2 = {
       :name => 'B2',
     }
    $jData = '{"data":[' + $group1.to_json + ',' + $group2.to_json + ']}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :post,
        :url => $baseUri + $targetEndpoint + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
        :payload => $jData
    )
    #output response to screen
        puts "#{response.to_str}"
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "objects": [
          {
            "status": {
              "errcode": 0,
              "success": true
            },
            "data": [
              {
                "name": "B1",
                "id": 46458
              },
              {
                "name": "B2",
                "id": 46459
              }
            ],
            "type": "group",
            "data_total": 2
          }
        ],
        "errmsg": "ok",
        "success": true,
        "time": 1496190459
      },
      "links": [
        {
          "link": "/api/v2.1/group?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/group/describe",
          "rel": "describedby"
        }
      ],
      "api_version": "2.1"
    }
    
    

    Use to create new instances of the specified resource. The data object included in a POST request must be a json string with a single data key. Some resource types will require additional keys within the data object, use the /describe endpoint to view the requirements for a given resource.

    PUT /{resource}

    Example: Updating a Group Name from B1 to Bangalore1.

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X PUT \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/group/?indent=3" \
        -d '{"fields":{"name":{"field":"name","filter":{"query":"=\u0027B1\u0027"}}},"data":[{"name":"Bangalore1"}]}'
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/group/"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # data contains both 'fields' key and a 'data' key
    data = json.dumps({"fields":{"name":{"field":"name","filter":{"query":"='B1'"}}},"data":[{"name":"Bangalore1"}]})
    
    # send request and 
    r = requests.put(url, headers=headers, auth=(user, pword), data=data)
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http:/your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?indent=3'
    
    # set target endpoint
    $targetEndpoint = 'group/'
    
    
    # set payload in json format
    $jData = '{"fields":{"name":{"field":"name","filter":{"query":"=\'B1\'"}}},"data":[{"name":"Bangalore1"}]}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :put,
        :url => $baseUri + $targetEndpoint + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
        :payload => $jData
    )
    #output response to screen
        puts "#{response.to_str}"
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "errmsg": "ok",
        "success": true,
        "time": 1496190511
      },
      "links": [
        {
          "link": "/api/v2.1/group?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/group/describe",
          "rel": "describedby"
        }
      ],
      "api_version": "2.1"
    }
    

    Use to update an existing instance of the specified resource.

    The data object included must be a json string with both a fields key (to identify the resource/s to be updated) and a data key (to specify the data to be updated). Some resource types will require additional keys within the data object, use the /describe endpoint to view the requirements for a given resource.

    DELETE /{resource}

    Example: Deleting Multiple Groups
    We will be deleting all groups with the name B followed by a single character, i.e. both groups we created in the previous POST example

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X DELETE \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/group/?indent=3" \ 
        -d '{"fields":{"name":{"field":"name","filter":{"query":"LIKE \u0027B_\u0027"}}}}'
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/group/"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # data
    data = json.dumps({"fields":{"name":{"field":"name","filter":{"query":"LIKE 'B_'"}}}})
    
    # send request and 
    r = requests.delete(url, headers=headers, auth=(user, pword), data=data)
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?indent=3'
    
    # set target endpoint
    $targetEndpoint = 'group/'
    
    
    # set payload in json format
    $jData = '{"fields":{"name":{"field":"name","filter":{"query":"LIKE \'B_\'"}}}}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :delete,
        :url => $baseUri + $targetEndpoint + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
        :payload => $jData
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "errmsg": "ok",
        "success": true,
        "time": 1496190845
      },
      "links": [
        {
          "link": "/api/v2.1/group?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/group/describe",
          "rel": "describedby"
        }
      ],
      "api_version": "2.1"
    }
    
    

    Use to delete an existing instance of the specified resource. The data object included must be a json string with a single fields key. Some resource types will require additional keys within the data object, use the /describe endpoint to view the requirements for a given resource.

    The Describe Endpoint /{resource}/describe

    The /describe endpoint is particularly useful as it allows you to query a specified resource to return details on the resource.

    The response from a GET request targeting the {resource}/describe endpoint will contain:

    The various HTTP request types are mapped to commands within the API.

    HTTP Request Method API Command
    GET get
    POST add
    PUT update
    DELETE delete

    GET /{resource}/describe

    Example: Requesting a /describe on the User Resource

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword \
        "http://your.statseeker.server1/api/v2.1/user/describe/?indent=3"
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/user/describe/"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request and 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?indent=3'
    
    # set target endpoint
    $targetEndpoint = 'user/describe/'
    
    # send request
    response = RestClient::Request.execute(
        :method => :get,
        :url => $baseUri + $targetEndpoint + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
    )
    
    #output response to screen
        puts "#{response.to_str}"
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "objects": [
          {
            "fields": {
              "tz": {
                "datatype": "string",
                "description": "User time zone",
                "title": "Time Zone"
              },
              "name": {
                "datatype": "string",
                "description": "User name",
                "title": "Name"
              },
              "auth": {
                "datatype": "string",
                "description": "User authentication method",
                "title": "Authentication method"
              },
              "email": {
                "datatype": "string",
                "description": "User email address",
                "title": "Email"
              },
              "api": {
                "datatype": "string",
                "description": "User API access permission",
                "title": "API Access"
              },
              "password": {
                "datatype": "string",
                "description": "User password",
                "title": "Password"
              },
              "id": {
                "datatype": "integer",
                "description": "User Identifier",
                "title": "ID"
              }
            },
            "commands": {
              "delete": {
                "valid_fields": {
                  "tz": {
                    "required": false
                  },
                  "name": {
                    "required": false
                  },
                  "auth": {
                    "required": false
                  },
                  "email": {
                    "required": false
                  },
                  "api": {
                    "required": false
                  },
                  "password": {
                    "required": false
                  },
                  "id": {
                    "required": false
                  }
                },
                "valid_data": null
              },
              "add": {
                "valid_fields": null,
                "valid_data": {
                  "tz": {
                    "required": false
                  },
                  "name": {
                    "required": true
                  },
                  "auth": {
                    "required": false
                  },
                  "api": {
                    "required": false
                  },
                  "password": {
                    "required": false
                  },
                  "email": {
                    "required": false
                  }
                }
              },
              "describe": {
                "valid_fields": null,
                "valid_data": null
              },
              "update": {
                "valid_fields": {
                  "tz": {
                    "required": false
                  },
                  "name": {
                    "required": false
                  },
                  "auth": {
                    "required": false
                  },
                  "email": {
                    "required": false
                  },
                  "api": {
                    "required": false
                  },
                  "password": {
                    "required": false
                  },
                  "id": {
                    "required": false
                  }
                },
                "valid_data": {
                  "api": {
                    "required": false
                  },
                  "password": {
                    "required": false
                  },
                  "tz": {
                    "required": false
                  },
                  "email": {
                    "required": false
                  },
                  "auth": {
                    "required": false
                  }
                }
              },
              "get": {
                "valid_fields": {
                  "tz": {
                    "required": false
                  },
                  "name": {
                    "required": false
                  },
                  "auth": {
                    "required": false
                  },
                  "email": {
                    "required": false
                  },
                  "api": {
                    "required": false
                  },
                  "password": {
                    "required": false
                  },
                  "id": {
                    "required": false
                  }
                },
                "valid_data": null
              }
            },
            "type": "user",
            "description": "Statseeker Users",
            "title": "User"
          }
        ],
        "errmsg": "ok",
        "success": true,
        "time": 1496190907
      },
      "links": [
        {
          "link": "/api/v2.1/user/describe?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/user",
          "rel": "collection"
        }
      ],
      "api_version": "2.1"
    }
    
    

    The parameters that may be passed when sending a GET request.

    Parameters Type/Valid Values Description
    links

    • only - only return the links object, no data object
    • none - only return the data object, no links object
    • html - return html links. If the response is being displayed in a browser then the links may be clicked to send a GET request for the associated object/field.
    • htmlonly - only return html links, no data object

    Modifies how the links contained within the response object are presented
    indent Positive integer Number of characters to indent when formatting code blocks for display

    The Execute Endpoint /api/v2.1/{resource}/execute

    The execute endpoint is used to run an execute command on a specific resource, currently this functionality is limited to:

    GET /{resource}/execute

    Example: Discovering a single device with the IP of 10.100.89.252.

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/discover/execute/?mode=single&ip=10.100.89.252&verbose=0&minimal=true&indent=3" 
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "discover/execute/"
    
    # specify fields to be returned and filters to use
    getFields = "?mode=single&ip=10.100.89.252&verbose=0&minimal=true"
    
    # optional response formatting
    rspFormat = "&indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + rspFormat
    
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request and 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'discover/execute/'
    
    # set feilds, filters etc
    $fields = '?mode=single&ip=10.100.89.252&verbose=0&minimal=true'
    
    # send request
    response = RestClient::Request.execute(
        :method => :get,
        :url => $baseUri + $targetEndpoint + $fields + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
    )
    
    #output response to screen
        puts "#{response.to_str}"
    
    {
        "info": "The Statseeker RESTful API",
        "data": {
            "objects": [{
                "status": {
                    "errcode": 0,
                    "success": true
                },
                "type": "discover"
            }],
            "errmsg": "ok",
            "success": true,
            "time": 1496191095
        },
        "links": [{
            "link": "/api/v2.1/discover/execute?mode=single&ip=10.100.89.252&verbose=0&minimal=true&indent=3",
            "rel": "self"
        }, {
            "link": "/api/v2.1",
            "rel": "base"
        }, {
            "link": "/api/v2.1/discover",
            "rel": "collection"
        }],
        "api_version": "2.1"
    }
    
    

    Will run the task associated with that resource, currently this functionality is limited to:

    ID Endpoint /{resource}/{id}

    Use to run queries against a specific resource instance, returning data relating that instance.

    GET /{resource}/{id}

    Example: Retrieving Details on a Device

    Return specified details on a device with id = 551. Details to retrieve are:

    • name
    • id
    • .community
    • .ipaddress
    • .snmp_version
    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/cdt_device/551/?fields=name,id,community,ipaddress,snmp_version&indent=3" 
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "cdt_device/551"
    
    # specify fields to be returned
    getFields = "?fields=name,id,community,ipaddress,snmp_version"
    
    # optional response formatting
    rspFormat = "&indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + rspFormat
    
    # send request 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability.
    $rspFormat = '&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'cdt_device/551'
    
    # set fields to return
    $fields = '?fields=name,id,community,ipaddress,snmp_version'
    
    # send request
    response = RestClient::Request.execute(
        :method => :get,
        :url => $baseUri + $targetEndpoint + $fields + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "objects": [
          {
            "status": {
              "errcode": 0,
              "success": true
            },
            "data": [
              {
                "snmp_version": 2,
                "ipaddress": "10.116.4.172",
                "name": "Brisbane-Server1",
                "community": "public",
                "id": 551
              }
            ],
            "type": "cdt_device",
            "data_total": 1
          }
        ],
        "errmsg": "ok",
        "success": true,
        "time": 1496191542
      },
      "links": [
        {
          "link": "/api/v2.1/cdt_device/551?fields=name,id,community,ipaddress,snmp_version&indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/cdt_device",
          "rel": "collection"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ping_poll",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/auth_pass",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/snmp_poll",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ping_state",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/sysObjectID",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/community",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/priv_pass",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/table",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/poll",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/id",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ping_rtt",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ping_outage",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ping_dup",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/hostname",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/memorySize",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/snmp_version",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/sysDescr",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ping_lost1",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/sysName",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ping_lost3",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ping_lost2",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ping_lost4",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/priv_method",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/ipaddress",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/auth_method",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/sysContact",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/name",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/idx",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/sysLocation",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/sysServices",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/snmpEngineID",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/deviceid",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/context",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/auth_user",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/cdt_device/551/snmp_maxoid",
          "rel": "item"
        }
      ],
      "api_version": "2.1"
    }
    
    
    Parameters Type/Valid Values Description
    fields A comma separated list The list of fields that will be returned in the response.
    E.g. fields=id,name,location
    fields_adv A JSON string The list of fields that will be returned in the response.
    E.g. fields_adv={"Device Name":{"field":"name"}, "IP":{"field":"ipaddress"},"Location":{"field":"sysLocation"},"SNMP Polling":{"field":"snmp_poll","filter":{"query":"=\u0027off\u0027"}}}
    limit Positive integer The number of items to return per 'page' of the response, see Pagination for details. The API will automatically paginate response data with a default limit=50.
    E.g. limit=100
    offset Positive integer The number of result items to skip, see Pagination for details. The API will automatically paginate response data with a default offset={limit}.
    E.g. offset=100
    groups A comma separated list A list of group names, or IDs, to be used to filter the response data. Only data associated with members of the specified groups will be returned.
    grouping_mode * and * or The mode to use when processing multiple group parameters
    filter An SQL filter string A filter to be applied to the response data
    E.g. "SNMP Polling":{"field":"snmp_poll","filter":{"query":"=\u0027off\u0027"}}

    When the fields parameter has been specified, the following additional parameters may be used.

    Parameters Type/Valid Values Description
    {field}_formats Comma separated list, see Timeseries Data: Stats and Formats The formats to request from the API for the given field, required for timeseries data
    {field}_timefilter String The timefilter to use for the given field, required for timeseries data
    {field}_tz String The timezone to use for the {field}_timefilter
    {field}_states Comma separated list The states to use for the given field

    PUT /{resource}/{id}

    Example: Updating a Group Name. The group, B1, has an id = 42579, we will rename this group to Bangalore1

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X PUT \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/group/42579/?indent=3" \
        -d '{"data":[{"name":"Bangalore1"}]}' 
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "group/42579/"
    
    # set data object
    data = json.dumps({"data":[{"name":"Bangalore1"}]})
    
    # optional response formatting
    rspFormat = "?indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + rspFormat
    
    # send request 
    r = requests.put(url, headers=headers, auth=(user, pword), data=data)
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability.
    $rspFormat = '?indent=3'
    
    # set target endpoint
    $targetEndpoint = 'group/42579/'
    
    # set payload in json format
    $jData = '{"data":[{"name":"Bangalore1"}]}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :put,
        :url => $baseUri + $targetEndpoint + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
         :payload => $jData
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "errmsg": "ok",
        "success": true,
        "time": 1496192693
      },
      "links": [
        {
          "link": "/api/v2.1/group/42579?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/group",
          "rel": "collection"
        },
        {
          "link": "/api/v2.1/group/42579/entities",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/group/42579/name",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/group/42579/id",
          "rel": "item"
        }
      ],
      "api_version": "2.1"
    }
    
    

    Use to update the fields associated with the specified resource.

    Not all fields contained within a specific resource may be updated, refer to this document, or use the /describe endpoint, to view the scope of a given resource.

    DELETE /{resource}/{id}

    Example: Deleting a group with id = 42579

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X DELETE \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/group/42579/?indent=3"
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # API root endpoint
    rootUri = "http:/your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "group/42579/"
    
    # optional response formatting
    rspFormat = "?indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + rspFormat
    
    # send request 
    r = requests.delete(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability.
    $rspFormat = '?indent=3'
    
    # set target endpoint
    $targetEndpoint = 'group/42579/'
    
    
    # send request
    response = RestClient::Request.execute(
        :method => :delete,
        :url => $baseUri + $targetEndpoint + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "errmsg": "ok",
        "success": true,
        "time": 1496192850
      },
      "links": [
        {
          "link": "/api/v2.1/group/42579?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/group",
          "rel": "collection"
        },
        {
          "link": "/api/v2.1/group/42579/entities",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/group/42579/name",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/group/42579/id",
          "rel": "item"
        }
      ],
      "api_version": "2.1"
    }
    
    

    Use to delete the specified resource.

    Field Endpoint /{resource}/{id}/{field}

    Use to run queries on a specific field within a resource. Use this document, or the /describe endpoint, to view the fields available for a given resource.

    GET /{resource}/{id}/{field}

    Example: Returning a user's (id = 42572) timezone

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/user/42572/tz/?indent=3"
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "user/42572/tz/"
    
    # optional response formatting
    rspFormat = "?indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + rspFormat
    
    # send request 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability.
    $rspFormat = '?indent=3'
    
    # set target endpoint
    $targetEndpoint = 'user/42572/tz/'
    
    # send request
    response = RestClient::Request.execute(
        :method => :get,
        :url => $baseUri + $targetEndpoint + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "objects": [
          {
            "status": {
              "errcode": 0,
              "success": true
            },
            "data": [
              {
                "tz": "Europe/London",
                "id": 42572
              }
            ],
            "type": "user",
            "data_total": 1
          }
        ],
        "errmsg": "ok",
        "success": true,
        "time": 1496193742
      },
      "links": [
        {
          "link": "/api/v2.1/user/42572/tz?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/user/42572",
          "rel": "collection"
        }
      ],
      "api_version": "2.1"
    }
    
    

    The parameters that may be passed when sending a GET request behave exactly like the {field}_* parameters for the Resource and ID endpoints.

    Parameters Type/Valid Values Description
    formats Comma separated list, see Timeseries Data: Stats and Formats The formats to request from the API for the given field, required for timeseries data
    timefilter String The timefilter to use for the given field, required for timeseries data
    tz String The timezone to use for the {field}_timefilter
    states Comma separated list The states to use for the given field

    PUT /{resource}/{id}/{field}

    Example: Updating a user's (id = 42572) timezone

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X PUT \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/user/42572/tz/?indent=3" \
        -d '{"value":"Europe/Paris"}'
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "user/42572/tz/"
    
    # optional response formatting
    rspFormat = "?indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + rspFormat
    
    # set data object
    data = json.dumps({"value":"Europe/Paris"})
    
    # send request 
    r = requests.put(url, headers=headers, auth=(user, pword), data=data)
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability.
    $rspFormat = '?indent=3'
    
    # set target endpoint
    $targetEndpoint = 'user/42572/tz/'
    
    # set payload in json format
    $jData = '{"value":"Europe/Paris"}'
    
    
    # send request
    response = RestClient::Request.execute(
        :method => :put,
        :url => $baseUri + $targetEndpoint + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
        :payload => $jData
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "errmsg": "ok",
        "success": true,
        "time": 1496193864
      },
      "links": [
        {
          "link": "/api/v2.1/user/42572/tz?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/user/42572",
          "rel": "collection"
        }
      ],
      "api_version": "2.1"
    }
    
    

    Used to update the specified field. The data object must contain a value key containing the new value/s to be set for the field. Not all fields contained within a specific resource may be updated, use this document, or the /describe endpoint, to view the restrictions for a given resource.

    API Resources refer to the data objects available at the resource level endpoint (/{resource}), and include:

    Users (/user)

    The User resource allows you to create, edit, delete, and report on Statseeker user records.

    GET /user

    Retrieving details of existing Statseeker users.

    Retrieving details of all user records

    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/user?fields=name,api,auth,email,tz&links=none"
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "statseekerpassword"
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "user/"
    
    # specify fields to be returned and filters to use
    getFields = "?fields=name,api,auth,email,tz"
    
    # optional response formatting
    rspFormat = "&links=none&indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + rspFormat
    
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request and 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    
    # api user credentials
    $user = 'username'
    $pword = 'statseekerpassword'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability.
    $rspFormat = '&links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'user/'
    
    # set fields to return
    $fields = '?fields=name,api,auth,email,tz'
    
    
    # send request
    response = RestClient::Request.execute(
        :method => :get,
        :url => $baseUri + $targetEndpoint + $fields + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    {
       "info":"The Statseeker RESTful API",
       "version":"2.1",
       "data":{
          "objects":[
             {
                "status":{
                   "errcode":0,
                   "success":true
                },
                "data":[
                   {
                      "tz":"Australia/Brisbane",
                      "name":"admin",
                      "auth":"File",
                      "email":null,
                      "api":"rw",
                      "id":2
                   },
                   {
                      "tz":"Australia/Brisbane",
                      "name":"UserTemplateEngineering",
                      "auth":"File",
                      "email":null,
                      "api":null,
                      "id":19393
                   },
                   {
                      "tz":"Australia/Brisbane",
                      "name":"EngUser1",
                      "auth":"File",
                      "email":null,
                      "api":null,
                      "id":19395
                   },
                   {
                      "tz":"Australia/Brisbane",
                      "name":"AllUser1",
                      "auth":"File",
                      "email":null,
                      "api":null,
                      "id":19405
                   },
                   {
                      "tz":"Australia/Brisbane",
                      "name":"demo_api",
                      "auth":"File",
                      "email":"demo@test.statseeker.com",
                      "api":"r",
                      "id":19407
                   }
                ],
                "type":"user",
                "data_total":5
             }
          ],
          "errmsg":"ok",
          "success":true,
          "time":1525140798
       },
       "revision":"2"
    }
    
    Field ID Type Description
    api String User API access permission
    auth String User authentication method
    email String User email address
    id Integer User Identifier
    name String User name
    tz String User time zone

    POST /user

    Creating a new Statseeker user.

    Creating a new Statseeker user

    
    curl \ 
        -H "Accept: application/json" \ 
        -H "Content-Type: application/json" \
        -X POST \
        -u user:pword "http://your.statseeker.server/api/v2.1/user/?indent=3&links=none" \
        -d '{"data":[{"name":"minerva","password":"transfiguration","auth":"File","email":"mmcgonagall@hogwarts.ac.uk","api":"r","tz":"Australia/Brisbane"}]}' 
    
    
    
    #!/usr/bin/python 
    
    # imprt urllib for handling the http connection
    # import base54 for encoding the authentication details
    # import json for parsing the response data
    import urllib2, base64, json
    
    # specify the api endpoint to be used
    endpoint = "http://your.statseeker.server/api/v2.1/user/?links=none"
    
    # encode  credentials
    user = "username"
    pword = "statseekerpassword"
    base64string = base64.encodestring('%s:%s' % (user, pword)).replace('\n', '')
    
    # data
    data = json.dumps({"data":[{"name":"minerva","password":"transfiguration","auth":"File","email":"mmcgonagall@hogwarts.ac.uk","api":"r","tz":"Australia/Brisbane"}]})
    
    # build the request
    request = urllib2.Request(endpoint, data)
    request.add_header("Accept", "application/json")
    request.add_header("Content-Type", "application/json")
    request.add_header("Authorization", "Basic %s" % base64string)   
    
    
    response = urllib2.urlopen(request)
    data = json.load(response)
    formatted_data = json.dumps(data, indent=3, sort_keys=True)
    
    # use pygments to pretty-up the onscreen output, omit when writing to another output
    from pygments import highlight, lexers, formatters
    colorful_json = highlight(unicode(formatted_data, 'UTF-8'), lexers.JsonLexer(), formatters.TerminalFormatter())
    print(colorful_json)
    
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?&links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'user/'
    
    # define payload in json format
    $jData = {
       :name => 'Minerva',
       :password => 'transfiguration',
       :auth => 'File',
       :email => 'mmcgonagall@hogwarts.ac.uk',
       :api => 'r',
       :tz => 'Australia/Brisbane'
     }
    
    # set the json content as the value for the 'data' key
    $jData = '{"data":[' + $jData.to_json + ']}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :post,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
        :payload => $jData
    )
    #output response to screen
    puts "#{response.to_str}"
    
    
    
    {
       "info":"The Statseeker RESTful API",
       "data":{
          "objects":[
             {
                "status":{
                   "errcode":0,
                   "success":true
                },
                "data":[
                   {
                      "tz":"Australia/Brisbane",
                      "name":"Minerva",
                      "auth":"File",
                      "id":46460,
                      "api":"r",
                      "password":"transfiguration",
                      "email":"mmcgonagall@hogwarts.ac.uk"
                   }
                ],
                "type":"user",
                "data_total":1
             }
          ],
          "errmsg":"ok",
          "success":true,
          "time":1496194842
       },
       "api_version":"2.1"
    }
    
    
    
    Field ID Type Description
    api String User API access permission
    auth String User authentication method
    email String User email address
    name String User name
    password String User password
    tz String User time zone

    PUT /user

    Editing a user record.

    Updating an existing user

    
    curl \ 
        -H "Accept: application/json" \ 
        -H "Content-Type: application/json" \
        -X PUT \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/user/46460?indent=3&links=none" \
        -d '{"data":[{"api":"r","tz":"Europe/London"}]}' 
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/user/46460/?links=none"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # data
    data = json.dumps({"data":[{"api":"rw","tz":"Europe/London"}]})
    
    # send request
    r = requests.put(url, headers=headers, auth=(user, pword), data=data)
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'user/46460'
    
    # set payload in json format
    $jData = {:tz => 'Europe/London'}
    $jData = '{"data":[' + $jData.to_json + ']}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :put,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => {:content_type => :json},
        :user => $user,
        :password => $pword,
        :payload => $jData,
        ) 
    
    #output response to screen
    puts "#{response.to_str}"
    
    
    
    {
       "info":"The Statseeker RESTful API",
       "data":{
          "errmsg":"ok",
          "success":true,
          "time":1496195083
       },
       "api_version":"2.1"
    }
    
    
    
    
    Field ID Type Description
    api String User API access permission
    auth String User authentication method
    email String User email address
    password String User password
    tz String User time zone

    delete /user

    Deleting an existing user (id = 26477).

    curl \ 
        -H "Accept: application/json" \ 
        -H "Content-Type: application/json" \
        -X DELETE \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/user/26477?links=none&indent=3' 
    
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/user/26477"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # send request
    r = requests.delete(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'user/26477'
    
    
    # send request
    response = RestClient::Request.execute(
        :method => :delete,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => {:content_type => :json},
        :user => $user,
        :password => $pword,
        ) 
    
    #output response to screen
    puts "#{response.to_str}"
    
    {
       "info":"The Statseeker RESTful API",
       "version":"2.1",
       "data":{
          "errmsg":"ok",
          "success":true,
          "time":1525219885
       },
       "revision":"5"
    }
    

    Deleting an existing user record.

    Devices (/cdt_device)

    The cdt_device resource allows you to interact with your network devices.

    GET /cdt_device

    Returning Details on all Ping-Only Devices

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword "http://your.statseeker.server/api/v2.1/cdt_device/?fields=name,ipaddress,sysLocation,snmp_poll,ping_poll&snmp_poll_filter=IS(%27off%27)&ping_poll_filter=IS(%27on%27)" 
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/cdt_device/?fields=name,ipaddress,sysLocation,snmp_poll,ping_poll&snmp_poll_filter=IS(\u0027off\u0027)&ping_poll_filter=IS(\u0027on\u0027)"
    
    # credentials
    user = "user"
    pword = "pword"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?&indent=3&links=none'
    
    # set target endpoint
    $targetEndpoint = 'cdt_device/'
    
    #specify fields to return
    $fields = '&fields=name,ipaddress,sysLocation,snmp_poll,ping_poll'
    
    #specify filters to only return the details on the devices you want
    $filters = '&snmp_poll_filter=IS(%27off%27)&ping_poll_filter=IS(%27on%27)'
    
    response = RestClient::Request.new({
          method: :get,
          url: $baseUri + $targetEndpoint + $rspFormat + $fields + $filters,
          user: $user,
          password: $pword,
        }).execute
        puts "#{response.to_str}"
    
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "objects": [
          {
            "status": {
              "errcode": 0,
              "success": true
            },
            "data": [
              {
                "snmp_poll": "off",
                "name": "Athens-swt2",
                "ping_poll": "on",
                "sysLocation": "Athens",
                "ipaddress": "10.100.59.252",
                "id": 315
              },
              {
                "snmp_poll": "off",
                "name": "Adelaide-swt1",
                "ping_poll": "on",
                "sysLocation": "Adelaide",
                "ipaddress": "10.100.89.253",
                "id": 425
              }
            ],
            "type": "cdt_device",
            "data_total": 2
          }
        ],
        "errmsg": "ok",
        "success": true,
        "time": 1496196534
      },
      "api_version": "2.1"
    }
    
    

    Get details on one or more network devices.
    You canRequest network infrastructure device configuration data, and timeseries metrics (raw or interpreted/processed).

    Field ID Type Description
    auth_method String Authentication method for SNMPv3 devices
    auth_pass String Authentication password for SNMPv3 devices
    auth_user String Authentication user for SNMPv3 devices
    community String The communtiy string status of the device
    context String Context for SNMPv3 devices
    deviceid Integer The ID of the parent device
    hostname String The hostname of the device
    id Integer The entity identifier
    idx String The SNMP index for this entity
    ipaddress String The IP address of the device
    memorySize Integer The amount of physical read-write memory contained by the entity
    name String The entity name
    ping_dup Integer Number of duplicate ping responses received
    Timeseries Data: Stats and Formats
    ping_lost1 Integer Number of times that a single ping request is lost
    Timeseries Data: Stats and Formats
    ping_lost2 Integer Number of times that two ping requests in a row have been lost
    Timeseries Data: Stats and Formats
    ping_lost3 Integer Number of times that three ping requests in a row have been lost
    Timeseries Data: Stats and Formats
    ping_lost4 Integer Number of times that four ping requests in a row have been lost
    Timeseries Data: Stats and Formats
    ping_outage Integer Number of seconds to wait before a device is considered to be down
    ping_poll String The ping polling status of the device
    ping_rtt Integer The current ping state of the device
    Timeseries Data: Stats and Formats
    ping_state String The current ping state of the device
    poll String The poll state of the entity
    priv_method String Privacy method for SNMPv3 devices
    priv_pass String Privacy password for SNMPv3 devices
    snmp_maxoid Integer Maximum nomber of oids to poll in a single request
    snmp_poll String The SNMP polling status of the device
    snmp_version Integer The SNMP version of the device
    snmpEngineID String An SNMP engine's administratively-unique identifier
    sysContact String The textual identification of the contact person for the entity
    sysDescr String A textual description of the entity
    sysLocation String The physical location of the entity
    sysName String An administratively-assigned name for the entity
    sysObjectID String The vendor's authoritative identification of the network management subsystem contained in the entity
    sysServices String A value which indicates the set of services that the entity may potentially offer
    table String The table to which the entity belongs

    GET /cdt_device/{id}

    Return ping times for the last 15 minutes as well as the average ping trip time for that period, from a network device (id = 425).

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword "http://your.statseeker.server/api/v2.1/cdt_device/cdt_device/426?fields=name,ping_rtt&ping_rtt_formats=avg,vals&ping_rtt_timefilter=range%3Dnow%20-%2015m%20TO%20now%20-1m&links=none" 
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/cdt_device/426?fields=name,ping_rtt&ping_rtt_formats=avg,vals&ping_rtt_timefilter=range%3Dnow%20-%2015m%20TO%20now%20-1m&links=none"
    
    # credentials
    user = "user"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability
    $rspFormat = '&links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'cdt_device/426'
    
    # set fields to return
    $fields = '?fields=name,ping_rtt'
    
    # set formats for time-series data
    $tsFormats = '&ping_rtt_formats=avg,vals'
    
    # set time-filter for time-series data
    $tsTimeFilter = '&ping_rtt_timefilter=range%3Dnow%20-%2015m%20TO%20now%20-1m'
    
    # send request
    response = RestClient::Request.execute(
        :method => :get,
        :url => $baseUri + $targetEndpoint + $fields + $tsFormats + $tsTimeFilter + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "objects": [
          {
            "status": {
              "errcode": 0,
              "success": true
            },
            "data": [
              {
                "ping_rtt": {
                  "vals": [
                    67,
                    62,
                    47,
                    27,
                    53,
                    56,
                    70,
                    50,
                    60,
                    21,
                    21,
                    87,
                    67,
                    62,
                    42
                  ],
                  "avg": 52.8
                },
                "id": 426,
                "name": "Adelaide-rtr"
              }
            ],
            "type": "cdt_device",
            "data_total": 1
          }
        ],
        "errmsg": "ok",
        "success": true,
        "time": 1496203449
      },
      "api_version": "2.1"
    }
    
    

    Get details on a single, specified, network device.

    Field ID Type Description
    auth_method String Authentication method for SNMPv3 devices
    auth_pass String Authentication password for SNMPv3 devices
    auth_user String Authentication user for SNMPv3 devices
    community String The communtiy string status of the device
    context String Context for SNMPv3 devices
    deviceid Integer The ID of the parent device
    hostname String The hostname of the device
    id Integer The entity identifier
    idx String The SNMP index for this entity
    ipaddress String The IP address of the device
    memorySize Integer The amount of physical read-write memory contained by the entity
    name String The entity name
    ping_dup Integer Number of duplicate ping responses received
    Timeseries Data: Stats and Formats
    ping_lost1 Integer Number of times that a single ping request is lost
    Timeseries Data: Stats and Formats
    ping_lost2 Integer Number of times that two ping requests in a row have been lost
    Timeseries Data: Stats and Formats
    ping_lost3 Integer Number of times that three ping requests in a row have been lost
    Timeseries Data: Stats and Formats
    ping_lost4 Integer Number of times that four ping requests in a row have been lost
    Timeseries Data: Stats and Formats
    ping_outage Integer Number of seconds to wait before a device is considered to be down
    ping_poll String The ping polling status of the device
    ping_rtt Integer The current ping state of the device
    Timeseries Data: Stats and Formats
    ping_state String The current ping state of the device
    poll String The poll state of the entity
    priv_method String Privacy method for SNMPv3 devices
    priv_pass String Privacy password for SNMPv3 devices
    snmp_maxoid Integer Maximum nomber of oids to poll in a single request
    snmp_poll String The SNMP polling status of the device
    snmp_version Integer The SNMP version of the device
    snmpEngineID String An SNMP engine's administratively-unique identifier
    sysContact String The textual identification of the contact person for the entity
    sysDescr String A textual description of the entity
    sysLocation String The physical location of the entity
    sysName String An administratively-assigned name for the entity
    sysObjectID String The vendor's authoritative identification of the network management subsystem contained in the entity
    sysServices String A value which indicates the set of services that the entity may potentially offer
    table String The table to which the entity belongs

    POST /cdt_device

    Returning Details on all Ping-Only Devices

    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X POST \
        -u user:pword "http://your.statseeker.server/api/v2.1/cdt_device/?links=none&indent=3" \
        -d '{"data":[{"ipaddress":"10.100.46.250","hostname":"Chicago-swt4","snmp_version":2,"community":"public"}]}'
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/group"
    
    # credentials
    user = "user"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # data, this is the name of group that will be created
    data = json.dumps({"data":[{"ipaddress":"10.100.46.250","hostname":"Chicago-swt4","snmp_version":2,"community":"public"}]})
    
    # send request 
    r = requests.post(url, headers=headers, auth=(user, pword), data=data)
    
    # display the response status code
    print(r.status_code)
    
    # display the contents of the response object
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'cdt_device/'
    
    # set payload in json format
    $jData = {
       :ipaddres => '10.100.46.250',
       :hostname => 'Chicago-swt4',
       :snmp_version => '2',
       :community > 'public'
     }
    $jData = '{"data":[' + $jData.to_json + ']}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :post,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
        :payload => $jData
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    {
       "info":"The Statseeker RESTful API",
       "version":"2.1",
       "data":{
          "objects":[
             {
                "status":{
                   "errcode":0,
                   "success":true
                },
                "data":[
                   {
                      "snmp_version":2,
                      "hostname":"Chicago-swt4",
                      "ipaddress":"10.100.46.250",
                      "id":26525,
                      "community":"public"
                   }
                ],
                "type":"cdt_device",
                "data_total":1
             }
          ],
          "errmsg":"ok",
          "success":true,
          "time":1526005692
       },
       "revision":"5"
    }
    

    Add a new network device to Statseeker.
    This allows you to add a device configuration to Statseeker, but the new device will not be polled (no data collected) until after the device has been discovered or a rewalk run.

    Field ID Type Description
    auth_method String Authentication method for SNMPv3 devices
    auth_pass String Authentication password for SNMPv3 devices
    auth_user String Authentication user for SNMPv3 devices
    community String The communtiy string status of the device
    context String Context for SNMPv3 devices
    hostname String The hostname of the device
    ipaddress String The IP address of the device
    ping_poll String The ping polling status of the device
    priv_method String Privacy method for SNMPv3 devices
    priv_pass String Privacy password for SNMPv3 devices
    snmp_poll String The SNMP polling status of the device
    snmp_version Integer The SNMP version of the device

    PUT /cdt_device/{id}

    Configuring a device (id = 425) as Ping-Only

    
    curl \ 
        -H "Accept: application/json" \ 
        -H "Content-Type: application/json" \
        -X PUT \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/cdt_device/425/?links=none&indent=3" \
        -d '{"data":[{"ping_poll":"on","snmp_poll":"off"}]}'
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/cdt_device/425/?links=none"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # data, the key:value pair to be used to turn ping polling on and SNMP polling off
    data = json.dumps({"data":[{"ping_poll":"on","snmp_poll":"off"}]}
    
    # send request 
    r = requests.put(url, headers=headers, auth=(user, pword), data=data)
    
    # display the response status code
    print(r.status_code)
    
    # display the contents of the response object
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'cdt_device/425'
    
    # set payload in json format
    $jData = {
        :'ping_poll' => "on",
        :'snmp_poll' => "off"
    }
    
    $jData = '{"data":[' + $jData.to_json + ']}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :put,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => {:content_type => :json},
        :user => $user,
        :password => $pword,
        :payload => $jData,
        ) 
    
    #output response to screen
    puts "#{response.to_str}"
    
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "errmsg": "ok",
        "success": true,
        "time": 1496195512
      },
      "api_version": "2.1"
    }
    
    
    
    Field ID Type Description
    auth_method String Authentication method for SNMPv3 devices
    auth_pass String Authentication password for SNMPv3 devices
    auth_user String Authentication user for SNMPv3 devices
    community String The communtiy string status of the device
    context String Context for SNMPv3 devices
    hostname String The hostname of the device
    ipaddress String The IP address of the device
    ping_poll String The ping polling status of the device
    poll String The poll state of the entity
    priv_method String Privacy method for SNMPv3 devices
    priv_pass String Privacy password for SNMPv3 devices
    snmp_maxoid Integer Maximum nomber of oids to poll in a single request
    snmp_poll String The SNMP polling status of the device
    snmp_version Integer The SNMP version of the device
    snmpEngineID String An SNMP engine's administratively-unique identifier
    sysContact String The textual identification of the contact person for the entity
    sysDescr String A textual description of the entity
    sysLocation String The physical location of the entity
    sysName String An administratively-assigned name for the entity
    sysObjectID String The vendor's authoritative identification of the network management subsystem contained in the entity
    sysServices String A value which indicates the set of services that the entity may potentially offer

    DELETE /cdt_device/{id}

    Deleting a device (id = 423)

    
    curl \ 
        -H "Accept: application/json" \ 
        -H "Content-Type: application/json" \
        -X DELETE \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/cdt_device/423/?links=none&indent=3" \
    
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/cdt_device/423/?links=none"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # send request 
    r = requests.delete(url, headers=headers, auth=(user, pword))
    
    # display the response status code
    print(r.status_code)
    
    # display the contents of the response object
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'cdt_device/423'
    
    
    $jData = '{"data":[' + $jData.to_json + ']}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :delete,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => {:content_type => :json},
        :user => $user,
        :password => $pword,
        ) 
    
    #output response to screen
    puts "#{response.to_str}"
    
    
    {
    
        "info":"The Statseeker RESTful API",
        "version":"2.1",
        "data":{
            "errmsg":"ok",
            "success":true,
            "time":1525228586
        },
        "revision":"5"
    
    }
    
    
    
    

    Delete a previously discovered network device.

    Interfaces (/cdt_port)

    The cdt_port resource allows you to interact with the network interfaces being monitored by Statseeker.

    GET /cdt_port

    Field ID Type Description
    deviceid Integer The ID of the parent device
    id Integer The entity identifier
    idx String The SNMP index for this entity
    if90day Integer Status of port usage over 90 days
    ifAlias String Interface Alias (ifAlias)
    ifDescr String Interface Description (ifDescr)
    ifDuplex String Interface Duplex. (half/full/auto)
    ifIndex String Interface Index (IF-MIB.ifIndex)
    ifInSpeed Integer Interface Input Speed (Statseeker custom attribute)
    ifName String Interface Name (IF-MIB.ifName)
    ifNonUnicast String NonUnicast Polling status of the port
    ifOperStatus String Current operational status of port
    ifOutSpeed Integer Interface Output Speed (Statseeker custom attribute)
    ifPhysAddress String Interface MAC Address (ifPhysAddress)
    ifPoll String Polling status of the port
    ifSpeed Integer Interface Speed (based on ifSpeed or ifHighSpeed)
    ifTitle String Interface Title (Statseeker custom attribute - ifTitle)
    ifType String Interface Type (ifType)
    InBroadcastPkts Integer Number of received broadcast packets
    Timeseries Data: Stats and Formats
    InBroadcastPps Float Number of received broadcast packets per second
    Timeseries Data: Stats and Formats
    InErrors Integer Number of received errors
    Timeseries Data: Stats and Formats
    InMulticastPkts Integer Number of received multicast packets
    Timeseries Data: Stats and Formats
    InMulticastPps Float Number of received multicast packets per second
    Timeseries Data: Stats and Formats
    InOctets Integer Number of received bytes
    Timeseries Data: Stats and Formats
    InOutBroadcastPkts Integer Combined Rx and Tx broadcast packets
    Timeseries Data: Stats and Formats
    InOutDiscards Integer Combined Rx and Tx Discards
    Timeseries Data: Stats and Formats
    InOutErrors Integer Combined Rx and Tx Errors
    Timeseries Data: Stats and Formats
    InOutMulticastPkts Integer Combined Rx and Tx multicast packets
    Timeseries Data: Stats and Formats
    InOutOctets Integer Combined Rx and Tx Bytes
    Timeseries Data: Stats and Formats
    InOutSpeed Integer Combined Rx and Tx Speed
    InOutUcastPkts Integer Combined Rx and Tx unicast packets
    Timeseries Data: Stats and Formats
    InUcastPkts Integer Number of received unicast packets
    Timeseries Data: Stats and Formats
    InUcastPps Float Number of received unicast packets per second
    Timeseries Data: Stats and Formats
    name String The entity name
    OutBroadcastPkts Integer Number of transmitted broadcast packets
    Timeseries Data: Stats and Formats
    OutBroadcastPps Float Number of transmitted broadcast packets per second
    Timeseries Data: Stats and Formats
    OutErrors Integer Number of transmitted errors
    Timeseries Data: Stats and Formats
    OutMulticastPkts Integer Number of transmitted multicast packets
    Timeseries Data: Stats and Formats
    OutMulticastPps Float Number of transmitted multicast packets per second
    Timeseries Data: Stats and Formats
    OutOctets Integer Number of transmitted bytes
    Timeseries Data: Stats and Formats
    OutUcastPkts Integer Number of transmitted unicast packets
    Timeseries Data: Stats and Formats
    OutUcastPps Float Number of transmitted unicast packets per second
    Timeseries Data: Stats and Formats
    poll String The poll state of the entity
    RxBps Float Received bits per second
    Timeseries Data: Stats and Formats
    RxDiscardsPercent Float Rx discards percentage
    Timeseries Data: Stats and Formats
    RxErrorPercent Float Rx errors percentage
    Timeseries Data: Stats and Formats
    RxTxDiscardsPercent Float Total discards percentage
    Timeseries Data: Stats and Formats
    RxTxErrorPercent Float Total errors percentage
    Timeseries Data: Stats and Formats
    RxUtil Float Rx Utilisation
    Timeseries Data: Stats and Formats
    table String The table to which the entity belongs
    TxBps Float Transmitted bits per second
    Timeseries Data: Stats and Formats
    TxDiscardsPercent Float Tx discards percentage
    Timeseries Data: Stats and Formats
    TxErrorPercent Float Tx errors percentage
    Timeseries Data: Stats and Formats
    TxUtil Float Tx Utilisation
    Timeseries Data: Stats and Formats

    Example 1

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword "http://your.statseeker.server/api/v2.1/cdt_port/?fields=deviceid,id,name,RxTxDiscardsPercent,TxUtil,RxUtil&RxUtil_sort=1,desc,avg&deviceid_filter=IS(%22426%22)&RxUtil_formats=95th,avg,min&TxUtil_formats=95th,avg,min&RxTxDiscardsPercent_formats=total&RxTxDiscardsPercent_timefilter=range=start_of_today%20to%20now&RxUtil_timefilter=range=start_of_today%20to%20now&TxUtil_timefilter=range=start_of_today%20to%20now&links=none"
    
    
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    
    # credentials
    user = "username"
    pword = "password"
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "cdt_port/"
    
    # specify fields to be returned and filters to use
    getFields = "?fields=deviceid,id,name,RxTxDiscardsPercent,TxUtil,RxUtil"
    
    # specifty data formats for each metric
    dataFormats = "&RxUtil_formats=95th,avg,min&TxUtil_formats=95th,avg,min&RxTxDiscardsPercent_formats=total"
    
    #specify time filters, one for each time-series metric being requested
    timeFilters = "&RxTxDiscardsPercent_timefilter=range=start_of_today to now&RxUtil_timefilter=range=start_of_today to now&TxUtil_timefilter=range=start_of_today to now"
    
    # specify data filters to select only those devices\interfaces you want to report on
    dataFilters = "&deviceid_filter=IS('426')"
    
    # optionally specify sorting of the response contents
    sorting = "&RxUtil_sort=1,desc,avg"
    
    # optional response formatting
    rspFormat = "&indent=3&links=none"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + dataFormats + timeFilters + dataFilters + sorting + rspFormat
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request and 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability.
    $rspFormat = '&links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'cdt_port/'
    
    # set fields to return
    $fields = '?fields=deviceid,id,name,RxTxDiscardsPercent,TxUtil,RxUtil'
    
    # set formats for time-series data
    $tsFormats = '&RxUtil_formats=95th,avg,min&TxUtil_formats=95th,avg,min&RxTxDiscardsPercent_formats=total'
    
    # set time-filter for time-series data
    $tsTimeFilter = '&RxTxDiscardsPercent_timefilter=range=start_of_today to now&RxUtil_timefilter=range=start_of_today to now&TxUtil_timefilter=range=start_of_today to now'
    
    # specify data filters to select only those devices\interfaces you want to report on
    $dataFilters = "&deviceid_filter=IS('426')"
    
    # optionally specify sorting of the response contents
    $sorting = "&RxUtil_sort=1,desc,avg"
    
    # send request
    response = RestClient::Request.execute(
        :method => :get,
        :url => $baseUri + $targetEndpoint + $fields + $tsFormats + $tsTimeFilter + $dataFilters + $sorting + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    
    
    {
    
        "info":"The Statseeker RESTful API",
        "version":"2.1",
        "data":{
            "objects":[
                {
                    "status":{
                        "errcode":0,
                        "success":true
                    },
                    "data":[
                        {
                            "name":"Gi0/1",
                            "RxTxDiscardsPercent":{
                                "total":0
                            },
                            "deviceid":426,
                            "TxUtil":{
                                "avg":1.75023,
                                "95th":1.75023,
                                "min":1.75023
                            },
                            "RxUtil":{
                                "avg":24.8631,
                                "95th":38.1318,
                                "min":1.83953
                            },
                            "id":16747
                        },
                        {
                            "name":"Gi0/2",
                            "RxTxDiscardsPercent":{
                                "total":0.0126891
                            },
                            "deviceid":426,
                            "TxUtil":{
                                "avg":1.81332,
                                "95th":1.81332,
                                "min":1.81332
                            },
                            "RxUtil":{
                                "avg":22.1316,
                                "95th":38.7839,
                                "min":2.18792
                            },
                            "id":16748
                        },
                        {
                            "name":"Gi0/3",
                            "RxTxDiscardsPercent":{
                                "total":0
                            },
                            "deviceid":426,
                            "TxUtil":{
                                "avg":34.1365,
                                "95th":34.1365,
                                "min":34.1365
                            },
                            "RxUtil":{
                                "avg":15.8552,
                                "95th":38.6894,
                                "min":0.983334
                            },
                            "id":16746
                        }
                    ],
                    "type":"cdt_port",
                    "data_total":3
                }
            ],
            "errmsg":"ok",
            "success":true,
            "time":1508455952
        },
        "revision":"2"
    
    }
    
    

    Requesting Time-series Data from all Interfaces on a Device

    Example 2

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword "http://your.statseeker.server/api/v2.1/cdt_port/?fields=deviceid,id,name,RxUtil&RxUtil_formats=vals,avg&RxUtil_timefilter=range=now%20-%2030m%20to%20now%20-%201m&RxUtil_sort=1,desc,avg&limit=10&links=none&indent=3"
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "cdt_port/"
    
    # specify fields to be returned and filters to use
    getFields = "?fields=deviceid,id,name,RxUtil"
    
    # specify data filters to select only those devices\interfaces you want to report on
    # we want the top 10 across the network so no restrictions are applied
    dataFilters = "" 
    
    # set formats for time-series data
    dataFormats = "&RxUtil_formats=vals,avg"
    
    #specify time filters, one for each time-series metric being requested
    timeFilters = "&RxUtil_timefilter=range=now - 30m to now - 1m"
    
    
    # optionally specify sorting of the response contents
    sorting = "&RxUtil_sort=1,desc,avg"
    
    # use the 'limit' parameter to only return the 'top-10' interfaces
    limit = "&limit=10"
    
    # optional response formatting, usefull when viewing the response data directly
    rspFormat = "&indent=3&links=none"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + dataFormats + timeFilters + dataFilters + sorting + limit + rspFormat
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request and 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability.
    $rspFormat = '&indent=3&links=none'
    
    # set target endpoint
    $targetEndpoint = 'cdt_port/'
    
    # set fields to return
    $fields = '?fields=deviceid,id,name,RxUtil'
    
    # set formats for time-series data
    $tsFormats = '&RxUtil_formats=vals,avg'
    
    # set time-filter for time-series data. 
    # The range end-point of 'now - 1m' is used because the metrics have a 1minute polling interval
    # and this ensures that the only 'null' value you see will be because the interface was unreachable
    $tsTimeFilter = '&RxUtil_timefilter=range=now - 30m to now - 1m'
    
    # specify data filters to select only those devices\interfaces you want to report on
    $dataFilters = "" # we want the top 10 across the network so no restrictions are applied
    
    # optionally specify sorting of the response contents
    $sorting = "&RxUtil_sort=1,desc,avg"
    
    # use the 'limit' parameter to only return the "top-10" interfaces
    $limit = "&limit=10"
    
    # Optional: the indent parameter is used to format the contents of the response object for readability when viewing it directly.
    $rspFormat = '&indent=3'
    
    # send request
    response = RestClient::Request.execute(
        :method => :get,
        :url => $baseUri + $targetEndpoint + $fields + $tsFormats + $tsTimeFilter + $dataFilters + $sorting + $limit + $rspFormat, 
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword
    )
    #output response to screen
        puts "#{response.to_str}"
    
    {
       "info":"The Statseeker RESTful API",
       "data":{
          "objects":[
             {
                "status":{
                   "errcode":0,
                   "success":true
                },
                "data":[
                   {
                      "id":29563,
                      "RxUtil":{
                         "vals":[
                            97.353318,
                            98.333321,
                            98.333355,
                            98.333321,
                            98.333355,
                            98.333321,
                            98.333321,
                            98.333355,
                            98.333321,
                            98.333321,
                            98.333355,
                            98.333321,
                            98.333355,
                            98.333321,
                            98.333321,
                            98.333355,
                            98.333321,
                            98.333321,
                            98.333355,
                            98.333321,
                            98.333355,
                            98.333321,
                            98.333321,
                            98.333355,
                            98.333321,
                            33.598908,
                            2.946662,
                            1.96666,
                            1.96666,
                            1.96666,
                            null
                         ],
                         "avg":83.326629
                      },
                      "deviceid":722,
                      "name":"Fa1/0/11"
                   },
                   {
                      "id":21079,
                      "RxUtil":{
                         "vals":[
                            null,
                            null,
                            null,
                            0.733321,
                            1.970551,
                            1.96666,
                            1.96806,
                            1.9655,
                            61.120341,
                            93.431091,
                            98.138897,
                            98.40343,
                            98.273485,
                            96.89914,
                            98.093909,
                            98.330044,
                            98.40343,
                            98.273485,
                            98.323081,
                            98.357487,
                            96.892518,
                            98.157705,
                            98.269184,
                            98.323115,
                            96.861116,
                            96.714923,
                            98.165009,
                            98.269184,
                            97.118549,
                            null,
                            null
                         ],
                         "avg":77.82397
                      },
                      "deviceid":650,
                      "name":"Gi5/0/2"
                   },
                   {
                      "id":26985,
                      "RxUtil":{
                         "vals":[
                            78.089353,
                            77.616128,
                            78.631117,
                            76.065075,
                            78.1383,
                            78.219947,
                            77.101124,
                            77.941316,
                            76.814711,
                            76.372002,
                            76.342886,
                            78.589201,
                            78.318353,
                            75.934788,
                            78.174515,
                            78.652928,
                            78.66665,
                            78.23616,
                            78.164378,
                            78.649856,
                            77.734059,
                            78.634496,
                            77.55322,
                            77.804271,
                            77.023812,
                            77.879228,
                            78.531652,
                            78.662895,
                            78.354569,
                            75.855428,
                            null
                         ],
                         "avg":77.758414
                      },
                      "deviceid":768,
                      "name":"Fa0/11"
                   },
                   {
                      "id":2153,
                      "RxUtil":{
                         "vals":[
                            77.879378,
                            78.645176,
                            78.472308,
                            78.324074,
                            77.934708,
                            78.003268,
                            76.706908,
                            78.441755,
                            78.457904,
                            77.495487,
                            77.438317,
                            78.463362,
                            78.642162,
                            76.651233,
                            75.663295,
                            77.003704,
                            78.612811,
                            78.666667,
                            77.964885,
                            78.089994,
                            76.432551,
                            76.621541,
                            77.322342,
                            77.968326,
                            78.639524,
                            76.891266,
                            78.605452,
                            78.159705,
                            76.332974,
                            75.956541,
                            null
                         ],
                         "avg":77.682921
                      },
                      "deviceid":193,
                      "name":"Gi2/9"
                   },
                   {
                      "id":30714,
                      "RxUtil":{
                         "vals":[
                            78.378837,
                            77.216051,
                            77.774848,
                            78.250837,
                            78.413653,
                            77.414912,
                            76.972305,
                            75.873314,
                            75.985954,
                            76.082449,
                            77.847927,
                            78.408704,
                            77.073271,
                            77.051699,
                            77.176969,
                            78.489361,
                            78.178372,
                            77.651217,
                            76.894208,
                            75.770231,
                            76.025481,
                            78.544623,
                            77.828301,
                            76.919979,
                            77.714398,
                            78.058291,
                            77.401463,
                            78.448674,
                            78.660608,
                            77.377809,
                            null
                         ],
                         "avg":77.462825
                      },
                      "deviceid":736,
                      "name":"Fa0/12"
                   },
                   {
                      "id":32488,
                      "RxUtil":{
                         "vals":[
                            78.666667,
                            77.681411,
                            78.649965,
                            77.918768,
                            77.835783,
                            78.136419,
                            78.657915,
                            78.666667,
                            77.556671,
                            77.698768,
                            78.65058,
                            77.047634,
                            78.183516,
                            76.413143,
                            77.231838,
                            78.616013,
                            78.666209,
                            77.76911,
                            77.184198,
                            78.366263,
                            78.661997,
                            78.281288,
                            76.563436,
                            76.747076,
                            77.343816,
                            76.841581,
                            78.149697,
                            74.802487,
                            73.349519,
                            71.561926,
                            null
                         ],
                         "avg":77.396679
                      },
                      "deviceid":504,
                      "name":"Gi1/0/16"
                   },
                   {
                      "id":1222,
                      "RxUtil":{
                         "vals":[
                            78.530976,
                            77.956594,
                            78.375567,
                            77.507376,
                            76.084442,
                            76.514266,
                            76.954808,
                            74.880109,
                            76.439272,
                            77.474041,
                            77.932247,
                            78.033316,
                            78.494515,
                            76.779599,
                            76.656719,
                            76.937441,
                            77.243375,
                            75.835696,
                            76.689077,
                            77.242153,
                            77.190902,
                            78.264644,
                            78.571008,
                            78.299546,
                            78.534513,
                            77.537133,
                            77.445396,
                            77.291124,
                            78.354357,
                            null,
                            null
                         ],
                         "avg":77.381042
                      },
                      "deviceid":181,
                      "name":"Gi6/14"
                   },
                   {
                      "id":2367,
                      "RxUtil":{
                         "vals":[
                            75.345319,
                            72.656756,
                            75.870433,
                            76.828785,
                            77.157243,
                            78.425364,
                            78.382909,
                            77.940521,
                            78.666667,
                            78.509274,
                            78.666667,
                            76.552834,
                            75.042799,
                            75.456802,
                            76.97282,
                            77.577503,
                            78.666667,
                            77.973961,
                            78.303082,
                            78.666667,
                            78.666667,
                            78.578442,
                            77.122372,
                            77.807718,
                            78.349674,
                            78.666667,
                            75.400096,
                            75.585894,
                            76.855112,
                            75.512914,
                            null
                         ],
                         "avg":77.206954
                      },
                      "deviceid":194,
                      "name":"Gi1/2"
                   },
                   {
                      "id":8584,
                      "RxUtil":{
                         "vals":[
                            77.97561,
                            77.722791,
                            78.344943,
                            78.613883,
                            78.664646,
                            78.666667,
                            78.666667,
                            77.602772,
                            78.556662,
                            78.216841,
                            78.377274,
                            77.442608,
                            78.457279,
                            77.771411,
                            77.199537,
                            77.481598,
                            78.188029,
                            78.633206,
                            78.02423,
                            77.377352,
                            78.175635,
                            76.745137,
                            73.567222,
                            74.380114,
                            75.384805,
                            75.878438,
                            77.238695,
                            76.509566,
                            73.208392,
                            70.963183,
                            null
                         ],
                         "avg":77.134506
                      },
                      "deviceid":348,
                      "name":"Gi2/5"
                   },
                   {
                      "id":1172,
                      "RxUtil":{
                         "vals":[
                            73.424889,
                            75.522717,
                            77.631222,
                            77.567205,
                            76.931232,
                            78.30398,
                            77.503891,
                            78.501185,
                            76.385164,
                            76.613239,
                            77.881423,
                            78.121247,
                            78.517736,
                            76.777161,
                            76.041178,
                            77.744862,
                            78.136419,
                            78.587361,
                            78.299412,
                            77.030403,
                            77.428207,
                            78.472315,
                            78.093322,
                            78.513009,
                            77.583797,
                            77.041094,
                            76.691593,
                            74.894807,
                            72.629668,
                            null,
                            null
                         ],
                         "avg":77.133439
                      },
                      "deviceid":181,
                      "name":"Gi4/20"
                   }
                ],
                "type":"cdt_port",
                "data_total":36854
             }
          ],
          "errmsg":"ok",
          "success":true,
          "time":1496277485
       },
       "api_version":"2.1"
    }
    

    Return the 10 Most Congested Interfaces (inbound) over the Last 30mins

    For each of these interfaces, return:

    PUT /cdt_port

    In this example we will turn off a specified interface, but we will start with only knowing the device and interface name:

    • Start with a device name and an interface name (NewYork-Floor53-Switch1 Fa0/36)
    • Use the device name to get the device ID (751)
    • Use the device ID, with the interface name, to get the interface ID (31619)
    • Use the interface ID to update the polling status of the interface
    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword "http://your.statseeker.server/api/v2.1/cdt_device/?fields=id,name&name_filter=IS(%27NewYork-Floor53-Switch1%27)&indent=3"
    
    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword "http://your.statseeker.server/api/v2.1/cdt_port/?fields=id,name,deviceid&name_filter=IS(%27Fa0/36%27)&deviceid_filter=IS(%27751%27)&indent=3"
    
    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X PUT \
        -u user:pword "http://your.statseeker.server/api/v2.1/cdt_port/31619/?indent=3"
        -d '{"data":[{%27poll%27:%27off%27}]}'
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    
    # Specify device and interface name
    deviceName = "NewYork-Floor53-Switch1"
    interfaceName = "Fa0/36"
    
    # specify the api endpoint to be used and return the device ID
    url = "http://your.statseeker.server/api/v2.1/cdt_device/?fields=id,name&name_filter=IS('" + deviceName + "')"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request to get deviceId
    r = requests.get(url, headers=headers, auth=(user, pword))
    
    # print request response code to screen
    print("GET deviceId:" + str(r.status_code))
    
    # decode the response and walk the object to the 'id' field
    rdata = r.json()
    p = rdata['data']['objects'][0]['data'][0]['id']
    
    # print device ID to screen
    print("deviceId: " + str(p))
    
    # specify the api endpoint to be used, return the interface name, interface ID and device ID. Use the deviceID and interface name to filter the results down to just the interface we want.
    url = "http://your.statseeker.server/api/v2.1/cdt_port/?fields=id,name,deviceid&name_filter=IS('" + interfaceName + "')&deviceid_filter=IS('" + str(p) + "')"
    
    # send request to get interfaceId
    r = requests.get(url, headers=headers, auth=(user, pword))
    
    # print request response code to screen
    print("GET interfaceId: " + str(r.status_code)) 
    
    # decode the response and walk the object to the 'id' field
    rdata = r.json()
    p = rdata['data']['objects'][0]['data'][0]['id']
    
    #print interface ID to screen
    print("interfaceId: " + str(p))
    
    
    # specify the api endpoint to be used and format output to remove links
    noLinks = "/?links=none"
    url = "http://your.statseeker.server/api/v2.1/cdt_port/" + str(p) + noLinks
    
    # update poll status to turn off polling
    data = json.dumps({"data":[{"poll":"off"}]})
    
    # send request to update polling status
    r = requests.put(url, headers=headers, auth=(user, pword), data=data)
    
    # print request response code to screen
    print("Update interface poll status: " + str(r.status_code))
    
    # print response body to screen
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # specify the device name and interface name
    $deviceName = "NewYork-Floor53-Switch1"
    $interfaceName = "Fa0/36"
    
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?&indent=3&links=none'
    
    # set target endpoint
    $targetEndpoint = 'cdt_device/'
    
    #specify fields to return
    $fields = '&fields=id,name'
    
    #specify filters to only return the details on the device you want
    $filters = "&name_filter=IS('" + $deviceName + "')"
    
    # send request to retrieve the device ID
    response = RestClient::Request.new({
          method: :get,
          url: $baseUri + $targetEndpoint + $rspFormat + $fields + $filters,
          user: $user,
          password: $pword,
        }).execute
    
    # print request response code to the screen
    puts "#{'GET deviceid: ' + response.code.to_s}"
    
    # parse the response contents and walk the object to the retrieve the device ID
    $rdata = JSON.parse(response)
    $p = $rdata['data']['objects'][0]['data'][0]['id']
    
    # print the device ID to the screen
    puts "#{'deviceID: ' + $p.to_s}"
    
    # specify the endpoint, fields to retrieve and filters to apply to retrieve the interface ID
    $targetEndpoint = 'cdt_port/'
    $fields = $fields + ',deviceid'
    $filters = "&name_filter=IS('" + $interfaceName + "')&deviceid_filter=IS('" + $p.to_s + "')"
    
    # send request to retrieve the interface ID
    response = RestClient::Request.new({
          method: :get,
          url: $baseUri + $targetEndpoint + $rspFormat + $fields + $filters,
          user: $user,
          password: $pword,
        }).execute
    
    # print request response code to the screen
    puts "#{'GET interfaceid: ' + response.code.to_s}"
    
    # parse the response contents and walk the object to the retrieve the interface ID
    $rdata = JSON.parse(response)
    $p = $rdata['data']['objects'][0]['data'][0]['id']
    
    # print interface ID to the screen
    puts "#{'interfaceID: ' + $p.to_s}"
    
    # specify the endpoint, and paylod to update the interface poll status
    $targetEndpoint = 'cdt_port/'+ $p.to_s + '/'
    $jData = {:poll => 'off'}
    $jData = '{"data":[' + $jData.to_json + ']}'
    
    # send request to update the poll status
    response = RestClient::Request.new({
          method: :put,
          headers: {
            content_type: 'application/json'
            },
          url: $baseUri + $targetEndpoint + $rspFormat + $fields + $filters,
          user: $user,
          password: $pword,
          payload: $jData,
        }).execute
    
    #output response to screen
    puts "#{response.to_str}"
    
    
    
    #This response includes some logging (preceeding the response data object) which is only relevent to the Python adn Ruby implementations
    GET deviceid: 200
    deviceID: 751
    GET interfaceid: 200
    interfaceID: 31619
    {
       "info":"The Statseeker RESTful API",
       "data":{
          "errmsg":"ok",
          "success":true,
          "time":1496196689
       },
       "api_version":"2.1"
    }
    
    Field ID Type Description
    if90day Integer Status of port usage over 90 days
    ifAlias String Interface Alias (ifAlias)
    ifDescr String Interface Description (ifDescr)
    ifDuplex String Interface Duplex. (half/full/auto)
    ifIndex String Interface Index (IF-MIB.ifIndex)
    ifInSpeed Integer Interface Input Speed (Statseeker custom attribute)
    ifName String Interface Name (IF-MIB.ifName)
    ifNonUnicast String NonUnicast Polling status of the port
    ifOperStatus String Current operational status of port
    ifOutSpeed Integer Interface Output Speed (Statseeker custom attribute)
    ifPhysAddress String Interface MAC Address (ifPhysAddress)
    ifPoll String Polling status of the port
    ifSpeed Integer Interface Speed (based on ifSpeed or ifHighSpeed)
    ifTitle String Interface Title (Statseeker custom attribute - ifTitle)
    ifType String Interface Type (ifType)

    DELETE /cdt_port/{id}

    Deleting a network interface (id = 3853)

    
    curl \ 
        -H "Accept: application/json" \ 
        -H "Content-Type: application/json" \
        -X DELETE \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/cdt_port/3853/?links=none&indent=3" \
    
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/cdt_port/3853/?links=none&indent=3"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # send request 
    r = requests.delete(url, headers=headers, auth=(user, pword))
    
    # display the response status code
    print(r.status_code)
    
    # display the contents of the response object
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'cdt_port/3853'
    
    
    $jData = '{"data":[' + $jData.to_json + ']}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :delete,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => {:content_type => :json},
        :user => $user,
        :password => $pword,
        ) 
    
    #output response to screen
    puts "#{response.to_str}"
    
    
    {
       "info":"The Statseeker RESTful API",
       "version":"2.1",
       "data":{
          "errmsg":"ok",
          "success":true,
          "time":1525748475
       },
       "revision":"5"
    }
    
    
    

    Delete a previously discovered network device.

    Groups (/group)

    The group resource allows you to create and populate the groups used by Statseeker for reporting, and for authorization when restricting visibility and access to functionality for users within Statseeker.

    GET /group

    
    curl \
       -H "Accept: application/json" \
       -H "Content-Type: application/json" \
       -X GET \
       -u user:pword \
       "http://your.statseeker.server/api/v2.1/group/?fields=name,entities&name_filter=IS(%27AURouters%27)&entities_formats=list,count&links=none&indent=3"
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "group/"
    
    # specify fields to be returned and filters to use
    getFields = "?fields=name,entities"
    
    # set entities formats to be used
    entFormat = '&entities_formats=list,count'
    
    # set filters
    filters = '&name_filter=IS("AURouters")'
    
    # optional response formatting
    rspFormat = "&links=none&indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + entFormat + filters + rspFormat
    
    # send request 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '&links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'group/'
    
    # set fields to return
    $fields = '?fields=name,entities'
    
    # set entities formats to be used
    $entFormat = '&entities_formats=list,count'
    
    # set filters
    $filters = '&name_filter=IS("AURouters")'
    
    # send request
    response = RestClient::Request.execute(
       :method => :get,
       :url => $baseUri + $targetEndpoint + $fields + $entFormat + $filters + $rspFormat, 
       :headers => { 
          :content_type => :json,
       },
       :user => $user,
       :password => $pword
    )
    #output response to screen
        puts "#{response.to_str}"
    
    {
       "info":"The Statseeker RESTful API",
       "version":"2.1",
       "data":{
          "objects":[
             {
                "status":{
                   "errcode":0,
                   "success":true
                },
                "data":[
                   {
                      "entities":{
                         "count":122,
                         "list":[
                            2,
                            3,
                            4,
                            5,
                            6,
                            7,
                            8,
                            9,
                            10,
                            11,
                            12,
                            13,
                            14,
                            15,
                            16,
                            17,
                            18,
                            19,
                            20,
                            21,
                            22,
                            23,
                            24,
                            25,
                            26,
                            27,
                            28,
                            29,
                            405,
                            408,
                            414,
                            16677,
                            16678,
                            16679,
                            16820,
                            16821,
                            16822,
                            17106,
                            17107,
                            17108,
                            17719,
                            17720,
                            18826,
                            18829,
                            18830,
                            18831,
                            18832,
                            18833,
                            18834,
                            18835,
                            18836,
                            18837,
                            18838,
                            18839,
                            18840,
                            18841,
                            18842,
                            18843,
                            18844,
                            18845,
                            18846,
                            18847,
                            18848,
                            18849,
                            18850,
                            18851,
                            18857,
                            19510,
                            19511,
                            19512,
                            19513,
                            19514,
                            19515,
                            19516,
                            19517,
                            19518,
                            19519,
                            19520,
                            20034,
                            20035,
                            20042,
                            20043,
                            20044,
                            20045,
                            20059,
                            20060,
                            20175,
                            20176,
                            20631,
                            20632,
                            20635,
                            20636,
                            20637,
                            20638,
                            20639,
                            20640,
                            20641,
                            20642,
                            20643,
                            20644,
                            20645,
                            20646,
                            20647,
                            20648,
                            20649,
                            20650,
                            20651,
                            20652,
                            20653,
                            20654,
                            20655,
                            20656,
                            20657,
                            20663,
                            20664,
                            21085,
                            24523,
                            24722,
                            26377,
                            26379,
                            26434,
                            26459
                         ]
                      },
                      "name":"AURouters",
                      "id":26388
                   }
                ],
                "type":"group",
                "data_total":1
             }
          ],
          "errmsg":"ok",
          "success":true,
          "time":1525754247
       },
       "revision":"5"
    }
    
    
    Field ID Type Description
    entities object The entities that are assigned to this group.
    Using entities requires that entities_formats also be specified.
    formats keyDescription
    count Number of entities assigned to the group
    list Array of entity ids assigned to the group
    exc_count Number of entities assigned to the group (excluding child entities not explicitly assigned)
    exc_list Array of entity ids assigned to the group (excluding child entities not explicitly assigned)
    hexstr Hex bitstring representation of assigned entities
    exc_hexstr Hex bitstring representation of assigned entities (excluding child entities not explicitly assigned)
    E.g. ?fields=entities&entities_formats=list,count
    id Integer ID of the group
    name String Name of the group

    POST /group

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X POST \
        -u user:pword "http://your.statseeker.server/api/v2.1/group/?indent=3" \
        -d '{"data":[{"name":"Budapest"}]}'
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/group"
    
    # credentials
    user = "user"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # data, this is the name of group that will be created
    data = json.dumps({"data":[{"name":"Budapest"}]})
    
    # send request 
    r = requests.post(url, headers=headers, auth=(user, pword), data=data)
    
    # display the response status code
    print(r.status_code)
    
    # display the contents of the response object
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'group/'
    
    # set payload in json format
    $jData = {
       :name => 'Budapest',
     }
    $jData = '{"data":[' + $jData.to_json + ']}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :post,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
        :payload => $jData
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "objects": [
          {
            "status": {
              "errcode": 0,
              "success": true
            },
            "data": [
              {
                "name": "Budapest",
                "id": 46461
              }
            ],
            "type": "group",
            "data_total": 1
          }
        ],
        "errmsg": "ok",
        "success": true,
        "time": 1496198383
      },
      "links": [
        {
          "link": "/api/v2.1/group?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/group/describe",
          "rel": "describedby"
        }
      ],
      "api_version": "2.1"
    }
    
    
    Field ID Type Description
    name String Name of the group

    PUT /group/{id}/{field}

    When populating a group, or updating the members of a group, you use the /group/{id}/entities field endpoint, and must specify a mode instructing the API on how to populate the group.

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X PUT \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/group/46461/entities/?indent=3" \
        -d '{"value":[286,287,288,289,290,291,292,293],"mode":"add"}'
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    # we are going to entries to the entities list of the group
    url = "http://your.statseeker.server/api/v2.1/group/46461/entities"
    
    # credentials
    user = "user"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # data specify the ID's of the devices to be added to the group, this adds the device plus all children (interfaces, in this case) 
    # specify the mode, we are using "add" to add the devices without affecting any existing group members
    data = json.dumps({"value":[286,287,288,289,290,291,292,293],"mode":"add"})
    
    # send request 
    r = requests.put(url, headers=headers, auth=(user, pword), data=data)
    
    # display the response status code
    print(r.status_code)
    
    # display the contents of the response object
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'group/46461/entities'
    
    # set payload in json format
    $jData = {
       :value => [286, 287, 288, 289, 290, 291, 292, 293],
       :mode => 'add',
     }
    $jData = $jData.to_json
    
    # send request
    response = RestClient::Request.execute(
        :method => :put,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword,
        :payload => $jData
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    
    {
       "info":"The Statseeker RESTful API",
       "data":{
          "errmsg":"ok",
          "success":true,
          "time":1496200162
       },
       "links":[
          {
             "link":"/api/v2.1/group/46461/entities?&indent=3",
             "rel":"self"
          },
          {
             "link":"/api/v2.1",
             "rel":"base"
          },
          {
             "link":"/api/v2.1/group/46461",
             "rel":"collection"
          }
       ],
       "api_version":"2.1"
    }
    
    
    Field ID Type Description
    entities object The entities that are assigned to this group
    formats keyDescription
    count Number of entities assigned to the group
    list Array of entity ids assigned to the group
    exc_count Number of entities assigned to the group (excluding child entities not explicitly assigned)
    exc_list Array of entity ids assigned to the group (excluding child entities not explicitly assigned)
    hexstr Hex bitstring representation of assigned entities
    exc_hexstr Hex bitstring representation of assigned entities (excluding child entities not explicitly assigned)

    Group Mode

    The Group object requires that a mode be specified when performing PUT requests to make changes to the the group's members (entities). The mode specifies what the API should do with the entities when making changes.

    ModeDescription
    clear Remove the specified entities from the group
    set Remove all existing entities and then add the specified entities to the group
    add Add the specified entities to the group

    DELETE /group/{id}

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X DELETE \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/group/46461/?indent=3" 
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/group/46461"
    
    # credentials
    user = "user"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # send request 
    r = requests.delete(url, headers=headers, auth=(user, pword))
    
    
    # display the response status code
    print(r.status_code)
    
    # display the contents of the response object
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '?&indent=3'
    
    # set target endpoint, specifying the ID of the group to be deleted
    $targetEndpoint = 'group/46461'
    
    
    # send request
    response = RestClient::Request.execute(
        :method => :delete,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => { 
            :content_type => :json,
        },
        :user => $user,
        :password => $pword
    )
    #output response to screen
        puts "#{response.to_str}"
    
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "errmsg": "ok",
        "success": true,
        "time": 1496200297
      },
      "links": [
        {
          "link": "/api/v2.1/group/46461?indent=3",
          "rel": "self"
        },
        {
          "link": "/api/v2.1",
          "rel": "base"
        },
        {
          "link": "/api/v2.1/group",
          "rel": "collection"
        },
        {
          "link": "/api/v2.1/group/46461/entities",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/group/46461/name",
          "rel": "item"
        },
        {
          "link": "/api/v2.1/group/46461/id",
          "rel": "item"
        }
      ],
      "api_version": "2.1"
    }
    
    

    This will delete the group from Statseeker, but has no impact on the group contents other than removing them from the specified group.

    Discovery Configuration (/discover_config)

    The discover_config resource allows you to modify Statseeker's existing discovery rules.

    There is a single discovery_config object per Statseeker installation. The creation of the discover_config object, and the initial setting of the associated disocvery rules, is managed entirely through the Admin Tool, but the rules can be updated and expanded upon via the API.

    Via the API, IP range specific configuration rules can be applied, expanding upon the base functionality available through the Admin Tool.

    GET /discover_config/1

    
    curl \
       -H "Accept: application/json" \
       -H "Content-Type: application/json" \
       -X GET \
       -u user:pword \
       "http://your.statseeker.server/api/v2.1/discover_config/1/?fields=name,ranges,ip_range_configurations,iftype,ping_count,ping_rate,ping_skip,sysdescr&links=none&indent=3"
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "discover_config/1/"
    
    # specify fields to be returned and filters to use
    getFields = "?fields=name,ranges,ip_range_configurations,iftype,ping_count,ping_rate,ping_skip,sysdescr"
    
    
    # optional response formatting
    rspFormat = "&links=none&indent=3"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + rspFormat
    
    # send request 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    # api user credentials
    $user = 'username'
    $pword = 'password'
    
    # api root endpoint
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # optional formatting of the response for onscreen readability
    $rspFormat = '&links=none&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'discover_config/1/'
    
    # set fields to return
    $fields = '?fields=name,ranges,ip_range_configurations,iftype,ping_count,ping_rate,ping_skip,sysdescr'
    
    # send request
    response = RestClient::Request.execute(
       :method => :get,
       :url => $baseUri + $targetEndpoint + $fields + $rspFormat, 
       :headers => { 
          :content_type => :json,
       },
       :user => $user,
       :password => $pword
    )
    #output response to screen
        puts "#{response.to_str}"
    
    {
       "info":"The Statseeker RESTful API",
       "version":"2.1",
       "data":{
          "objects":[
             {
                "status":{
                   "errcode":0,
                   "success":true
                },
                "data":[
                   {
                      "iftype":[
                         "ethernetCsmacd",
                         "fastEther",
                         "fibreChannel",
                         "frameRelay",
                         "gigabitEthernet",
                         "iso88023Csmacd",
                         "ppp",
                         "propPointToPointSerial",
                         "propVirtual",
                         "tunnel"
                      ],
                      "name":null,
                      "ip_range_configurations":[
                         {
                            "excludes":[
                               "Cisco"
                            ],
                            "iftype":[
                               "ethernetCsmacd"
                            ],
                            "title":"10.100.89_nonCisco_discovery",
                            "ip_range_text":"include 10.100.89.[10,30,250-254]",
                            "enabled":true,
                            "ip_ranges":[
                               [
                                  174348554,
                                  174348554
                               ],
                               [
                                  174348574,
                                  174348574
                               ],
                               [
                                  174348794,
                                  174348798
                               ]
                            ],
                            "includes":[
                               ""
                            ],
                            "communities":[
                               "secretCommunity",
                               "public"
                            ]
                         },
                         {
                            "excludes":[
                               ""
                            ],
                            "iftype":[
                               "ethernetCsmacd"
                            ],
                            "title":"10.100.90_discovery",
                            "ip_range_text":"include 10.100.90.[0-255]",
                            "enabled":true,
                            "ip_ranges":[
                               [
                                  174348800,
                                  174349055
                               ]
                            ],
                            "includes":[
                               ""
                            ],
                            "communities":[
                               "verySecretCommunity",
                               "public"
                            ]
                         }
                      ],
                      "ranges":[
                         "include 10.2.16.0/24",
                         "include 10.100.0.0/16",
                         "include 10.119.0.0/16",
                         "exclude 10.2.16.10",
                         "exclude 10.100.[50,51,52,55,58,61,63].[250-254]",
                         "exclude 10.100.94.[252,253]",
                         "exclude 10.100.200.10"
                      ],
                      "ping_rate":512,
                      "ping_count":2,
                      "id":1,
                      "sysdescr":[
                         "include 3Com",
                         "include Alcatel",
                         "include Cabletron",
                         "include Cisco",
                         "include ConnectUPS",
                         "include Enterasys",
                         "include Extreme",
                         "include Foundry",
                         "include Juniper",
                         "include Netscreen",
                         "include Brocade",
                         "include Lucent",
                         "include Nortel",
                         "include PowerNet",
                         "include ProCurve",
                         "include LaserJet",
                         "include JETDIRECT",
                         "include FreeBSD",
                         "include Linux",
                         "include Solaris",
                         "include Windows",
                         "include SSG",
                         "exclude JETDIRECT EX",
                         "include SunOS",
                         "include BayStack",
                         "include Dell",
                         "include Aruba",
                         "include HP",
                         "include Avaya",
                         "include Liebert",
                         "include APC",
                         "include Blue Coat",
                         "include F5",
                         "include Palo Alto",
                         "include Fortinet",
                         "include NetScaler",
                         "include NetApp",
                         "include IPSO",
                         "include IBM",
                         "include H3C"
                      ],
                      "ping_skip":256
                   }
                ],
                "type":"discover_config",
                "data_total":1
             }
          ],
          "errmsg":"ok",
          "success":true,
          "time":1525829191
       },
       "revision":"5"
    }
    
    

    Return details on the existing discover_config object.

    Field ID Type Description
    communities String Comma separated SNMPv1 and SNMPv2 community strings
    id Integer Discover config identifier/key
    iftype String Comma separated list of interface types to include
    ip_range_configurations String An array of Discover Configuration objects associated to IP Address Ranges. Each configuration in the array contains the following fields:
    Field ID Type Description
    communities String Comma separated SNMPv1 and SNMPv2 community strings
    enabled Boolean Set the range configuration to be enabled/disabled
    excludes String Comma separated sysdescr strings for entities to exclude from the configuration
    iftypes String Comma separated iftypes strings for entities to include in the configuration
    includes String Comma separated sysdescr strings for entities to include in the configuration
    ip_range_text String Include range string specifying the IP range to be covered by the configuration
    title String Name for the configuration rule
    These configurations are in addition to the global discovery settings for the IP range specified in ip_range_text. This allows you to apply specific include/exclude rules based on sysDescr and iftype to select IP ranges, and to restrict which community strings are sent to a given IP.
    ping_count Integer Number of passes for the ping discover
    ping_rate Integer Number of pings to send per second
    ping_skip Integer Number of ipaddress to skip between each ping
    ranges String Comma separated discover ranges (using include/exclude syntax)
    sysdescr String Comma separated SysDescr values to decide which devices to discover

    PUT /discover/config/1

    Updating the the IP Ranges to be used during Discovery

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X PUT \
        -u user:pword \
        "http://your.statseeker.server/api/v2.1/discover_config/1?indent=3&links=none" \
        -d "{"data":[{"ranges":["include 10.100.0.0/16","exclude 10.100.[50-100].*","include 10.101.0.0/16","include 10.116.0.0/16"]}]}"
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/discover_config/1/?links=none"
    
    # credentials
    user = "username"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # data
    data = json.dumps({"data":[{"ranges":["include 10.100.0.0/16","exclude 10.100.[50-100].*","include 10.101.0.0/16","include 10.116.0.0/16"]}]})
    
    # send request 
    r = requests.put(url, headers=headers, auth=(user, pword), data=data)
    print(r.status_code)
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is simply used to format the contents of the response object for readability.
    $rspFormat = '?&indent=3'
    
    # set target endpoint
    $targetEndpoint = 'discover_config/1/?links=none'
    
    # set payload in json format
    $jData = '{"data":[{"ranges":["include 10.100.0.0/16","exclude 10.100.[50-100].*","include 10.101.0.0/16","include 10.116.0.0/16"]}]}'
    
    # send request
    response = RestClient::Request.execute(
        :method => :put,
        :url => $baseUri+$targetEndpoint+$rspFormat,
        :headers => {:content_type => :json},
        :user => $user,
        :password => $pword,
        :payload => $jData,
        ) 
    
    #output response to screen
    puts "#{response.to_str}"
    
    
    
    {
      "info": "The Statseeker RESTful API",
      "data": {
        "errmsg": "ok",
        "success": true,
        "time": 1496200675
      }
      "api_version": "2.1"
    }
    
    
    Field ID Type Description
    communities String Comma separated SNMPv1 and SNMPv2 community strings
    iftype String Comma separated list of interface types to include
    ip_range_configurations String An array of Discover Configuration objects associated to specific IP Address Ranges. Each configuration in the array contains the following fields:
    Field ID Type Description
    communities String Comma separated SNMPv1 and SNMPv2 community strings
    enabled Boolean Set the range configuration to be enabled/disabled
    excludes String Comma separated sysdescr strings for entities to exclude from the configuration
    iftypes String Comma separated iftypes strings for entities to include in the configuration
    includes String Comma separated sysdescr strings for entities to include in the configuration
    ip_range_text String Include range string specifying the IP range to be covered by the configuration
    title String Name for the configuration rule
    These configurations are in addition to the global discovery settings for the IP range specified in ranges. This allows you to apply specific include/exclude rules based on sysDescr and iftype to select IP ranges, and to restrict which community strings are sent to a given IP.
    ping_count Integer Number of passes for the ping discover
    ping_rate Integer Number of pings to send per second
    ping_skip Integer Number of ipaddress to skip between each ping
    ranges String Comma separated discover ranges (using include/exclude syntax)
    sysdescr String Comma separated SysDescr values to decide which devices to discover

    Message (/message)

    The message resource provides access to the syslog and SNMP trap messages collected by Statseeker. The contents of these records can be reported on and used to trigger alerts.

    GET /message

    Retrieving details, from Syslog Records, on devices that 'went down' in the previous 24hrs

    In this example we will retrieve details on all Syslog messages that record a "down-device" state change in the previous 24h hours.

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword "http://your.statseeker.server/api/v2.1/message/?indent=3&links=none&fields=entity,entityid,text,type,time&text_filter=LIKE(%22%25changed%20state%20to%20down%25%22)&time_timefilter=range%20=%20now%20-%201d%20to%20now"
    
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "message/"
    
    # specify fields to be returned and filters to use
    getFields = "?fields=entity,entityid,text,type,time"
    
    #specify filters for syslog events when the device went 'down'
    filters = '&text_filter=LIKE("%25changed state to down%25")'
    
    #specify time filter
    timefilters = '&time_timefilter=range = now - 1d to now'
    
    # optional response formatting
    rspFormat = "&indent=3&links=none"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + filters + timefilters + rspFormat
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request 
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is used to format the contents of the response object for readability
    $rspFormat = '?indent=3&links=none'
    
    # set target endpoint
    $targetEndpoint = 'message/'
    
    #specify fields to return
    $fields = '&fields=entity,entityid,text,type,time'
    
    #specify filters for syslog events when the device went 'down'
    $filters = '&text_filter=LIKE("%25changed state to down%25")'
    
    #specify time filter
    $timefilters = '&time_timefilter=range = now - 1d to now'
    
    
    response = RestClient::Request.new({
          method: :get,
          url: $baseUri + $targetEndpoint + $rspFormat + $fields + $filters + $timefilters,
          user: $user,
          password: $pword,
        }).execute
    
    puts "#{response.to_str}"
    
    
    
    
    {
        "info": "The Statseeker RESTful API",
        "data": {
            "objects": [{
                "status": {
                    "errcode": 0,
                    "success": true
                },
                "data": [{
                    "text": "local0.info  %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to down",
                    "entity": "LosAngeles-swt1",
                    "time": 1490240152,
                    "entityid": 174,
                    "type": "syslog",
                    "id": 126619
                }, {
                    "text": "local0.info  %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/7, changed state to down",
                    "entity": "Helsinki-swt1",
                    "time": 1490245557,
                    "entityid": 313,
                    "type": "syslog",
                    "id": 126626
                }, {
                    "text": "local0.info  %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/12, changed state to down",
                    "entity": "CapeTown-swt2",
                    "time": 1490246759,
                    "entityid": 412,
                    "type": "syslog",
                    "id": 126628
                }, {
                    "text": "local0.info  %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/18, changed state to down",
                    "entity": "Mumbai-swt2",
                    "time": 1490251556,
                    "entityid": 379,
                    "type": "syslog",
                    "id": 126631
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface FastEthernet0/19, changed state to down",
                    "entity": "Unknown (10.100.52.25)",
                    "time": 1490270147,
                    "entityid": 0,
                    "type": "syslog",
                    "id": 126641
                }, {
                    "text": "local0.info  %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down",
                    "entity": "Budapest-swt4",
                    "time": 1490271059,
                    "entityid": 271,
                    "type": "syslog",
                    "id": 126642
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface FastEthernet0/18, changed state to down",
                    "entity": "Phoenix-swt4",
                    "time": 1490271643,
                    "entityid": 201,
                    "type": "syslog",
                    "id": 126643
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface FastEthernet0/7, changed state to down",
                    "entity": "Bangkok-swt1",
                    "time": 1490279033,
                    "entityid": 374,
                    "type": "syslog",
                    "id": 126647
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface GigabitEthernet1/0/20, changed state to down",
                    "entity": "Unknown (10.100.52.25)",
                    "time": 1490286824,
                    "entityid": 0,
                    "type": "syslog",
                    "id": 126652
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface GigabitEthernet2/0/16, changed state to down",
                    "entity": "Chicago-rtr",
                    "time": 1490294444,
                    "entityid": 185,
                    "type": "syslog",
                    "id": 126657
                }, {
                    "text": "local0.info  %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/8, changed state to down",
                    "entity": "Tokyo-swt1",
                    "time": 1490301348,
                    "entityid": 355,
                    "type": "syslog",
                    "id": 126661
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface GigabitEthernet1/0/8, changed state to down",
                    "entity": "LosAngeles-rtr",
                    "time": 1490305548,
                    "entityid": 175,
                    "type": "syslog",
                    "id": 126664
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface GigabitEthernet1/0/18, changed state to down",
                    "entity": "Helsinki-swt3",
                    "time": 1490307644,
                    "entityid": 311,
                    "type": "syslog",
                    "id": 126667
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface GigabitEthernet1/0/14, changed state to down",
                    "entity": "Athens-rtr",
                    "time": 1490316041,
                    "entityid": 299,
                    "type": "syslog",
                    "id": 126671
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface FastEthernet0/28, changed state to down",
                    "entity": "Melbourne-swt2",
                    "time": 1490316942,
                    "entityid": 397,
                    "type": "syslog",
                    "id": 126672
                }, {
                    "text": "local0.info  %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/11, changed state to down",
                    "entity": "Chicago-swt2",
                    "time": 1490317855,
                    "entityid": 183,
                    "type": "syslog",
                    "id": 126673
                }, {
                    "text": "local0.info  %LINK-3-UPDOWN: Interface GigabitEthernet3/0/5, changed state to down",
                    "entity": "Copenhagen-swt3",
                    "time": 1490318756,
                    "entityid": 331,
                    "type": "syslog",
                    "id": 126674
                }],
                "type": "message",
                "data_total": 17
            }],
            "errmsg": "ok",
            "success": true,
            "time": 1490325593
        },
        "api_version": "2.1"
    }
    
    
    Field ID Type Description
    entity String The name of the entity that owns this message
    entityid Integer The ID of the entity that owns this message
    id Integer Message Identifier
    text String The message text
    time Integer Message Time
    Message Type
    • syslog
    • trap

    POST /message

    Creating a custom syslog, or SNMP trap, message that can be innjected into Statseekers' database for record-keeping and reporting.

    Creating a custom syslog message.

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword "http://your.statseeker.server/api/v2.1/message/?indent=3&links=none&fields=entity,entityid,text,type,time&text_filter=LIKE(%22%25changed%20state%20to%20down%25%22)&time_timefilter=range%20=%20now%20-%201d%20to%20now"
    
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # specify the api endpoint to be used
    url = "http://your.statseeker.server/api/v2.1/message"
    
    # credentials
    user = "user"
    pword = "password"
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    
    # data, this is the name of group that will be created
    data = json.dumps({"data":[{"entityid":26525,"text":"Custom message for Chicago-swt4 via API","type":"syslog"}]})
    
    # send request 
    r = requests.post(url, headers=headers, auth=(user, pword), data=data)
    
    # display the response status code
    print(r.status_code)
    
    # display the contents of the response object
    print(r.json())
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    # this is used to format the contents of the response object for readability
    $rspFormat = '?indent=3&links=none'
    
    # set target endpoint
    $targetEndpoint = 'message/'
    
    # set payload in json format
    $jData = {
       :entityid => 26525,
       :text => 'Custom message for Chicago-swt4 via API',
       :type => 'syslog',
     }
    $jData = '{"data":[' + $jData.to_json + ']}'
    
    
    response = RestClient::Request.new({
          method: :get,
          url: $baseUri + $targetEndpoint + $jData + $rspFormat,
          user: $user,
          password: $pword,
        }).execute
    
    puts "#{response.to_str}"
    
    
    
    
    {
       "info":"The Statseeker RESTful API",
       "version":"2.1",
       "data":{
          "objects":[
             {
                "status":{
                   "errcode":0,
                   "success":true
                },
                "data":[
                   {
                      "text":"Custom message for Chicago-swt4 via API",
                      "entityid":26525,
                      "type":"syslog",
                      "id":21820
                   }
                ],
                "type":"message",
                "data_total":1
             }
          ],
          "errmsg":"ok",
          "success":true,
          "time":1526352057
       },
       "revision":"5"
    }
    
    
    Field ID Type Description
    entityid Integer The ID of the entity that owns this message
    text String The message text
    type String Message Type
    • syslog
    • trap

    Events (/event_record)

    The event_record resource provides access to the device and interface events recorded by Statseeker. The contents of these records can be reported on and used to trigger alerts.

    An event is recorded whenever something of note occurs within the network. Statseeker reviews the recorded events and, if an event matches the conditions specified by an alert configuration, then that alert is triggered.

    What causes an Event to be recorded? * Network device and interface state changes (up/down) * A configured threshold is breached * The contents of syslog messages and SNMP trap messages

    Field ID Field Title Type Get, Add, Update, Delete Description
    delta Delta Integer G The number of seconds since the last record of the same event
    device Device String G The name of the device that owns the entity
    deviceid Device ID Integer G The ID of the device that owns the entity
    entity Entity String G The name of the entity that owns the event
    entityid Entity ID Integer G, A The ID of the entity that owns the entity
    entityTypeName Entity Type Name String G The name of the type of entity that owns the event
    entityTypeTitle Entity Type Title String G The title of the type of entity that owns the event
    event Event String G, A The event text associated to the record
    eventid Event ID Integer G, A The event id associated to the record
    id ID String G Event Record Identifier
    note Note String G, U The note associated with the record
    state State String G, A The state text associated to the record
    stateid State ID Integer G, A The state id associated to the record
    time Time Integer G, A Epoch time that the record was created

    GET /event_record

    Retrieving details, from Event Records, of interfaces that recovered from a 'down' state in the previous 3hrs

    The delta value, found in each record in the response, details the duration that the interface was in a down state.

    
    curl \
        -H "Accept: application/json" \
        -H "Content-Type: application/json" \
        -X GET \
        -u user:pword "http://your.statseeker.server/api/v2.1/event_record/?indent=3&links=none&fields=event,eventid,device,deviceid,state,delta,time&state_filter=IS(%22up%22)&event_filter=IS(%22IF-MIB.ifOperStatus%22)&time_timefilter=range%20=%20now%20-%203h%20to%20now"
    
    
    
    
    #!/usr/bin/python 
    
    # import requests for handling connection and encoding
    import requests, json
    
    # credentials
    user = "username"
    pword = "password"
    
    # API root endpoint
    rootUri = "http://your.statseeker.server/api/v2.1/"
    
    # specify target endpoint
    targetUri = "event_record/"
    
    # specify fields to be returned and filters to use
    getFields = "?fields=event,eventid,device,deviceid,state,delta,time"
    
    #specify filters
    filters = '&state_filter=IS("up")&event_filter=IS("IF-MIB.ifOperStatus")'
    
    #specify time filter
    timefilters = '&time_timefilter=range = now - 3h to now'
    
    # optional response formatting
    rspFormat = "&indent=3&links=none"
    
    # set URL to be used
    url = rootUri + targetUri + getFields + filters + timefilters + rspFormat
    
    # headers
    headers = {"Accept":"application/json", "Content-Type":"application/json"}
    
    # send request
    r = requests.get(url, headers=headers, auth=(user, pword))
    print(r.status_code)
    print(r.json())
    
    
    
    
    
    # install with: $ gem install rest-client
    require 'rest_client'
    require 'json'
    
    $user = 'username'
    $pword = 'password'
    $baseUri = 'http://your.statseeker.server/api/v2.1/'
    
    
    # this is used to format the contents of the response object for readability
    $rspFormat = '?indent=3&links=none'
    
    # set target endpoint
    $targetEndpoint = 'event_record/'
    
    #specify fields to return
    $fields = '&fields=event,eventid,device,deviceid,state,delta,time'
    
    #specify filters
    $filters = '&state_filter=IS("up")&event_filter=IS("IF-MIB.ifOperStatus")'
    
    #specify time filter
    $timefilter = '&time_timefilter=range = now - 3h to now'
    
    response = RestClient::Request.new({
          method: :get,
          url: $baseUri + $targetEndpoint + $rspFormat + $fields + $filters + $timefilter,
          user: $user,
          password: $pword,
        }).execute
    
    puts "#{response.to_str}"
    
    
    
    
    {
        "info": "The Statseeker RESTful API",
        "data": {
            "objects": [{
                "status": {
                    "errcode": 0,
                    "success": true
                },
                "data": [{
                    "eventid": 17,
                    "time": 1490328180,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 185,
                    "delta": 23520,
                    "device": "Chicago-rtr",
                    "id": "58D49A74-1-1"
                }, {
                    "eventid": 81,
                    "time": 1490324821,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 284,
                    "delta": 3960,
                    "device": "Warsaw-rtr",
                    "id": "58D48D55-1-1"
                }, {
                    "eventid": 81,
                    "time": 1490327161,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 284,
                    "delta": 480,
                    "device": "Warsaw-rtr",
                    "id": "58D49679-1-1"
                }, {
                    "eventid": 97,
                    "time": 1490329921,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 293,
                    "delta": 3540,
                    "device": "Athens-srv1",
                    "id": "58D4A141-1-1"
                }, {
                    "eventid": 97,
                    "time": 1490332501,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 293,
                    "delta": 1080,
                    "device": "Athens-srv1",
                    "id": "58D4AB55-1-1"
                }, {
                    "eventid": 129,
                    "time": 1490326021,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 334,
                    "delta": 4260,
                    "device": "Copenhagen-rtr",
                    "id": "58D49205-1-1"
                }, {
                    "eventid": 145,
                    "time": 1490324821,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 350,
                    "delta": 6900,
                    "device": "Shanghai-rtr",
                    "id": "58D48D55-2-1"
                }, {
                    "eventid": 145,
                    "time": 1490328421,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 350,
                    "delta": 2040,
                    "device": "Shanghai-rtr",
                    "id": "58D49B65-1-1"
                }, {
                    "eventid": 177,
                    "time": 1490329802,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 378,
                    "delta": 19741,
                    "device": "Delhi-rtr",
                    "id": "58D4A0CA-1-1"
                }, {
                    "eventid": 209,
                    "time": 1490332022,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 390,
                    "delta": 840,
                    "device": "Chennai-rtr",
                    "id": "58D4A976-1-1"
                }, {
                    "eventid": 209,
                    "time": 1490332142,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 390,
                    "delta": 60,
                    "device": "Chennai-rtr",
                    "id": "58D4A9EE-1-1"
                }, {
                    "eventid": 209,
                    "time": 1490332502,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 390,
                    "delta": 120,
                    "device": "Chennai-rtr",
                    "id": "58D4AB56-1-1"
                }, {
                    "eventid": 225,
                    "time": 1490325842,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 414,
                    "delta": 840,
                    "device": "CapeTown-rtr",
                    "id": "58D49152-1-1"
                }, {
                    "eventid": 225,
                    "time": 1490328002,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 414,
                    "delta": 1080,
                    "device": "CapeTown-rtr",
                    "id": "58D499C2-1-1"
                }, {
                    "eventid": 241,
                    "time": 1490323442,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 417,
                    "delta": 300,
                    "device": "PortElizabeth-rtr",
                    "id": "58D487F2-1-1"
                }, {
                    "eventid": 241,
                    "time": 1490327942,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 417,
                    "delta": 3900,
                    "device": "PortElizabeth-rtr",
                    "id": "58D49986-1-1"
                }, {
                    "eventid": 241,
                    "time": 1490329982,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 417,
                    "delta": 1440,
                    "device": "PortElizabeth-rtr",
                    "id": "58D4A17E-1-1"
                }, {
                    "eventid": 257,
                    "time": 1490326322,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 423,
                    "delta": 6060,
                    "device": "Pretoria-rtr",
                    "id": "58D49332-1-1"
                }, {
                    "eventid": 257,
                    "time": 1490330462,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 423,
                    "delta": 2280,
                    "device": "Pretoria-rtr",
                    "id": "58D4A35E-2-1"
                }, {
                    "eventid": 257,
                    "time": 1490331122,
                    "event": "IF-MIB.ifOperStatus",
                    "state": "up",
                    "deviceid": 423,
                    "delta": 360,
                    "device": "Pretoria-rtr",
                    "id": "58D4A5F2-1-1"
                }],
                "type": "event_record",
                "data_total": 20
            }],
            "errmsg": "ok",
            "success": true,
            "time": 1490333357
        },
        "api_version": "2.1"
    }
    
    

    Use to retrieve details of specified event records.

    Field ID Type Description
    delta Integer The number of seconds since the last record of the same event
    device String The name of the device that owns the entity
    deviceid Integer The ID of the device that owns the entity
    entity String The name of the entity that owns the event
    entityid Integer The ID of the entity that owns the entity
    entityTypeName String The name of the type of entity that owns the event
    entityTypeTitle String The title of the type of entity that owns the event
    event String The event text associated to the record
    eventid Integer The event id associated to the record
    id String Event Record Identifier
    note String The note associated with the record
    state String The state text associated to the record
    stateid Integer The state id associated to the record
    time Integer Epoch time that the record was created

    PUT /event_record/{id}

    Updating an existing event_record to add a note pertaining to the event.

    
    
    
    
    
    
    
    
    
    
    
    Field ID Type Description
    note String The note associated with the record