Class: OvirtSDK4::Backup

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 = {}) ⇒ Backup

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

  • :creation_date (DateTime)

    The value of attribute creation_date.

  • :description (String)

    The value of attribute description.

  • :disks (Array<Disk>, Array<Hash>)

    The values of attribute disks.

  • :from_checkpoint_id (String)

    The value of attribute from_checkpoint_id.

  • :host (Host, Hash)

    The value of attribute host.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :phase (BackupPhase)

    The value of attribute phase.

  • :to_checkpoint_id (String)

    The value of attribute to_checkpoint_id.

  • :vm (Vm, Hash)

    The value of attribute vm.



31852
31853
31854
31855
31856
31857
31858
31859
31860
31861
# File 'lib/ovirtsdk4/types.rb', line 31852

def initialize(opts = {})
  super(opts)
  self.creation_date = opts[:creation_date]
  self.disks = opts[:disks]
  self.from_checkpoint_id = opts[:from_checkpoint_id]
  self.host = opts[:host]
  self.phase = opts[:phase]
  self.to_checkpoint_id = opts[:to_checkpoint_id]
  self.vm = opts[:vm]
end

Instance Method Details

#==(other) ⇒ Object

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



31866
31867
31868
31869
31870
31871
31872
31873
31874
31875
# File 'lib/ovirtsdk4/types.rb', line 31866

def ==(other)
  super &&
  @creation_date == other.creation_date &&
  @disks == other.disks &&
  @from_checkpoint_id == other.from_checkpoint_id &&
  @host == other.host &&
  @phase == other.phase &&
  @to_checkpoint_id == other.to_checkpoint_id &&
  @vm == other.vm
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


31607
31608
31609
# File 'lib/ovirtsdk4/types.rb', line 31607

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


31616
31617
31618
# File 'lib/ovirtsdk4/types.rb', line 31616

def comment=(value)
  @comment = value
end

#creation_dateDateTime

Returns the value of the creation_date attribute.

Returns:

  • (DateTime)


31625
31626
31627
# File 'lib/ovirtsdk4/types.rb', line 31625

def creation_date
  @creation_date
end

#creation_date=(value) ⇒ Object

Sets the value of the creation_date attribute.

Parameters:

  • value (DateTime)


31634
31635
31636
# File 'lib/ovirtsdk4/types.rb', line 31634

def creation_date=(value)
  @creation_date = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


31643
31644
31645
# File 'lib/ovirtsdk4/types.rb', line 31643

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


31652
31653
31654
# File 'lib/ovirtsdk4/types.rb', line 31652

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:



31661
31662
31663
# File 'lib/ovirtsdk4/types.rb', line 31661

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)


31670
31671
31672
31673
31674
31675
31676
31677
31678
31679
31680
# File 'lib/ovirtsdk4/types.rb', line 31670

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

#from_checkpoint_idString

Returns the value of the from_checkpoint_id attribute.

Returns:

  • (String)


31687
31688
31689
# File 'lib/ovirtsdk4/types.rb', line 31687

def from_checkpoint_id
  @from_checkpoint_id
end

#from_checkpoint_id=(value) ⇒ Object

Sets the value of the from_checkpoint_id attribute.

Parameters:

  • value (String)


31696
31697
31698
# File 'lib/ovirtsdk4/types.rb', line 31696

def from_checkpoint_id=(value)
  @from_checkpoint_id = value
end

#hashObject

Generates a hash value for this object.



31880
31881
31882
31883
31884
31885
31886
31887
31888
31889
# File 'lib/ovirtsdk4/types.rb', line 31880

def hash
  super +
  @creation_date.hash +
  @disks.hash +
  @from_checkpoint_id.hash +
  @host.hash +
  @phase.hash +
  @to_checkpoint_id.hash +
  @vm.hash
end

#hostHost

Returns the value of the host attribute.

Returns:



31705
31706
31707
# File 'lib/ovirtsdk4/types.rb', line 31705

def host
  @host
end

#host=(value) ⇒ Object

Sets the value of the host attribute.

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


31718
31719
31720
31721
31722
31723
# File 'lib/ovirtsdk4/types.rb', line 31718

def host=(value)
  if value.is_a?(Hash)
    value = Host.new(value)
  end
  @host = value
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


31730
31731
31732
# File 'lib/ovirtsdk4/types.rb', line 31730

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


31739
31740
31741
# File 'lib/ovirtsdk4/types.rb', line 31739

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


31748
31749
31750
# File 'lib/ovirtsdk4/types.rb', line 31748

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


31757
31758
31759
# File 'lib/ovirtsdk4/types.rb', line 31757

def name=(value)
  @name = value
end

#phaseBackupPhase

Returns the value of the phase attribute.

Returns:



31766
31767
31768
# File 'lib/ovirtsdk4/types.rb', line 31766

def phase
  @phase
end

#phase=(value) ⇒ Object

Sets the value of the phase attribute.

Parameters:



31775
31776
31777
# File 'lib/ovirtsdk4/types.rb', line 31775

def phase=(value)
  @phase = value
end

#to_checkpoint_idString

Returns the value of the to_checkpoint_id attribute.

Returns:

  • (String)


31784
31785
31786
# File 'lib/ovirtsdk4/types.rb', line 31784

def to_checkpoint_id
  @to_checkpoint_id
end

#to_checkpoint_id=(value) ⇒ Object

Sets the value of the to_checkpoint_id attribute.

Parameters:

  • value (String)


31793
31794
31795
# File 'lib/ovirtsdk4/types.rb', line 31793

def to_checkpoint_id=(value)
  @to_checkpoint_id = value
end

#vmVm

Returns the value of the vm attribute.

Returns:



31802
31803
31804
# File 'lib/ovirtsdk4/types.rb', line 31802

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)


31815
31816
31817
31818
31819
31820
# File 'lib/ovirtsdk4/types.rb', line 31815

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