Class: Fog::Proxmox::Compute::Volume
- Inherits:
-
Model
- Object
- Model
- Fog::Proxmox::Compute::Volume
- Defined in:
- lib/fog/compute/proxmox/models/volume.rb
Overview
class Volume model
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(new_attributes = {}) ⇒ Volume
constructor
A new instance of Volume.
- #restore(vmid, options = {}) ⇒ Object
Constructor Details
#initialize(new_attributes = {}) ⇒ Volume
Returns a new instance of Volume.
42 43 44 45 46 47 48 49 |
# File 'lib/fog/compute/proxmox/models/volume.rb', line 42 def initialize(new_attributes = {}) prepare_service_value(new_attributes) Fog::Proxmox::Attributes.set_attr_and_sym('node_id', attributes, new_attributes) Fog::Proxmox::Attributes.set_attr_and_sym('storage_id', attributes, new_attributes) Fog::Proxmox::Attributes.set_attr_and_sym('volid', attributes, new_attributes) requires :node_id, :storage_id, :volid super(new_attributes) end |
Instance Method Details
#destroy ⇒ Object
51 52 53 |
# File 'lib/fog/compute/proxmox/models/volume.rb', line 51 def destroy service.delete_volume(node_id, storage_id, volid) end |
#restore(vmid, options = {}) ⇒ Object
55 56 57 |
# File 'lib/fog/compute/proxmox/models/volume.rb', line 55 def restore(vmid, = {}) service.create_server(node_id, .merge(archive: volid, storage: storage_id, vmid: vmid)) end |