Class: Fog::Volume::OpenStack::Volume
- Defined in:
- lib/fog/openstack/models/volume/volume.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ Volume
constructor
A new instance of Volume.
- #save ⇒ Object
Methods inherited from Model
#inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
#initialize(attributes) ⇒ Volume
Returns a new instance of Volume.
24 25 26 27 28 |
# File 'lib/fog/openstack/models/volume/volume.rb', line 24 def initialize(attributes) # Old 'connection' is renamed as service and should be used instead prepare_service_value(attributes) super end |
Instance Method Details
#destroy ⇒ Object
37 38 39 40 41 |
# File 'lib/fog/openstack/models/volume/volume.rb', line 37 def destroy requires :id service.delete_volume(id) true end |
#save ⇒ Object
30 31 32 33 34 35 |
# File 'lib/fog/openstack/models/volume/volume.rb', line 30 def save requires :display_name, :size data = service.create_volume(display_name, display_description, size, attributes) merge_attributes(data.body['volume']) true end |