class Morpheus::LibraryInstanceTypesInterface

Public Instance Methods

create(options) click to toggle source
# File lib/morpheus/api/library_instance_types_interface.rb, line 22
def create(options)
  url = "#{@base_url}/api/library"
  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(id, payload={}) click to toggle source
# File lib/morpheus/api/library_instance_types_interface.rb, line 45
def destroy(id, payload={})
  url = "#{@base_url}/api/library/#{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(id, params={}) click to toggle source
# File lib/morpheus/api/library_instance_types_interface.rb, line 5
def get(id, params={})
  raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
  # new URL is available in api 4.2 +
  # url = "#{@base_url}/api/library/#{id}"
  url = "#{@base_url}/api/library/#{id}"
  headers = { params: params, authorization: "Bearer #{@access_token}" }
  opts = {method: :get, url: url, headers: headers}
  execute(opts)
end
list(params={}) click to toggle source
# File lib/morpheus/api/library_instance_types_interface.rb, line 15
def list(params={})
  url = "#{@base_url}/api/library"
  headers = { params: params, authorization: "Bearer #{@access_token}" }
  opts = {method: :get, url: url, headers: headers}
  execute(opts)
end
update(id, options) click to toggle source
# File lib/morpheus/api/library_instance_types_interface.rb, line 30
def update(id, options)
  url = "#{@base_url}/api/library/#{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