Class: Morpheus::LibraryContainerTypesInterface

Inherits:
APIClient
  • Object
show all
Defined in:
lib/morpheus/api/library_container_types_interface.rb

Instance Method Summary collapse

Instance Method Details

#create(layout_id, options) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/morpheus/api/library_container_types_interface.rb', line 20

def create(layout_id, options)
  url = build_url(layout_id)
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  payload = options
  opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
  execute(opts)
end

#destroy(layout_id, id, payload = {}) ⇒ Object



36
37
38
39
40
41
# File 'lib/morpheus/api/library_container_types_interface.rb', line 36

def destroy(layout_id, id, payload={})
  url = build_url(layout_id, id)
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  opts = {method: :delete, url: url, headers: headers, payload: payload.to_json}
  execute(opts)
end

#get(layout_id, id, params = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/morpheus/api/library_container_types_interface.rb', line 5

def get(layout_id, id, params={})
  raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
  url = build_url(layout_id, id)
  headers = { params: params, authorization: "Bearer #{@access_token}" }
  opts = {method: :get, url: url, headers: headers}
  execute(opts)
end

#list(layout_id, params = {}) ⇒ Object



13
14
15
16
17
18
# File 'lib/morpheus/api/library_container_types_interface.rb', line 13

def list(layout_id, params={})
  url = build_url(layout_id)
  headers = { params: params, authorization: "Bearer #{@access_token}" }
  opts = {method: :get, url: url, headers: headers}
  execute(opts)
end

#update(layout_id, id, options) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/morpheus/api/library_container_types_interface.rb', line 28

def update(layout_id, id, options)
  url = build_url(layout_id, id)
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  payload = options
  opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
  execute(opts)
end