Class: Fog::Volume::OpenStack::Transfers

Inherits:
OpenStack::Collection show all
Defined in:
lib/fog/openstack/models/volume/transfers.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

#destroy, #load_response

Instance Method Details

#accept(transfer_id, auth_key) ⇒ Object


26
27
28
29
30
31
32
33
# File 'lib/fog/openstack/models/volume/transfers.rb', line 26

def accept(transfer_id, auth_key)
  # NOTE: This is NOT a method on the Transfer object, since the
  # receiver cannot see the transfer object in the get_transfer_details
  # or list_transfers(_detailed) requests.
  if transfer = service.accept_transfer(transfer_id, auth_key).body['transfer']
    new(transfer)
  end
end

#all(options = {}) ⇒ Object


10
11
12
# File 'lib/fog/openstack/models/volume/transfers.rb', line 10

def all(options = {})
  load_response(service.list_transfers_detailed(options), 'transfers')
end

#get(transfer_id) ⇒ Object


18
19
20
21
22
23
24
# File 'lib/fog/openstack/models/volume/transfers.rb', line 18

def get(transfer_id)
  if transfer = service.get_transfer_details(transfer_id).body['transfer']
    new(transfer)
  end
rescue Fog::Volume::OpenStack::NotFound
  nil
end

#summary(options = {}) ⇒ Object


14
15
16
# File 'lib/fog/openstack/models/volume/transfers.rb', line 14

def summary(options = {})
  load_response(service.list_transfers(options), 'transfers')
end