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.

  • :modification_date (DateTime)

    The value of attribute modification_date.

  • :name (String)

    The value of attribute name.

  • :phase (BackupPhase)

    The value of attribute phase.

  • :snapshot (Snapshot, Hash)

    The value of attribute snapshot.

  • :to_checkpoint_id (String)

    The value of attribute to_checkpoint_id.

  • :vm (Vm, Hash)

    The value of attribute vm.



32902
32903
32904
32905
32906
32907
32908
32909
32910
32911
32912
32913
# File 'lib/ovirtsdk4/types.rb', line 32902

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.modification_date = opts[:modification_date]
  self.phase = opts[:phase]
  self.snapshot = opts[:snapshot]
  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.



32918
32919
32920
32921
32922
32923
32924
32925
32926
32927
32928
32929
# File 'lib/ovirtsdk4/types.rb', line 32918

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


32610
32611
32612
# File 'lib/ovirtsdk4/types.rb', line 32610

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


32619
32620
32621
# File 'lib/ovirtsdk4/types.rb', line 32619

def comment=(value)
  @comment = value
end

#creation_dateDateTime

Returns the value of the creation_date attribute.

Returns:

  • (DateTime)


32628
32629
32630
# File 'lib/ovirtsdk4/types.rb', line 32628

def creation_date
  @creation_date
end

#creation_date=(value) ⇒ Object

Sets the value of the creation_date attribute.

Parameters:

  • value (DateTime)


32637
32638
32639
# File 'lib/ovirtsdk4/types.rb', line 32637

def creation_date=(value)
  @creation_date = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


32646
32647
32648
# File 'lib/ovirtsdk4/types.rb', line 32646

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


32655
32656
32657
# File 'lib/ovirtsdk4/types.rb', line 32655

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:



32664
32665
32666
# File 'lib/ovirtsdk4/types.rb', line 32664

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)


32673
32674
32675
32676
32677
32678
32679
32680
32681
32682
32683
# File 'lib/ovirtsdk4/types.rb', line 32673

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)


32690
32691
32692
# File 'lib/ovirtsdk4/types.rb', line 32690

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)


32699
32700
32701
# File 'lib/ovirtsdk4/types.rb', line 32699

def from_checkpoint_id=(value)
  @from_checkpoint_id = value
end

#hashObject

Generates a hash value for this object.



32934
32935
32936
32937
32938
32939
32940
32941
32942
32943
32944
32945
# File 'lib/ovirtsdk4/types.rb', line 32934

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

#hostHost

Returns the value of the host attribute.

Returns:



32708
32709
32710
# File 'lib/ovirtsdk4/types.rb', line 32708

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)


32721
32722
32723
32724
32725
32726
# File 'lib/ovirtsdk4/types.rb', line 32721

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)


32733
32734
32735
# File 'lib/ovirtsdk4/types.rb', line 32733

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


32742
32743
32744
# File 'lib/ovirtsdk4/types.rb', line 32742

def id=(value)
  @id = value
end

#modification_dateDateTime

Returns the value of the modification_date attribute.

Returns:

  • (DateTime)


32751
32752
32753
# File 'lib/ovirtsdk4/types.rb', line 32751

def modification_date
  @modification_date
end

#modification_date=(value) ⇒ Object

Sets the value of the modification_date attribute.

Parameters:

  • value (DateTime)


32760
32761
32762
# File 'lib/ovirtsdk4/types.rb', line 32760

def modification_date=(value)
  @modification_date = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


32769
32770
32771
# File 'lib/ovirtsdk4/types.rb', line 32769

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


32778
32779
32780
# File 'lib/ovirtsdk4/types.rb', line 32778

def name=(value)
  @name = value
end

#phaseBackupPhase

Returns the value of the phase attribute.

Returns:



32787
32788
32789
# File 'lib/ovirtsdk4/types.rb', line 32787

def phase
  @phase
end

#phase=(value) ⇒ Object

Sets the value of the phase attribute.

Parameters:



32796
32797
32798
# File 'lib/ovirtsdk4/types.rb', line 32796

def phase=(value)
  @phase = value
end

#snapshotSnapshot

Returns the value of the snapshot attribute.

Returns:



32805
32806
32807
# File 'lib/ovirtsdk4/types.rb', line 32805

def snapshot
  @snapshot
end

#snapshot=(value) ⇒ Object

Sets the value of the snapshot attribute.

The value parameter can be an instance of Snapshot 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:



32818
32819
32820
32821
32822
32823
# File 'lib/ovirtsdk4/types.rb', line 32818

def snapshot=(value)
  if value.is_a?(Hash)
    value = Snapshot.new(value)
  end
  @snapshot = value
end

#to_checkpoint_idString

Returns the value of the to_checkpoint_id attribute.

Returns:

  • (String)


32830
32831
32832
# File 'lib/ovirtsdk4/types.rb', line 32830

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)


32839
32840
32841
# File 'lib/ovirtsdk4/types.rb', line 32839

def to_checkpoint_id=(value)
  @to_checkpoint_id = value
end

#vmVm

Returns the value of the vm attribute.

Returns:



32848
32849
32850
# File 'lib/ovirtsdk4/types.rb', line 32848

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)


32861
32862
32863
32864
32865
32866
# File 'lib/ovirtsdk4/types.rb', line 32861

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