Sha256: d47ca965018c163eb955cd530d2527ce132c287f5450ed9f7d96675d9080bd2b

Contents?: true

Size: 994 Bytes

Versions: 12

Compression:

Stored size: 994 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

12 entries across 12 versions & 2 rubygems

Version Path
fog-openstack-0.1.10 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.9 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.8 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.7 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.6 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.5 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.4 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.3 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.2 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.1 lib/fog/openstack/models/volume/transfers.rb
fog-openstack-0.1.0 lib/fog/openstack/models/volume/transfers.rb
fog-1.37.0 lib/fog/openstack/models/volume/transfers.rb