Class: Fog::Proxmox::Compute::Snapshots

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/compute/proxmox/models/snapshots.rb

Overview

class Snapshots Collection of snapshots

Instance Method Summary collapse

Instance Method Details

#allObject



36
37
38
39
# File 'lib/fog/compute/proxmox/models/snapshots.rb', line 36

def all
  path_params = { node: node_id, type: server_type, vmid: server_id }
  load service.list_snapshots(path_params)
end

#get(name) ⇒ Object



41
42
43
# File 'lib/fog/compute/proxmox/models/snapshots.rb', line 41

def get(name)
  all.find { |snapshot| snapshot.identity === name }
end

#new(new_attributes = {}) ⇒ Object



32
33
34
# File 'lib/fog/compute/proxmox/models/snapshots.rb', line 32

def new(new_attributes = {})
  super({ node_id: node_id, server_id: server_id, server_type: server_type }.merge(new_attributes))
end