Class: Morpheus::TokensInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::TokensInterface
- Defined in:
- lib/morpheus/api/tokens_interface.rb
Instance Method Summary collapse
- #available_clients(params = {}) ⇒ Object
- #base_path ⇒ Object
- #create(payload, params = {}) ⇒ Object
-
#destroy(id, params = {}) ⇒ Object
def update(id, payload, params={}) execute(method: :put, url: "##base_path/#id", params: params, headers: headers) end.
- #destroy_all(params = {}) ⇒ Object
- #get(id, params = {}, headers = {}) ⇒ Object
- #list(params = {}, headers = {}) ⇒ Object
Instance Method Details
#available_clients(params = {}) ⇒ Object
35 36 37 |
# File 'lib/morpheus/api/tokens_interface.rb', line 35 def available_clients(params={}) execute(method: :get, url: "#{base_path}/api-clients", params: params) end |
#base_path ⇒ Object
5 6 7 |
# File 'lib/morpheus/api/tokens_interface.rb', line 5 def base_path "/api/tokens" end |
#create(payload, params = {}) ⇒ Object
18 19 20 |
# File 'lib/morpheus/api/tokens_interface.rb', line 18 def create(payload, params={}) execute(method: :post, url: "#{base_path}", payload: payload, params: params) end |
#destroy(id, params = {}) ⇒ Object
def update(id, payload, params={}) execute(method: :put, url: "##base_path/#id", params: params, headers: headers) end
26 27 28 29 |
# File 'lib/morpheus/api/tokens_interface.rb', line 26 def destroy(id, params={}) validate_id!(id) execute(method: :delete, url: "#{base_path}/#{id}", params: params) end |
#destroy_all(params = {}) ⇒ Object
31 32 33 |
# File 'lib/morpheus/api/tokens_interface.rb', line 31 def destroy_all(params={}) execute(method: :delete, url: "#{base_path}", params: params) end |
#get(id, params = {}, headers = {}) ⇒ Object
13 14 15 16 |
# File 'lib/morpheus/api/tokens_interface.rb', line 13 def get(id, params={}, headers={}) validate_id!(id) execute(method: :get, url: "#{base_path}/#{id}", params: params, headers: headers) end |
#list(params = {}, headers = {}) ⇒ Object
9 10 11 |
# File 'lib/morpheus/api/tokens_interface.rb', line 9 def list(params={}, headers={}) execute(method: :get, url: "#{base_path}", params: params, headers: headers) end |