Class: Purest::Volume

Inherits:
APIMethods show all
Defined in:
lib/purest/volume.rb

Constant Summary collapse

GET_PARAMS =
%i[action block_size connect historical length names
pending pending_only pgrouplist private protect
shared snap space].freeze

Instance Method Summary collapse

Methods inherited from APIMethods

#append_path

Methods inherited from Rest

access_method?, #authenticated?, #concat_url, #initialize, #logout, method_missing, #use_named_parameter

Constructor Details

This class inherits a constructor from Purest::Rest

Instance Method Details

#create(options = nil) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/purest/volume.rb', line 17

def create(options = nil)
  if options[:name] && options[:protection_group]
    appended_path = "#{options.delete(:name)}/pgroup/#{options.delete(:protection_group)}"
  end

  super(options, 'volume', appended_path)
end

#delete(options = nil) ⇒ Object

Delete a volume, DELETE

Parameters:

  • options (Hash) (defaults to: nil)

    options to pass



31
32
33
34
35
36
37
# File 'lib/purest/volume.rb', line 31

def delete(options = nil)
  if options[:name] && options[:protection_group]
    appended_path = "#{options.delete(:name)}/pgroup/#{options.delete(:protection_group)}"
  end

  super(options, 'volume', appended_path)
end

#get(options = nil) ⇒ Object

Get a list of volumes, GET

Parameters:

  • options (Hash) (defaults to: nil)

    options to pass



13
14
15
# File 'lib/purest/volume.rb', line 13

def get(options = nil)
  super(options, 'volume', GET_PARAMS, %i[show_diff show_hgroup show_host])
end

#update(options = nil) ⇒ Object



25
26
27
# File 'lib/purest/volume.rb', line 25

def update(options = nil)
  super(options, 'volume')
end