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.

  • :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.



30952
30953
30954
30955
30956
30957
30958
30959
30960
# File 'lib/ovirtsdk4/types.rb', line 30952

def initialize(opts = {})
  super(opts)
  self.creation_date = opts[:creation_date]
  self.disks = opts[:disks]
  self.from_checkpoint_id = opts[:from_checkpoint_id]
  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.



30965
30966
30967
30968
30969
30970
30971
30972
30973
# File 'lib/ovirtsdk4/types.rb', line 30965

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


30734
30735
30736
# File 'lib/ovirtsdk4/types.rb', line 30734

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


30743
30744
30745
# File 'lib/ovirtsdk4/types.rb', line 30743

def comment=(value)
  @comment = value
end

#creation_dateDateTime

Returns the value of the creation_date attribute.

Returns:

  • (DateTime)


30752
30753
30754
# File 'lib/ovirtsdk4/types.rb', line 30752

def creation_date
  @creation_date
end

#creation_date=(value) ⇒ Object

Sets the value of the creation_date attribute.

Parameters:

  • value (DateTime)


30761
30762
30763
# File 'lib/ovirtsdk4/types.rb', line 30761

def creation_date=(value)
  @creation_date = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


30770
30771
30772
# File 'lib/ovirtsdk4/types.rb', line 30770

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


30779
30780
30781
# File 'lib/ovirtsdk4/types.rb', line 30779

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:



30788
30789
30790
# File 'lib/ovirtsdk4/types.rb', line 30788

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)


30797
30798
30799
30800
30801
30802
30803
30804
30805
30806
30807
# File 'lib/ovirtsdk4/types.rb', line 30797

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)


30814
30815
30816
# File 'lib/ovirtsdk4/types.rb', line 30814

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)


30823
30824
30825
# File 'lib/ovirtsdk4/types.rb', line 30823

def from_checkpoint_id=(value)
  @from_checkpoint_id = value
end

#hashObject

Generates a hash value for this object.



30978
30979
30980
30981
30982
30983
30984
30985
30986
# File 'lib/ovirtsdk4/types.rb', line 30978

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


30832
30833
30834
# File 'lib/ovirtsdk4/types.rb', line 30832

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


30841
30842
30843
# File 'lib/ovirtsdk4/types.rb', line 30841

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


30850
30851
30852
# File 'lib/ovirtsdk4/types.rb', line 30850

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


30859
30860
30861
# File 'lib/ovirtsdk4/types.rb', line 30859

def name=(value)
  @name = value
end

#phaseBackupPhase

Returns the value of the phase attribute.

Returns:



30868
30869
30870
# File 'lib/ovirtsdk4/types.rb', line 30868

def phase
  @phase
end

#phase=(value) ⇒ Object

Sets the value of the phase attribute.

Parameters:



30877
30878
30879
# File 'lib/ovirtsdk4/types.rb', line 30877

def phase=(value)
  @phase = value
end

#to_checkpoint_idString

Returns the value of the to_checkpoint_id attribute.

Returns:

  • (String)


30886
30887
30888
# File 'lib/ovirtsdk4/types.rb', line 30886

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)


30895
30896
30897
# File 'lib/ovirtsdk4/types.rb', line 30895

def to_checkpoint_id=(value)
  @to_checkpoint_id = value
end

#vmVm

Returns the value of the vm attribute.

Returns:



30904
30905
30906
# File 'lib/ovirtsdk4/types.rb', line 30904

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)


30917
30918
30919
30920
30921
30922
# File 'lib/ovirtsdk4/types.rb', line 30917

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