Module: Fog::Volume::OpenStack::Transfers

Included in:
V1::Transfers, V2::Transfers
Defined in:
lib/fog/openstack/models/volume/transfers.rb

Instance Method Summary collapse

Instance Method Details

#accept(transfer_id, auth_key) ⇒ Object



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

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



8
9
10
# File 'lib/fog/openstack/models/volume/transfers.rb', line 8

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

#get(transfer_id) ⇒ Object



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

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



12
13
14
# File 'lib/fog/openstack/models/volume/transfers.rb', line 12

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