Class: Fog::Volume::OpenStack::Transfer

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/openstack/models/volume/transfer.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#create, #update

Constructor Details

#initialize(attributes) ⇒ Transfer



27
28
29
30
31
# File 'lib/fog/openstack/models/volume/transfer.rb', line 27

def initialize(attributes)
  # Old 'connection' is renamed as service and should be used instead
  prepare_service_value(attributes)
  super
end

Instance Method Details

#destroyObject



21
22
23
24
25
# File 'lib/fog/openstack/models/volume/transfer.rb', line 21

def destroy
  requires :id
  service.delete_transfer(id)
  true
end

#saveObject



14
15
16
17
18
19
# File 'lib/fog/openstack/models/volume/transfer.rb', line 14

def save
  requires :name, :volume_id
  data = service.create_transfer(volume_id, :name => name)
  merge_attributes(data.body['transfer'])
  true
end