class Fog::Compute::Proxmox::Snapshots
class Snapshots Collection of snapshots
Public Instance Methods
all()
click to toggle source
# File lib/fog/compute/proxmox/models/snapshots.rb, line 35 def all requires :server path_params = { node: server.node, type: server.type, vmid: server.vmid } load_response(service.list_snapshots(path_params), 'snapshots') end
get(name)
click to toggle source
# File lib/fog/compute/proxmox/models/snapshots.rb, line 41 def get(name) requires :server cached_snapshot = find { |snapshot| snapshot.name == name } return cached_snapshot if cached_snapshot path_params = { node: server.node, type: server.type, vmid: server.vmid, snapname: name } snapshot_hash = service.get_snapshot(path_params) Fog::Compute::Proxmox::Snapshot.new( snapshot_hash.merge(service: service, server: server, name: name) ) end
new(attributes = {})
click to toggle source
Calls superclass method
# File lib/fog/compute/proxmox/models/snapshots.rb, line 30 def new(attributes = {}) requires :server super({ server: server }.merge!(attributes)) end