Class: Seer::Status
- Inherits:
-
Object
- Object
- Seer::Status
- Defined in:
- lib/seer/status.rb
Overview
Status API controller
Instance Method Summary collapse
-
#initialize(token: '', version: '2.0', host: '') ⇒ Status
constructor
Initialize a Status object.
-
#ports ⇒ Hash
Get all ports.
-
#services ⇒ Hash
Get SEER supported service.
-
#token ⇒ Hash
Get token status.
Constructor Details
#initialize(token: '', version: '2.0', host: '') ⇒ Status
Initialize a Status object
8 9 10 11 12 13 14 15 |
# File 'lib/seer/status.rb', line 8 def initialize(token: '', version: '2.0', host: '') @host = host + '/status' @header = { content_type: 'application/json', x_seer_token: token, x_seer_version: version } end |
Instance Method Details
#ports ⇒ Hash
Get all ports
27 28 29 30 31 |
# File 'lib/seer/status.rb', line 27 def ports url = @host + '/ports' response = RestClient.get url, @header JSON.load response end |
#services ⇒ Hash
Get SEER supported service
19 20 21 22 23 |
# File 'lib/seer/status.rb', line 19 def services url = @host + '/services' response = RestClient.get url, @header JSON.load response end |
#token ⇒ Hash
Get token status
35 36 37 38 39 |
# File 'lib/seer/status.rb', line 35 def token url = @host + "/token?token=#{@header[:x_seer_token]}" response = RestClient.get url, @header JSON.load response end |