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

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

Instance Method Summary collapse

Instance Method Details

#accept(transfer_id, auth_key) ⇒ Object



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

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



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

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

#get(transfer_id) ⇒ Object



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

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

#summary(options = {}) ⇒ Object



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

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