Class: Morpheus::IntegrationsInterface
- Inherits:
-
RestInterface
- Object
- RestInterface
- Morpheus::IntegrationsInterface
- Defined in:
- lib/morpheus/api/integrations_interface.rb
Instance Method Summary collapse
- #base_path ⇒ Object
- #create_object(id, payload, params = {}, headers = {}) ⇒ Object
- #destroy_object(id, obj_id, params = {}, headers = {}) ⇒ Object
- #get_inventory(id, inventory_id, params = {}, headers = {}) ⇒ Object
- #get_object(id, obj_id, params = {}, headers = {}) ⇒ Object
-
#list_inventory(id, params = {}, headers = {}) ⇒ Object
Integration Inventory Item CRUD.
-
#list_objects(id, params = {}, headers = {}) ⇒ Object
Integration Objects CRUD.
- #refresh(id, params = {}, payload = {}, headers = {}) ⇒ Object
-
#update_inventory(id, inventory_id, payload, params = {}, headers = {}) ⇒ Object
def create_inventory(id, payload, params={}, headers={}) validate_id!(id) execute(method: :post, url: "##base_path/#id/inventory", params: params, payload: payload, headers: headers) end.
- #update_object(id, obj_id, payload, params = {}, headers = {}) ⇒ Object
Instance Method Details
#base_path ⇒ Object
5 6 7 |
# File 'lib/morpheus/api/integrations_interface.rb', line 5 def base_path "/api/integrations" end |
#create_object(id, payload, params = {}, headers = {}) ⇒ Object
27 28 29 30 |
# File 'lib/morpheus/api/integrations_interface.rb', line 27 def create_object(id, payload, params={}, headers={}) validate_id!(id) execute(method: :post, url: "#{base_path}/#{id}/objects", params: params, payload: payload, headers: headers) end |
#destroy_object(id, obj_id, params = {}, headers = {}) ⇒ Object
38 39 40 41 42 |
# File 'lib/morpheus/api/integrations_interface.rb', line 38 def destroy_object(id, obj_id, params = {}, headers={}) validate_id!(id) validate_id!(obj_id) execute(method: :delete, url: "#{base_path}/#{id}/objects/#{obj_id}", params: params, headers: headers) end |
#get_inventory(id, inventory_id, params = {}, headers = {}) ⇒ Object
51 52 53 54 55 |
# File 'lib/morpheus/api/integrations_interface.rb', line 51 def get_inventory(id, inventory_id, params={}, headers={}) validate_id!(id) validate_id!(inventory_id) execute(method: :get, url: "#{base_path}/#{id}/inventory/#{inventory_id}", params: params, headers: headers) end |
#get_object(id, obj_id, params = {}, headers = {}) ⇒ Object
21 22 23 24 25 |
# File 'lib/morpheus/api/integrations_interface.rb', line 21 def get_object(id, obj_id, params={}, headers={}) validate_id!(id) validate_id!(obj_id) execute(method: :get, url: "#{base_path}/#{id}/objects/#{obj_id}", params: params, headers: headers) end |
#list_inventory(id, params = {}, headers = {}) ⇒ Object
Integration Inventory Item CRUD
46 47 48 49 |
# File 'lib/morpheus/api/integrations_interface.rb', line 46 def list_inventory(id, params={}, headers={}) validate_id!(id) execute(method: :get, url: "#{base_path}/#{id}/inventory", params: params, headers: headers) end |
#list_objects(id, params = {}, headers = {}) ⇒ Object
Integration Objects CRUD
16 17 18 19 |
# File 'lib/morpheus/api/integrations_interface.rb', line 16 def list_objects(id, params={}, headers={}) validate_id!(id) execute(method: :get, url: "#{base_path}/#{id}/objects", params: params, headers: headers) end |
#refresh(id, params = {}, payload = {}, headers = {}) ⇒ Object
9 10 11 12 |
# File 'lib/morpheus/api/integrations_interface.rb', line 9 def refresh(id, params={}, payload={}, headers={}) validate_id!(id) execute(method: :post, url: "#{base_path}/#{id}/refresh", params: params, payload: payload, headers: headers) end |
#update_inventory(id, inventory_id, payload, params = {}, headers = {}) ⇒ Object
def create_inventory(id, payload, params={}, headers={}) validate_id!(id) execute(method: :post, url: "##base_path/#id/inventory", params: params, payload: payload, headers: headers) end
62 63 64 65 66 |
# File 'lib/morpheus/api/integrations_interface.rb', line 62 def update_inventory(id, inventory_id, payload, params={}, headers={}) validate_id!(id) validate_id!(inventory_id) execute(method: :put, url: "#{base_path}/#{id}/inventory/#{inventory_id}", params: params, payload: payload, headers: headers) end |
#update_object(id, obj_id, payload, params = {}, headers = {}) ⇒ Object
32 33 34 35 36 |
# File 'lib/morpheus/api/integrations_interface.rb', line 32 def update_object(id, obj_id, payload, params={}, headers={}) validate_id!(id) validate_id!(obj_id) execute(method: :put, url: "#{base_path}/#{id}/objects/#{obj_id}", params: params, payload: payload, headers: headers) end |