Sha256: bd17a46589e1945103a3e1ec79b5d0de801815f9adf81a5070d0fc92bf6194ca

Contents?: true

Size: 993 Bytes

Versions: 39

Compression:

Stored size: 993 Bytes

Contents

require 'fog/openstack/models/collection'

module Fog
  module Volume
    class OpenStack
      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::Volume::OpenStack::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

39 entries across 37 versions & 3 rubygems

Version Path
fog-openstack-0.1.31 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.10 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.1.30 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.1.29 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.9 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.1.28 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.8 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.7 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.6 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.5 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.4 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.3 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.2 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.3.0 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.2.4 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.2.3 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.2.2 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.2.1 lib/fog/volume/openstack/models/transfers.rb
fog-openstack-0.2.0 lib/fog/volume/openstack/models/transfers.rb
fog-zj-0.1.28 lib/fog/volume/openstack/models/transfers.rb