Class: Fog::Compute::Joyent::Snapshot

Inherits:
Model
  • Object
show all
Defined in:
lib/rackspace-fog/joyent/models/compute/snapshot.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#destroyObject



28
29
30
31
32
33
34
# File 'lib/rackspace-fog/joyent/models/compute/snapshot.rb', line 28

def destroy
  requires :name
  requires :machine_id

  self.connection.delete_machine_snapshot(self.machine_id, self.name)
  true
end

#machineObject



36
37
38
39
40
# File 'lib/rackspace-fog/joyent/models/compute/snapshot.rb', line 36

def machine
  requires :machine_id

  self.connection.servers.get(self.machine_id)
end

#reloadObject



13
14
15
16
17
18
# File 'lib/rackspace-fog/joyent/models/compute/snapshot.rb', line 13

def reload
  requires :name
  requires :machine_id

  self.connection.snapshots.get(self.machine_id, self.name)
end

#startObject



20
21
22
23
24
25
26
# File 'lib/rackspace-fog/joyent/models/compute/snapshot.rb', line 20

def start
  requires :name
  requires :machine_id

  self.connection.start_machine_from_snapshot(self.machine_id, self.name)
  true
end