class Fog::Compute::ProfitBricks::Volumes

Public Instance Methods

all(datacenter_id) click to toggle source
# File lib/fog/profitbricks/models/compute/volumes.rb, line 11
def all(datacenter_id)
  result = service.get_all_volumes(datacenter_id)

  volumes = result.body['items'].each { |volume| volume['datacenter_id'] = datacenter_id }
  result.body['items'] = volumes

  load(result.body['items'].each { |volume| flatten(volume) })
end
get(datacenter_id, volume_id) click to toggle source
# File lib/fog/profitbricks/models/compute/volumes.rb, line 20
def get(datacenter_id, volume_id)
  response = service.get_volume(datacenter_id, volume_id)
  volume = response.body

  volume['datacenter_id'] = datacenter_id
  new(flatten(volume))
end