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

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

Direct Known Subclasses

V1::Transfer, V2::Transfer

Instance Attribute Summary

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from Model

#create, #update

Constructor Details

#initialize(attributes) ⇒ Transfer

Returns a new instance of Transfer.



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

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

Instance Method Details

#destroyObject



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

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

#saveObject



7
8
9
10
11
12
# File 'lib/fog/openstack/volume/models/transfer.rb', line 7

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