Class: VirtualMachine

Inherits:
Object
  • Object
show all
Defined in:
lib/rhev-manager/virtual-machine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vm) ⇒ VirtualMachine

Returns a new instance of VirtualMachine.



4
5
6
7
8
9
10
11
12
13
# File 'lib/rhev-manager/virtual-machine.rb', line 4

def initialize(vm)
  @id = vm['id']
  @name = vm['name']
  @description = vm['description']
  @address = vm['display']['address'] unless vm['display'].nil?
  @port = vm['display']['port'] unless vm['display'].nil?
  @secure_port = vm['display']['secure_port'] unless vm['display'].nil?
  @state = vm['status']['state'] unless vm['status'].nil?
  @host_uuid = vm['host']['id'] unless vm['host'].nil?
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



2
3
4
# File 'lib/rhev-manager/virtual-machine.rb', line 2

def address
  @address
end

#descriptionObject

Returns the value of attribute description.



2
3
4
# File 'lib/rhev-manager/virtual-machine.rb', line 2

def description
  @description
end

#host_uuidObject

Returns the value of attribute host_uuid.



2
3
4
# File 'lib/rhev-manager/virtual-machine.rb', line 2

def host_uuid
  @host_uuid
end

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/rhev-manager/virtual-machine.rb', line 2

def id
  @id
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/rhev-manager/virtual-machine.rb', line 2

def name
  @name
end

#portObject

Returns the value of attribute port.



2
3
4
# File 'lib/rhev-manager/virtual-machine.rb', line 2

def port
  @port
end

#secure_portObject

Returns the value of attribute secure_port.



2
3
4
# File 'lib/rhev-manager/virtual-machine.rb', line 2

def secure_port
  @secure_port
end

#stateObject

Returns the value of attribute state.



2
3
4
# File 'lib/rhev-manager/virtual-machine.rb', line 2

def state
  @state
end