Class: Fog::Compute::Proxmox::Volume

Inherits:
Proxmox::Model show all
Defined in:
lib/fog/compute/proxmox/models/volume.rb

Overview

class Volume model

Instance Method Summary collapse

Methods inherited from Proxmox::Model

#create, #initialize, #inspect, #to_s, #update

Constructor Details

This class inherits a constructor from Fog::Proxmox::Model

Instance Method Details

#destroyObject


49
50
51
52
# File 'lib/fog/compute/proxmox/models/volume.rb', line 49

def destroy
  requires :node, :volid, :storage
  service.delete_volume(node, storage, volid)
end

#new(attributes = {}) ⇒ Object


44
45
46
47
# File 'lib/fog/compute/proxmox/models/volume.rb', line 44

def new(attributes = {})
  requires :node, :storage
  super({ node: node, storage: storage }.merge(attributes))
end

#restore(vmid, options = {}) ⇒ Object


54
55
56
57
# File 'lib/fog/compute/proxmox/models/volume.rb', line 54

def restore(vmid, options = {})
  requires :node, :volid, :storage
  service.create_server(node, options.merge(archive: volid, storage: storage, vmid: vmid))
end