Class: OvirtSDK4::DiskAttachment

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

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ DiskAttachment

Creates a new instance of the OvirtSDK4::DiskAttachment 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):

  • :active (Boolean)

    The value of attribute active.

  • :bootable (Boolean)

    The value of attribute bootable.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :disk (Disk, Hash)

    The value of attribute disk.

  • :id (String)

    The value of attribute id.

  • :interface (DiskInterface)

    The value of attribute interface.

  • :logical_name (String)

    The value of attribute logical_name.

  • :name (String)

    The value of attribute name.

  • :pass_discard (Boolean)

    The value of attribute pass_discard.

  • :read_only (Boolean)

    The value of attribute read_only.

  • :template (Template, Hash)

    The value of attribute template.

  • :uses_scsi_reservation (Boolean)

    The value of attribute uses_scsi_reservation.

  • :vm (Vm, Hash)

    The value of attribute vm.



34807
34808
34809
34810
34811
34812
34813
34814
34815
34816
34817
34818
34819
# File 'lib/ovirtsdk4/types.rb', line 34807

def initialize(opts = {})
  super(opts)
  self.active = opts[:active]
  self.bootable = opts[:bootable]
  self.disk = opts[:disk]
  self.interface = opts[:interface]
  self.logical_name = opts[:logical_name]
  self.pass_discard = opts[:pass_discard]
  self.read_only = opts[:read_only]
  self.template = opts[:template]
  self.uses_scsi_reservation = opts[:uses_scsi_reservation]
  self.vm = opts[:vm]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.



34824
34825
34826
34827
34828
34829
34830
34831
34832
34833
34834
34835
34836
# File 'lib/ovirtsdk4/types.rb', line 34824

def ==(other)
  super &&
  @active == other.active &&
  @bootable == other.bootable &&
  @disk == other.disk &&
  @interface == other.interface &&
  @logical_name == other.logical_name &&
  @pass_discard == other.pass_discard &&
  @read_only == other.read_only &&
  @template == other.template &&
  @uses_scsi_reservation == other.uses_scsi_reservation &&
  @vm == other.vm
end

#activeBoolean

Returns the value of the active attribute.

Returns:

  • (Boolean)


34503
34504
34505
# File 'lib/ovirtsdk4/types.rb', line 34503

def active
  @active
end

#active=(value) ⇒ Object

Sets the value of the active attribute.

Parameters:

  • value (Boolean)


34512
34513
34514
# File 'lib/ovirtsdk4/types.rb', line 34512

def active=(value)
  @active = value
end

#bootableBoolean

Returns the value of the bootable attribute.

Returns:

  • (Boolean)


34521
34522
34523
# File 'lib/ovirtsdk4/types.rb', line 34521

def bootable
  @bootable
end

#bootable=(value) ⇒ Object

Sets the value of the bootable attribute.

Parameters:

  • value (Boolean)


34530
34531
34532
# File 'lib/ovirtsdk4/types.rb', line 34530

def bootable=(value)
  @bootable = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


34539
34540
34541
# File 'lib/ovirtsdk4/types.rb', line 34539

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


34548
34549
34550
# File 'lib/ovirtsdk4/types.rb', line 34548

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


34557
34558
34559
# File 'lib/ovirtsdk4/types.rb', line 34557

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


34566
34567
34568
# File 'lib/ovirtsdk4/types.rb', line 34566

def description=(value)
  @description = value
end

#diskDisk

Returns the value of the disk attribute.

Returns:



34575
34576
34577
# File 'lib/ovirtsdk4/types.rb', line 34575

def disk
  @disk
end

#disk=(value) ⇒ Object

Sets the value of the disk attribute.

The value parameter can be an instance of OvirtSDK4::Disk 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 (Disk, Hash)


34588
34589
34590
34591
34592
34593
# File 'lib/ovirtsdk4/types.rb', line 34588

def disk=(value)
  if value.is_a?(Hash)
    value = Disk.new(value)
  end
  @disk = value
end

#hashObject

Generates a hash value for this object.



