Parent

Class/Module Index [+]

Quicksearch

Fog::HP::BlockStorage::Snapshot

Public Class Methods

new(attributes = {}) click to toggle source

attribute :metadata

# File lib/fog/hp/models/block_storage/snapshot.rb, line 19
def initialize(attributes = {})
  # assign these attributes first to prevent race condition with persisted?
  self.force = attributes.delete(:force)   # force snapshotting of attached volumes
  super
end

Public Instance Methods

destroy() click to toggle source
# File lib/fog/hp/models/block_storage/snapshot.rb, line 25
def destroy
  requires :id
  service.delete_snapshot(id)
  true
end
force=(new_force) click to toggle source
# File lib/fog/hp/models/block_storage/snapshot.rb, line 31
def force=(new_force)
  @force = new_force
end
ready?() click to toggle source
# File lib/fog/hp/models/block_storage/snapshot.rb, line 35
def ready?
  self.status == 'available'
end
save() click to toggle source
# File lib/fog/hp/models/block_storage/snapshot.rb, line 39
def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
  requires :name, :volume_id
  options = {
    #'metadata'        => metadata,      # TODO: Add metadata when snapshots support it
    'force'           => @force
  }
  options = options.reject {|key, value| value.nil?}
  data = service.create_snapshot(name, description, volume_id, options)
  merge_attributes(data.body['snapshot'])
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.