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.



32609
32610
32611
32612
32613
32614
32615
32616
32617
32618
32619
32620
# File 'lib/ovirtsdk4/types.rb', line 32609

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.



32625
32626
32627
32628
32629
32630
32631
32632
32633
32634
32635
32636
# File 'lib/ovirtsdk4/types.rb', line 32625

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)


32317
32318
32319
# File 'lib/ovirtsdk4/types.rb', line 32317

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


32326
32327
32328
# File 'lib/ovirtsdk4/types.rb', line 32326

def comment=(value)
  @comment = value
end

#creation_dateDateTime

Returns the value of the creation_date attribute.

Returns:

  • (DateTime)


32335
32336
32337
# File 'lib/ovirtsdk4/types.rb', line 32335

def creation_date
  @creation_date
end

#creation_date=(value) ⇒ Object

Sets the value of the creation_date attribute.

Parameters:

  • value (DateTime)


32344
32345
32346
# File 'lib/ovirtsdk4/types.rb', line 32344

def creation_date=(value)
  @creation_date = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


32353
32354
32355
# File 'lib/ovirtsdk4/types.rb', line 32353

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


32362
32363
32364
# File 'lib/ovirtsdk4/types.rb', line 32362

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:



32371
32372
32373
# File 'lib/ovirtsdk4/types.rb', line 32371

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)


32380
32381
32382
32383
32384
32385
32386
32387
32388
32389
32390
# File 'lib/ovirtsdk4/types.rb', line 32380

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)


32397
32398
32399
# File 'lib/ovirtsdk4/types.rb', line 32397

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)


32406
32407
32408
# File 'lib/ovirtsdk4/types.rb', line 32406

def from_checkpoint_id=(value)
  @from_checkpoint_id = value
end

#hashObject

Generates a hash value for this object.



32641
32642
32643
32644
32645
32646
32647
32648
32649
32650
32651
32652
# File 'lib/ovirtsdk4/types.rb', line 32641

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:



32415
32416
32417
# File 'lib/ovirtsdk4/types.rb', line 32415

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)


32428
32429
32430
32431
32432
32433
# File 'lib/ovirtsdk4/types.rb', line 32428

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)


32440
32441
32442
# File 'lib/ovirtsdk4/types.rb', line 32440

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


32449
32450
32451
# File 'lib/ovirtsdk4/types.rb', line 32449

def id=(value)
  @id = value
end

#modification_dateDateTime

Returns the value of the modification_date attribute.

Returns:

  • (DateTime)


32458
32459
32460
# File 'lib/ovirtsdk4/types.rb', line 32458

def modification_date
  @modification_date
end

#modification_date=(value) ⇒ Object

Sets the value of the modification_date attribute.

Parameters:

  • value (DateTime)


32467
32468
32469
# File 'lib/ovirtsdk4/types.rb', line 32467

def modification_date=(value)
  @modification_date = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


32476
32477
32478
# File 'lib/ovirtsdk4/types.rb', line 32476

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


32485
32486
32487
# File 'lib/ovirtsdk4/types.rb', line 32485

def name=(value)
  @name = value
end

#phaseBackupPhase

Returns the value of the phase attribute.

Returns:



32494
32495
32496
# File 'lib/ovirtsdk4/types.rb', line 32494

def phase
  @phase
end

#phase=(value) ⇒ Object

Sets the value of the phase attribute.

Parameters:



32503
32504
32505
# File 'lib/ovirtsdk4/types.rb', line 32503

def phase=(value)
  @phase = value
end

#snapshotSnapshot

Returns the value of the snapshot attribute.

Returns:



32512
32513
32514
# File 'lib/ovirtsdk4/types.rb', line 32512

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:



32525
32526
32527
32528
32529
32530
# File 'lib/ovirtsdk4/types.rb', line 32525

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)


32537
32538
32539
# File 'lib/ovirtsdk4/types.rb', line 32537

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)


32546
32547
32548
# File 'lib/ovirtsdk4/types.rb', line 32546

def to_checkpoint_id=(value)
  @to_checkpoint_id = value
end

#vmVm

Returns the value of the vm attribute.

Returns:



32555
32556
32557
# File 'lib/ovirtsdk4/types.rb', line 32555

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)


32568
32569
32570
32571
32572
32573
# File 'lib/ovirtsdk4/types.rb', line 32568

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