Files

Class/Module Index [+]

Quicksearch

Fog::Compute::Vsphere::Server

Public Instance Methods

clone(options = {}) click to toggle source
# File lib/fog/vsphere/models/compute/server.rb, line 60
def clone(options = {})
  requires :name, :path
  # Convert symbols to strings
  req_options = options.inject({}) { |hsh, (k,v)| hsh[k.to_s] = v; hsh }
  # Give our path to the request
  req_options['path'] ="#{path}/#{name}"
  # Perform the actual clone
  clone_results = connection.vm_clone(req_options)
  # Create the new VM model.
  new_vm = self.class.new(clone_results['vm_attributes'])
  # We need to assign the collection and the connection otherwise we
  # cannot reload the model.
  new_vm.collection = self.collection
  new_vm.connection = self.connection
  # Return the new VM model.
  new_vm
end
destroy(options = {}) click to toggle source
# File lib/fog/vsphere/models/compute/server.rb, line 55
def destroy(options = {})
  requires :instance_uuid
  connection.vm_destroy('instance_uuid' => instance_uuid)
end
reboot(options = {}) click to toggle source
# File lib/fog/vsphere/models/compute/server.rb, line 49
def reboot(options = {})
  options = { :force => false }.merge(options)
  requires :instance_uuid
  connection.vm_reboot('instance_uuid' => instance_uuid, 'force' => options[:force])
end
start(options = {}) click to toggle source
# File lib/fog/vsphere/models/compute/server.rb, line 38
def start(options = {})
  requires :instance_uuid
  connection.vm_power_on('instance_uuid' => instance_uuid)
end
stop(options = {}) click to toggle source
# File lib/fog/vsphere/models/compute/server.rb, line 43
def stop(options = {})
  options = { :force => false }.merge(options)
  requires :instance_uuid
  connection.vm_power_off('instance_uuid' => instance_uuid, 'force' => options[:force])
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.