Class: Morpheus::UserGroupsInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::UserGroupsInterface
- Defined in:
- lib/morpheus/api/user_groups_interface.rb
Instance Method Summary collapse
- #create(account_id, options) ⇒ Object
- #destroy(account_id, id) ⇒ Object
- #get(account_id, id) ⇒ Object
- #list(account_id, options = {}) ⇒ Object
- #update(account_id, id, options) ⇒ Object
Instance Method Details
#create(account_id, options) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/morpheus/api/user_groups_interface.rb', line 21 def create(account_id, ) url = build_url(account_id) headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } payload = opts = {method: :post, url: url, timeout: 10, headers: headers, payload: payload.to_json} execute(opts) end |
#destroy(account_id, id) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/morpheus/api/user_groups_interface.rb', line 37 def destroy(account_id, id) url = build_url(account_id, id) headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :delete, url: url, timeout: 10, headers: headers} execute(opts) end |
#get(account_id, id) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/morpheus/api/user_groups_interface.rb', line 5 def get(account_id, id) raise "#{self.class}.get() passed a blank id!" if id.to_s == '' url = build_url(account_id, id) headers = { params: {}, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, timeout: 10, headers: headers} execute(opts) end |
#list(account_id, options = {}) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/morpheus/api/user_groups_interface.rb', line 13 def list(account_id, ={}) url = build_url(account_id) headers = { params: {}, authorization: "Bearer #{@access_token}" } headers[:params].merge!() opts = {method: :get, url: url, timeout: 10, headers: headers} execute(opts) end |
#update(account_id, id, options) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/morpheus/api/user_groups_interface.rb', line 29 def update(account_id, id, ) url = build_url(account_id, id) headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } payload = opts = {method: :put, url: url, timeout: 10, headers: headers, payload: payload.to_json} execute(opts) end |