Example restmon probe connection to an endpoint that requires bearer authentication
search cancel

Example restmon probe connection to an endpoint that requires bearer authentication

book

Article ID: 218100

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

Running into issues connecting to cloudflare api. It requires bearer based authentication.

Environment

Release : 20.4
Component : UIM - WEBSERVICES_REST

Resolution

Example <name>_schema.JSON content:

{

 "cloudflare": {
  "urls": [
   {
    "xml_ns": "",
    "src": "",
    "var": "",
    "id": "status",
    "url": "/client/v4/zones/:zone_identifier/waiting_rooms/:identifier/status"
   }
  ],
  "definition": {
   "resource_category": null,
   "defaults": {
    "port": 443,
    "interval": 30,
    "httptimeout": 30000,
    "headers": {
     "Authorization": "Bearer <api-token-to-be-added-here>"
    }
   },
   "auth": "bearer",
   "xml_ns": "",
   "name": "cloudflare",
   "type": "https"
  },
  "metrics": [
   {
    "xml_ns": "",
    "attributes": {
     "uim": {
      "defaultpublishing": "true",
      "qos_name": "QOS_CLOUDFLARE_QUEUED_USERS",
      "qos_desc": "estimated_queued_users",
      "qos_abbr": "count",
      "metric_type": "1.1:1",
      "qos_unit": "count",
      "target": "Cloudflare/status/queued_users",
      "source": "%hostname"
     }
    },
    "value": "$['result'].['estimated_queued_users']",
    "url": "status",
    "group": "Cloudflare"
   },
   {
    "xml_ns": "",
    "attributes": {
     "uim": {
      "defaultpublishing": "true",
      "qos_name": "QOS_CLOUDFLARE_MAX_TIME",
      "qos_desc": "max_estimated_time_minutes",
      "qos_abbr": "count",
      "metric_type": "1.1:1",
      "qos_unit": "minutes",
      "target": "Cloudflare/status/max_time",
      "source": "%hostname"
     }
    },
    "value": "$['result'].['max_estimated_time_minutes']",
    "url": "status",
    "group": "Cloudflare"
   },
   {
    "xml_ns": "",
    "attributes": {
     "uim": {
      "defaultpublishing": "true",
      "qos_name": "QOS_CLOUDFLARE_ACTIVE_USERS",
      "qos_desc": "estimated_total_active_users",
      "qos_abbr": "count",
      "metric_type": "1.1:1",
      "qos_unit": "count",
      "target": "Cloudflare/status/active_users",
      "source": "%hostname"
     }
    },
    "value": "$['result'].['estimated_total_active_users']",
    "url": "status",
    "group": "Cloudflare"
   }
  ]
 }
}