Sha256: fc4323cf79a49415935179eb335be77175f2e2ea1833476838352c9fa9c4c96f

Contents?: true

Size: 993 Bytes

Versions: 20

Compression:

Stored size: 993 Bytes

Contents

require 'fog/openstack/models/collection'

module Fog
  module OpenStack
    class Volume
      module Transfers
        def all(options = {})
          load_response(service.list_transfers_detailed(options), 'transfers')
        end

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

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

        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
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
fog-openstack-1.1.3 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.1.2 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-fork-99 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.1.0 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.1.0.pre lib/fog/openstack/volume/models/transfers.rb
fog-openstack-apibank-1.0.102 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.11 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-apibank-1.0.101 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.10 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.9 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.8 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.7 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.6 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.5 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.4 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.3 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.2 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.1 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-1.0.0 lib/fog/openstack/volume/models/transfers.rb
fog-openstack-0.3.1 lib/fog/openstack/volume/models/transfers.rb