Class: Pxgrid::ISE::Radius
- Inherits:
-
Object
- Object
- Pxgrid::ISE::Radius
- Defined in:
- lib/pxgrid.rb
Constant Summary collapse
- SERVICE =
"com.cisco.ise.radius"
Instance Method Summary collapse
- #getFailures(startTimestamp = "") ⇒ Object
-
#initialize(pxgrid_client) ⇒ Radius
constructor
A new instance of Radius.
Constructor Details
#initialize(pxgrid_client) ⇒ Radius
Returns a new instance of Radius.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/pxgrid.rb', line 107 def initialize(pxgrid_client) service = pxgrid_client.serviceLookup(SERVICE)["services"].sample @nodeName = service["nodeName"] @username = pxgrid_client.username @password = pxgrid_client.accessSecret(@nodeName) @client = Faraday.new(service["properties"]["restBaseUrl"]) do |conn| conn.adapter Faraday.default_adapter conn.basic_auth @username, @password conn.ssl[:verify] = false conn.headers["Accept"] = "application/json" conn.headers["Content-Type"] = "application/json" end end |
Instance Method Details
#getFailures(startTimestamp = "") ⇒ Object
122 123 124 125 126 127 128 129 |
# File 'lib/pxgrid.rb', line 122 def getFailures(startTimestamp = "") if startTimestamp.empty? params = {} else params = {"startTimestamp": startTimestamp} end return JSON.parse(@client.post("getFailures", params.to_json).body)["failures"] end |