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
-
#authorization_required? ⇒ Boolean
no Authorization header is required.
-
#check(params = {}, timeout = 5) ⇒ Object
this should go away and just use.
-
#default_timeout ⇒ Object
health checks use a relatively small timeout by default.
- #get(params = {}) ⇒ Object
- #hub_login(payload = {}) ⇒ Object
- #hub_register(payload = {}) ⇒ Object
-
#init(payload = {}) ⇒ Object
you can only use this successfully one time on a fresh install.
Instance Method Details
#authorization_required? ⇒ Boolean
no Authorization header is required
6 7 8 |
# File 'lib/morpheus/api/setup_interface.rb', line 6 def false end |
#check(params = {}, timeout = 5) ⇒ Object
this should go away and just use
23 24 25 26 27 28 |
# File 'lib/morpheus/api/setup_interface.rb', line 23 def check(params={}, timeout=5) headers = {params: params} # use access token if authenticated headers[:authorization] = "Bearer #{@access_token}" if @access_token execute(method: :get, url: "/api/setup/check", headers: headers, timeout: timeout) end |
#default_timeout ⇒ Object
health checks use a relatively small timeout by default
11 12 13 |
# File 'lib/morpheus/api/setup_interface.rb', line 11 def default_timeout 5 end |
#get(params = {}) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/morpheus/api/setup_interface.rb', line 15 def get(params={}) headers = {params: params} # use access token if authenticated headers[:authorization] = "Bearer #{@access_token}" if @access_token execute(method: :get, url: "/api/setup", headers: headers) end |
#hub_login(payload = {}) ⇒ Object
41 42 43 44 |
# File 'lib/morpheus/api/setup_interface.rb', line 41 def hub_login(payload={}) headers = { 'Content-Type' => 'application/json' } execute(method: :post, url: "/api/setup/hub-login", headers: headers, payload: payload.to_json) end |
#hub_register(payload = {}) ⇒ Object
36 37 38 39 |
# File 'lib/morpheus/api/setup_interface.rb', line 36 def hub_register(payload={}) headers = { 'Content-Type' => 'application/json' } execute(method: :post, url: "/api/setup/hub-register", headers: headers, payload: payload.to_json) end |
#init(payload = {}) ⇒ Object
you can only use this successfully one time on a fresh install.
31 32 33 34 |
# File 'lib/morpheus/api/setup_interface.rb', line 31 def init(payload={}) headers = { 'Content-Type' => 'application/json' } execute(method: :post, url: "/api/setup/init", headers: headers, payload: payload.to_json) end |