Class: OvirtSDK4::Device

Inherits:
Identified show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Direct Known Subclasses

Cdrom, Disk, Floppy, GlusterBrickAdvancedDetails, Nic, Watchdog

Instance Method Summary (collapse)

Methods included from Type

#href, #href=

Constructor Details

- (Device) initialize(opts = {})

Creates a new instance of the OvirtSDK4::Device class.

Parameters:

  • opts (Hash) (defaults to: {})

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :instance_type (InstanceType, Hash)

    The value of attribute instance_type.

  • :name (String)

    The value of attribute name.

  • :template (Template, Hash)

    The value of attribute template.

  • :vm (Vm, Hash)

    The value of attribute vm.

  • :vms (Array<Vm>, Array<Hash>)

    The values of attribute vms.



25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
# File 'lib/ovirtsdk4/types.rb', line 25728

def initialize(opts = {})
  super(opts)
  self.comment = opts[:comment]
  self.description = opts[:description]
  self.id = opts[:id]
  self.instance_type = opts[:instance_type]
  self.name = opts[:name]
  self.template = opts[:template]
  self.vm = opts[:vm]
  self.vms = opts[:vms]
end

Instance Method Details

- (String) comment

Returns the value of the comment attribute.

Returns:

  • (String)


25537
25538
25539
# File 'lib/ovirtsdk4/types.rb', line 25537

def comment
  return @comment
end

- (Object) comment=(value)

Sets the value of the comment attribute.

Parameters:

  • value (String)


25546
25547
25548
# File 'lib/ovirtsdk4/types.rb', line 25546

def comment=(value)
  @comment = value
end

- (String) description

Returns the value of the description attribute.

Returns:

  • (String)


25555
25556
25557
# File 'lib/ovirtsdk4/types.rb', line 25555

def description
  return @description
end

- (Object) description=(value)

Sets the value of the description attribute.

Parameters:

  • value (String)


25564
25565
25566
# File 'lib/ovirtsdk4/types.rb', line 25564

def description=(value)
  @description = value
end

- (String) id

Returns the value of the id attribute.

Returns:

  • (String)


25573
25574
25575
# File 'lib/ovirtsdk4/types.rb', line 25573

def id
  return @id
end

- (Object) id=(value)

Sets the value of the id attribute.

Parameters:

  • value (String)


25582
25583
25584
# File 'lib/ovirtsdk4/types.rb', line 25582

def id=(value)
  @id = value
end

- (InstanceType) instance_type

Returns the value of the instance_type attribute.

Returns:



25591
25592
25593
# File 'lib/ovirtsdk4/types.rb', line 25591

def instance_type
  return @instance_type
end

- (Object) instance_type=(value)

Sets the value of the instance_type attribute.

The value parameter can be an instance of InstanceType or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



25604
25605
25606
25607
25608
25609
# File 'lib/ovirtsdk4/types.rb', line 25604

def instance_type=(value)
  if value.is_a?(Hash)
    value = InstanceType.new(value)
  end
  @instance_type = value
end

- (String) name

Returns the value of the name attribute.

Returns:

  • (String)


25616
25617
25618
# File 'lib/ovirtsdk4/types.rb', line 25616

def name
  return @name
end

- (Object) name=(value)

Sets the value of the name attribute.

Parameters:

  • value (String)


25625
25626
25627
# File 'lib/ovirtsdk4/types.rb', line 25625

def name=(value)
  @name = value
end

- (Template) template

Returns the value of the template attribute.

Returns:



25634
25635
25636
# File 'lib/ovirtsdk4/types.rb', line 25634

def template
  return @template
end

- (Object) template=(value)

Sets the value of the template attribute.

The value parameter can be an instance of Template or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



25647
25648
25649
25650
25651
25652
# File 'lib/ovirtsdk4/types.rb', line 25647

def template=(value)
  if value.is_a?(Hash)
    value = Template.new(value)
  end
  @template = value
end

- (Vm) vm

Returns the value of the vm attribute.

Returns:



25659
25660
25661
# File 'lib/ovirtsdk4/types.rb', line 25659

def vm
  return @vm
end

- (Object) vm=(value)

Sets the value of the vm attribute.

The value parameter can be an instance of Vm or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Vm, Hash)


25672
25673
25674
25675
25676
25677
# File 'lib/ovirtsdk4/types.rb', line 25672

def vm=(value)
  if value.is_a?(Hash)
    value = Vm.new(value)
  end
  @vm = value
end

- (Array<Vm>) vms

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


25684
25685
25686
# File 'lib/ovirtsdk4/types.rb', line 25684

def vms
  return @vms
end

- (Object) vms=(list)

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
# File 'lib/ovirtsdk4/types.rb', line 25692

def vms=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Vm.new(value)
      end
    end
  end
  @vms = list
end