class Purest::Host
Constants
- GET_PARAMS
Public Instance Methods
create(options = nil)
click to toggle source
Calls superclass method
Purest::APIMethods#create
# File lib/purest/host.rb, line 16 def create(options = nil) # The API doesn't accept some of these options in the HTTP body # during a POST, so we remove them from the options hash after # creating a path to append to the base URL in APIMethods.create if options[:name] && options[:volume] appended_path = "#{options.delete(:name)}/volume/#{options.delete(:volume)}" elsif options[:name] && options[:protection_group] appended_path = "#{options.delete(:name)}/pgroup/#{options.delete(:protection_group)}" end super(options, 'host', appended_path) end
delete(options = nil)
click to toggle source
Calls superclass method
Purest::APIMethods#delete
# File lib/purest/host.rb, line 32 def delete(options = nil) if options[:name] && options[:volume] appended_path = "#{options.delete(:name)}/volume/#{options.delete(:volume)}" elsif options[:name] && options[:protection_group] appended_path = "#{options.delete(:name)}/pgroup/#{options.delete(:protection_group)}" end super(options, 'host', appended_path) end
get(options = nil)
click to toggle source
Get a list of hosts, GET @param options [Hash] options to pass
Calls superclass method
Purest::APIMethods#get
# File lib/purest/host.rb, line 12 def get(options = nil) super(options, 'host', GET_PARAMS, [:show_volume]) end
update(options = nil)
click to toggle source
Calls superclass method
Purest::APIMethods#update
# File lib/purest/host.rb, line 28 def update(options = nil) super(options, 'host') end