Class: Telemetry
- Inherits:
-
Object
- Object
- Telemetry
- Defined in:
- lib/cnos-rbapi/telemetry.rb
Overview
The Telemetry class provides a class implementation and methods for managing Telemetry features on the node. This class presents an abstraction
Constant Summary collapse
- @@cfg =
'/nos/api/cfg/telemetry'
Class Method Summary collapse
-
.clear_bst_cgsn_ctrs(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.clear_bst_stats(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.clear_bst_threshold(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.get_bst_feature(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.get_bst_report(conn, params) ⇒ Object
parameters: conn - connection object to the node.
-
.get_bst_threshold(conn, params) ⇒ Object
parameters: conn - connection object to the node.
-
.get_bst_tracking(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.get_sys_feature(conn) ⇒ Object
parameters: conn - connection object to the node.
-
.set_bst_feature(conn, params) ⇒ Object
parameters: conn - connection object to the node params - dictionary that requires the following format of key-value pairs { “bstenable”: 1, “sendasyncreports”: 1, “collectioninterval”: 300, “triggerratelimit”: 5, “triggerratelimitinterval”: 2, “sendsnapshotontrigger”: 1, “asyncfullreports”: 1, } description - bstenable :Set to 1 to enable BST, 0 to disable it.
-
.set_bst_threshold(conn, params) ⇒ Object
parameters: conn - connection object to the node params - dictionary that requires the following format of key-value pairs for the realms given in description { “realm”: “ingressservicepool”, “servicepool” : 0, “umsharethreshold” : 70 } description - .
-
.set_bst_tracking(conn, params) ⇒ Object
parameters: conn - connection object to the node params - dictionary that requires the following format of key-value pairs { “trackpeakstats” : 1, “trackingressportprioritygroup” : 1, “trackingressportservicepool” : 1, “trackingressservicepool” : 1, “trackegressportservicepool” : 1, “trackegressservicepool” : 1, “trackegressrqequeue” : 1, “trackdevice” : 1 } description - trackpeakstats :Set to 1 to peak statistics tracking, 0 to disable this feature trackingressportprioritygroup:Set to 1 to enable ingress port priority group tracking, 0 to disable this feature trackingressportservicepool :Set to 1 to enable ingress port service pool tracking, 0 to disable this feature trackingressservicepool :Set to 1 to enable ingress service pool tracking, 0 to disable this feature trackegressportservicepool :Set to 1 to enable egress port service pool tracking, 0 to disable this feature trackegressservicepool :Set to 1 to enable egress service pool tracking, 0 to disable this feature trackegressrqequeue :Set to 1 to enable egress RQE queue tracking, 0 to disable this feature trackdevice :Set to 1 to enable tracking of this device, 0 to disable this feature.
-
.set_sys_feature(conn, params) ⇒ Object
parameters: conn - connection object to the node params - dictionary that requires the following format of key-value pairs { “heartbeatenable” : 1, “msginterval” : 10 } description - heartbeat-enable :When enabled, the Agent asynchronously sends the registration and heartbeat message to the collector.
Class Method Details
.clear_bst_cgsn_ctrs(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
272 273 274 275 276 |
# File 'lib/cnos-rbapi/telemetry.rb', line 272 def self.clear_bst_cgsn_ctrs(conn) url = form_url(conn, @@cfg + '/clear-cgsn-drop-counters') hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.clear_bst_stats(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
259 260 261 262 263 |
# File 'lib/cnos-rbapi/telemetry.rb', line 259 def self.clear_bst_stats(conn) url = form_url(conn, @@cfg + '/bst/clear/statistics') hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.clear_bst_threshold(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
246 247 248 249 250 |
# File 'lib/cnos-rbapi/telemetry.rb', line 246 def self.clear_bst_threshold(conn) url = form_url(conn, @@cfg + '/bst/clear/threshold') hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.get_bst_feature(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
131 132 133 134 135 |
# File 'lib/cnos-rbapi/telemetry.rb', line 131 def self.get_bst_feature(conn) url = form_url(conn, @@cfg + '/bst/feature') hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.get_bst_report(conn, params) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
194 195 196 197 198 199 200 201 |
# File 'lib/cnos-rbapi/telemetry.rb', line 194 def self.get_bst_report(conn, params) temp = @@cfg.dup temp.sub! 'cfg', 'info' url = form_url(conn, temp + '/bst/report') hdr = form_hdr(conn) params = params.to_json Rest.post(conn, url, hdr, params) end |
.get_bst_threshold(conn, params) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
210 211 212 213 214 215 |
# File 'lib/cnos-rbapi/telemetry.rb', line 210 def self.get_bst_threshold(conn, params) url = form_url(conn, @@cfg + '/bst/threshold') hdr = form_hdr(conn) params = params.to_json Rest.post(conn, url, hdr, params) end |
.get_bst_tracking(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
76 77 78 79 80 |
# File 'lib/cnos-rbapi/telemetry.rb', line 76 def self.get_bst_tracking(conn) url = form_url(conn, @@cfg + '/bst/tracking') hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.get_sys_feature(conn) ⇒ Object
parameters:
conn - connection object to the node
return: JSON response
36 37 38 39 40 |
# File 'lib/cnos-rbapi/telemetry.rb', line 36 def self.get_sys_feature(conn) url = form_url(conn, @@cfg + '/feature') hdr = form_hdr(conn) Rest.get(conn, url, hdr) end |
.set_bst_feature(conn, params) ⇒ Object
parameters:
conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
{
"bstenable": 1,
"sendasyncreports": 1,
"collectioninterval": 300,
"triggerratelimit": 5,
"triggerratelimitinterval": 2,
"sendsnapshotontrigger": 1,
"asyncfullreports": 1,
}
description -
bst
asynchronous reports, 0 to disable this feature.
collection
reports containing data related to all counters.
When the feature is disabled, the agent sends
incremental reports containing only the counters
that have changed since the last report.
return: JSON response
180 181 182 183 184 185 |
# File 'lib/cnos-rbapi/telemetry.rb', line 180 def self.set_bst_feature(conn, params) url = form_url(conn, @@cfg + '/bst/feature') hdr = form_hdr(conn) params = params.to_json Rest.put(conn, url, hdr, params) end |
.set_bst_threshold(conn, params) ⇒ Object
parameters:
conn - connection object to the node
params - dictionary that requires the following format of key-value pairs for the realms
given in description
{
"realm": "ingressservicepool",
232 233 234 235 236 237 |
# File 'lib/cnos-rbapi/telemetry.rb', line 232 def self.set_bst_threshold(conn, params) url = form_url(conn, @@cfg + '/bst/threshold') hdr = form_hdr(conn) params = params.to_json Rest.put(conn, url, hdr, params) end |
.set_bst_tracking(conn, params) ⇒ Object
parameters:
conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
{
"trackpeakstats" : 1,
"trackingressportprioritygroup" : 1,
"trackingressportservicepool" : 1,
"trackingressservicepool" : 1,
"trackegressportservicepool" : 1,
"trackegressservicepool" : 1,
"trackegressrqequeue" : 1,
"trackdevice" : 1
}
description -
track
117 118 119 120 121 122 |
# File 'lib/cnos-rbapi/telemetry.rb', line 117 def self.set_bst_tracking(conn, params) url = form_url(conn, @@cfg + '/bst/tracking') hdr = form_hdr(conn) params = params.to_json Rest.put(conn, url, hdr, params) end |
.set_sys_feature(conn, params) ⇒ Object
parameters:
conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
{
62 63 64 65 66 67 |
# File 'lib/cnos-rbapi/telemetry.rb', line 62 def self.set_sys_feature(conn, params) url = form_url(conn, @@cfg + '/feature') hdr = form_hdr(conn) params = params.to_json Rest.put(conn, url, hdr, params) end |