class Purest::HostGroup

Constants

GET_PARAMS

Public Instance Methods

create(options = nil) click to toggle source
Calls superclass method Purest::APIMethods#create
# File lib/purest/host_group.rb, line 17
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, 'hgroup', appended_path)
end
delete(options = nil) click to toggle source

Delete a host group, DELETE @param options options to pass

Calls superclass method Purest::APIMethods#delete
# File lib/purest/host_group.rb, line 35
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, 'hgroup', appended_path)
end
get(options = nil) click to toggle source

Get a list of hostgroups, GET @param options [Hash] options to pass in

Calls superclass method Purest::APIMethods#get
# File lib/purest/host_group.rb, line 13
def get(options = nil)
  super(options, 'hgroup', GET_PARAMS, [:show_volume])
end
update(options = nil) click to toggle source
Calls superclass method Purest::APIMethods#update
# File lib/purest/host_group.rb, line 29
def update(options = nil)
  super(options, 'hgroup')
end