class Morpheus::StorageDatastoresInterface
Public Instance Methods
Source
# File lib/morpheus/api/storage_datastores_interface.rb, line 5 def base_path "#{@base_url}/api/data-stores" end
Source
# File lib/morpheus/api/storage_datastores_interface.rb, line 31 def create(options) url = "#{@base_url}/api/data-stores" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } payload = options execute(method: :post, url: url, headers: headers, payload: payload.to_json) end
Source
# File lib/morpheus/api/storage_datastores_interface.rb, line 9 def get(id, params={}) raise "#{self.class}.get() passed a blank id!" if id.to_s == '' url = "#{@base_url}/api/data-stores/#{id}" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end
Source
# File lib/morpheus/api/storage_datastores_interface.rb, line 17 def list(params={}) url = base_path headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end
Source
# File lib/morpheus/api/storage_datastores_interface.rb, line 24 def load_type_options(datastore_type) url = "/api/data-stores/#{datastore_type}/option-types" headers = { params: {}, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end
Source
# File lib/morpheus/api/storage_datastores_interface.rb, line 38 def update(id, payload) url = "#{@base_url}/api/data-stores/#{id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :put, url: url, headers: headers, payload: payload.to_json} execute(opts) end