class Pxgrid::ISE::Session
Constants
- SERVICE
Public Class Methods
new(pxgrid_client)
click to toggle source
# File lib/pxgrid.rb, line 76 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
Public Instance Methods
getSessions(startTimestamp = "")
click to toggle source
# File lib/pxgrid.rb, line 91 def getSessions(startTimestamp = "") if startTimestamp.empty? params = {} else params = {"startTimestamp": startTimestamp} end return JSON.parse(@client.post("getSessions", params.to_json).body)["sessions"] end