Class: Morpheus::SetupInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::SetupInterface
- Defined in:
- lib/morpheus/api/setup_interface.rb
Overview
There is no authentication required for this API.
Instance Method Summary collapse
- #check(params = {}, timeout = 5) ⇒ Object
- #get(params = {}, timeout = 30) ⇒ Object
- #init(payload = {}, timeout = 60) ⇒ Object
-
#initialize(base_url) ⇒ SetupInterface
constructor
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil) @access_token = access_token @refresh_token = refresh_token @base_url = base_url @expires_at = expires_at end.
-
#ping(params = {}, timeout = 5) ⇒ Object
no JSON here, just a 200 OK 'NOTHING TO SEE HERE'.
Constructor Details
#initialize(base_url) ⇒ SetupInterface
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil) @access_token = access_token @refresh_token = refresh_token @base_url = base_url @expires_at = expires_at end
11 12 13 |
# File 'lib/morpheus/api/setup_interface.rb', line 11 def initialize(base_url) @base_url = base_url end |
Instance Method Details
#check(params = {}, timeout = 5) ⇒ Object
23 24 25 26 27 |
# File 'lib/morpheus/api/setup_interface.rb', line 23 def check(params={}, timeout=5) url = "#{@base_url}/api/setup/check" headers = {:params => params, 'Content-Type' => 'application/json' } execute(method: :get, url: url, headers: headers, timeout: timeout) end |
#get(params = {}, timeout = 30) ⇒ Object
29 30 31 32 33 |
# File 'lib/morpheus/api/setup_interface.rb', line 29 def get(params={}, timeout=30) url = "#{@base_url}/api/setup" headers = {:params => params, 'Content-Type' => 'application/json' } execute(method: :get, url: url, headers: headers, timeout: timeout) end |
#init(payload = {}, timeout = 60) ⇒ Object
35 36 37 38 39 |
# File 'lib/morpheus/api/setup_interface.rb', line 35 def init(payload={}, timeout=60) url = "#{@base_url}/api/setup/init" headers = { 'Content-Type' => 'application/json' } execute(method: :post, url: url, headers: headers, payload: payload.to_json, timeout: timeout) end |
#ping(params = {}, timeout = 5) ⇒ Object
no JSON here, just a 200 OK 'NOTHING TO SEE HERE'
16 17 18 19 20 21 |
# File 'lib/morpheus/api/setup_interface.rb', line 16 def ping(params={}, timeout=5) url = "#{@base_url}/ping" headers = {:params => params } opts = {method: :get, url: url, headers: headers, timeout: timeout} execute(opts, false) end |