34841
34842
34843
34844
34845
34846
34847
34848
34849
34850
34851
34852
34853
# File 'lib/ovirtsdk4/types.rb', line 34841

def hash
  super +
  @active.hash +
  @bootable.hash +
  @disk.hash +
  @interface.hash +
  @logical_name.hash +
  @pass_discard.hash +
  @read_only.hash +
  @template.hash +
  @uses_scsi_reservation.hash +
  @vm.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


34600
34601
34602
# File 'lib/ovirtsdk4/types.rb', line 34600

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


34609
34610
34611
# File 'lib/ovirtsdk4/types.rb', line 34609

def id=(value)
  @id = value
end

#interfaceDiskInterface

Returns the value of the interface attribute.

Returns:



34618
34619
34620
# File 'lib/ovirtsdk4/types.rb', line 34618

def interface
  @interface
end

#interface=(value) ⇒ Object

Sets the value of the interface attribute.

Parameters:



34627
34628
34629
# File 'lib/ovirtsdk4/types.rb', line 34627

def interface=(value)
  @interface = value
end

#logical_nameString

Returns the value of the logical_name attribute.

Returns:

  • (String)


34636
34637
34638
# File 'lib/ovirtsdk4/types.rb', line 34636

def logical_name
  @logical_name
end

#logical_name=(value) ⇒ Object

Sets the value of the logical_name attribute.

Parameters:

  • value (String)


34645
34646
34647
# File 'lib/ovirtsdk4/types.rb', line 34645

def logical_name=(value)
  @logical_name = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


34654
34655
34656
# File 'lib/ovirtsdk4/types.rb', line 34654

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


34663
34664
34665
# File 'lib/ovirtsdk4/types.rb', line 34663

def name=(value)
  @name = value
end

#pass_discardBoolean

Returns the value of the pass_discard attribute.

Returns:

  • (Boolean)


34672
34673
34674
# File 'lib/ovirtsdk4/types.rb', line 34672

def pass_discard
  @pass_discard
end

#pass_discard=(value) ⇒ Object

Sets the value of the pass_discard attribute.

Parameters:

  • value (Boolean)


34681
34682
34683
# File 'lib/ovirtsdk4/types.rb', line 34681

def pass_discard=(value)
  @pass_discard = value
end

#read_onlyBoolean

Returns the value of the read_only attribute.

Returns:

  • (Boolean)


34690
34691
34692
# File 'lib/ovirtsdk4/types.rb', line 34690

def read_only
  @read_only
end

#read_only=(value) ⇒ Object

Sets the value of the read_only attribute.

Parameters:

  • value (Boolean)


34699
34700
34701
# File 'lib/ovirtsdk4/types.rb', line 34699

def read_only=(value)
  @read_only = value
end

#templateTemplate

Returns the value of the template attribute.

Returns:



34708
34709
34710
# File 'lib/ovirtsdk4/types.rb', line 34708

def template
  @template
end

#template=(value) ⇒ Object

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:



34721
34722
34723
34724
34725
34726
# File 'lib/ovirtsdk4/types.rb', line 34721

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

#uses_scsi_reservationBoolean

Returns the value of the uses_scsi_reservation attribute.

Returns:

  • (Boolean)


34733
34734
34735
# File 'lib/ovirtsdk4/types.rb', line 34733

def uses_scsi_reservation
  @uses_scsi_reservation
end

#uses_scsi_reservation=(value) ⇒ Object

Sets the value of the uses_scsi_reservation attribute.

Parameters:

  • value (Boolean)


34742
34743
34744
# File 'lib/ovirtsdk4/types.rb', line 34742

def uses_scsi_reservation=(value)
  @uses_scsi_reservation = value
end

#vmVm

Returns the value of the vm attribute.

Returns:



34751
34752
34753
# File 'lib/ovirtsdk4/types.rb', line 34751

def vm
  @vm
end

#vm=(value) ⇒ Object

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)


34764
34765
34766
34767
34768
34769
# File 'lib/ovirtsdk4/types.rb', line 34764

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