class Fog::Compute::Gridscale::Storage

Public Instance Methods

delete() click to toggle source
# File lib/fog/compute/gridscale/models/storage.rb, line 28
def delete
  requires :object_uuid
  response = service.storage_delete object_uuid
  response.body
end
destroy() click to toggle source
# File lib/fog/compute/gridscale/models/storage.rb, line 34
def destroy
  requires :object_uuid
  response = service.storage_delete object_uuid
  response.body
end
save() click to toggle source
# File lib/fog/compute/gridscale/models/storage.rb, line 40
def save
  raise Fog::Errors::Error.new('Re-saving an existing object may create a duplicate') if persisted?
  requires :name, :capacity

  options = {}

  if attributes[:template]
    options[:template] = template
  end

  if attributes[:labels]
    options[:labels] = labels
  end

  if attributes[:storage_type]
    options[:storage_type] = storage_type
  end

  if attributes[:location_uuid]
    options[:location_uuid] = location_uuid
  end

  data = service.storage_create(name, capacity, options)

  merge_attributes(data.body)
  true
end
update() click to toggle source
# File lib/fog/compute/gridscale/models/storage.rb, line 68
def update
  requires :object_uuid
  data = service.storage_update(object_uuid)
  merge_attributes(data.body)
  true
end