Class: OvirtSDK4::GlusterBrick

Inherits:
GlusterBrickAdvancedDetails 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 = {}) ⇒ GlusterBrick

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

  • :brick_dir (String)

    The value of attribute brick_dir.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :device (String)

    The value of attribute device.

  • :fs_name (String)

    The value of attribute fs_name.

  • :gluster_clients (Array<GlusterClient>, Array<Hash>)

    The values of attribute gluster_clients.

  • :gluster_volume (GlusterVolume, Hash)

    The value of attribute gluster_volume.

  • :id (String)

    The value of attribute id.

  • :instance_type (InstanceType, Hash)

    The value of attribute instance_type.

  • :memory_pools (Array<GlusterMemoryPool>, Array<Hash>)

    The values of attribute memory_pools.

  • :mnt_options (String)

    The value of attribute mnt_options.

  • :name (String)

    The value of attribute name.

  • :pid (Integer)

    The value of attribute pid.

  • :port (Integer)

    The value of attribute port.

  • :server_id (String)

    The value of attribute server_id.

  • :statistics (Array<Statistic>, Array<Hash>)

    The values of attribute statistics.

  • :status (GlusterBrickStatus)

    The value of attribute status.

  • :template (Template, Hash)

    The value of attribute template.

  • :vm (Vm, Hash)

    The value of attribute vm.

  • :vms (Array<Vm>, Array<Hash>)

    The values of attribute vms.



50587
50588
50589
50590
50591
50592
50593
50594
# File 'lib/ovirtsdk4/types.rb', line 50587

def initialize(opts = {})
  super(opts)
  self.brick_dir = opts[:brick_dir]
  self.gluster_volume = opts[:gluster_volume]
  self.server_id = opts[:server_id]
  self.statistics = opts[:statistics]
  self.status = opts[:status]
end

Instance Method Details

#==(other) ⇒ Object

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



50599
50600
50601
50602
50603
50604
50605
50606
# File 'lib/ovirtsdk4/types.rb', line 50599

def ==(other)
  super &&
  @brick_dir == other.brick_dir &&
  @gluster_volume == other.gluster_volume &&
  @server_id == other.server_id &&
  @statistics == other.statistics &&
  @status == other.status
end

#brick_dirString

Returns the value of the brick_dir attribute.

Returns:

  • (String)


50124
50125
50126
# File 'lib/ovirtsdk4/types.rb', line 50124

def brick_dir
  @brick_dir
end

#brick_dir=(value) ⇒ Object

Sets the value of the brick_dir attribute.

Parameters:

  • value (String)


50133
50134
50135
# File 'lib/ovirtsdk4/types.rb', line 50133

def brick_dir=(value)
  @brick_dir = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


50142
50143
50144
# File 'lib/ovirtsdk4/types.rb', line 50142

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


50151
50152
50153
# File 'lib/ovirtsdk4/types.rb', line 50151

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


50160
50161
50162
# File 'lib/ovirtsdk4/types.rb', line 50160

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


50169
50170
50171
# File 'lib/ovirtsdk4/types.rb', line 50169

def description=(value)
  @description = value
end

#deviceString

Returns the value of the device attribute.

Returns:

  • (String)


50178
50179
50180
# File 'lib/ovirtsdk4/types.rb', line 50178

def device
  @device
end

#device=(value) ⇒ Object

Sets the value of the device attribute.

Parameters:

  • value (String)


50187
50188
50189
# File 'lib/ovirtsdk4/types.rb', line 50187

def device=(value)
  @device = value
end

#fs_nameString

Returns the value of the fs_name attribute.

Returns:

  • (String)


50196
50197
50198
# File 'lib/ovirtsdk4/types.rb', line 50196

def fs_name
  @fs_name
end

#fs_name=(value) ⇒ Object

Sets the value of the fs_name attribute.

Parameters:

  • value (String)


50205
50206
50207
# File 'lib/ovirtsdk4/types.rb', line 50205

def fs_name=(value)
  @fs_name = value
end

#gluster_clientsArray<GlusterClient>

Returns the value of the gluster_clients attribute.

Returns:



50214
50215
50216
# File 'lib/ovirtsdk4/types.rb', line 50214

def gluster_clients
  @gluster_clients
end

#gluster_clients=(list) ⇒ Object

Sets the value of the gluster_clients attribute.

Parameters:



50223
50224
50225
50226
50227
50228
50229
50230
50231
50232
50233
# File 'lib/ovirtsdk4/types.rb', line 50223

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

#gluster_volumeGlusterVolume

Returns the value of the gluster_volume attribute.

Returns:



50240
50241
50242
# File 'lib/ovirtsdk4/types.rb', line 50240

def gluster_volume
  @gluster_volume
end

#gluster_volume=(value) ⇒ Object

Sets the value of the gluster_volume attribute.

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



50253
50254
50255
50256
50257
50258
# File 'lib/ovirtsdk4/types.rb', line 50253

def gluster_volume=(value)
  if value.is_a?(Hash)
    value = GlusterVolume.new(value)
  end
  @gluster_volume = value
end

#hashObject

Generates a hash value for this object.



50611
50612
50613
50614
50615
50616
50617
50618
# File 'lib/ovirtsdk4/types.rb', line 50611

def hash
  super +
  @brick_dir.hash +
  @gluster_volume.hash +
  @server_id.hash +
  @statistics.hash +
  @status.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


50265
50266
50267
# File 'lib/ovirtsdk4/types.rb', line 50265

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


50274
50275
50276
# File 'lib/ovirtsdk4/types.rb', line 50274

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:



50283
50284
50285
# File 'lib/ovirtsdk4/types.rb', line 50283

def instance_type
  @instance_type
end

#instance_type=(value) ⇒ Object

Sets the value of the instance_type attribute.

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



50296
50297
50298
50299
50300
50301
# File 'lib/ovirtsdk4/types.rb', line 50296

def instance_type=(value)
  if value.is_a?(Hash)
    value = InstanceType.new(value)
  end
  @instance_type = value
end

#memory_poolsArray<GlusterMemoryPool>

Returns the value of the memory_pools attribute.

Returns:



50308
50309
50310
# File 'lib/ovirtsdk4/types.rb', line 50308

def memory_pools
  @memory_pools
end

#memory_pools=(list) ⇒ Object

Sets the value of the memory_pools attribute.

Parameters:



50317
50318
50319
50320
50321
50322
50323
50324
50325
50326
50327
# File 'lib/ovirtsdk4/types.rb', line 50317

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

#mnt_optionsString

Returns the value of the mnt_options attribute.

Returns:

  • (String)


50334
50335
50336
# File 'lib/ovirtsdk4/types.rb', line 50334

def mnt_options
  @mnt_options
end

#mnt_options=(value) ⇒ Object

Sets the value of the mnt_options attribute.

Parameters:

  • value (String)


50343
50344
50345
# File 'lib/ovirtsdk4/types.rb', line 50343

def mnt_options=(value)
  @mnt_options = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


50352
50353
50354
# File 'lib/ovirtsdk4/types.rb', line 50352

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


50361
50362
50363
# File 'lib/ovirtsdk4/types.rb', line 50361

def name=(value)
  @name = value
end

#pidInteger

Returns the value of the pid attribute.

Returns:

  • (Integer)


50370
50371
50372
# File 'lib/ovirtsdk4/types.rb', line 50370

def pid
  @pid
end

#pid=(value) ⇒ Object

Sets the value of the pid attribute.

Parameters:

  • value (Integer)


50379
50380
50381
# File 'lib/ovirtsdk4/types.rb', line 50379

def pid=(value)
  @pid = value
end

#portInteger

Returns the value of the port attribute.

Returns:

  • (Integer)


50388
50389
50390
# File 'lib/ovirtsdk4/types.rb', line 50388

def port
  @port
end

#port=(value) ⇒ Object

Sets the value of the port attribute.

Parameters:

  • value (Integer)


50397
50398
50399
# File 'lib/ovirtsdk4/types.rb', line 50397

def port=(value)
  @port = value
end

#server_idString

Returns the value of the server_id attribute.

Returns:

  • (String)


50406
50407
50408
# File 'lib/ovirtsdk4/types.rb', line 50406

def server_id
  @server_id
end

#server_id=(value) ⇒ Object

Sets the value of the server_id attribute.

Parameters:

  • value (String)


50415
50416
50417
# File 'lib/ovirtsdk4/types.rb', line 50415

def server_id=(value)
  @server_id = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



50424
50425
50426
# File 'lib/ovirtsdk4/types.rb', line 50424

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



50433
50434
50435
50436
50437
50438
50439
50440
50441
50442
50443
# File 'lib/ovirtsdk4/types.rb', line 50433

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

#statusGlusterBrickStatus

Returns the value of the status attribute.

Returns:



50450
50451
50452
# File 'lib/ovirtsdk4/types.rb', line 50450

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



50459
50460
50461
# File 'lib/ovirtsdk4/types.rb', line 50459

def status=(value)
  @status = value
end

#templateTemplate

Returns the value of the template attribute.

Returns:



50468
50469
50470
# File 'lib/ovirtsdk4/types.rb', line 50468

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:



50481
50482
50483
50484
50485
50486
# File 'lib/ovirtsdk4/types.rb', line 50481

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

#vmVm

Returns the value of the vm attribute.

Returns:



50493
50494
50495
# File 'lib/ovirtsdk4/types.rb', line 50493

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)


50506
50507
50508
50509
50510
50511
# File 'lib/ovirtsdk4/types.rb', line 50506

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

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


50518
50519
50520
# File 'lib/ovirtsdk4/types.rb', line 50518

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


50527
50528
50529
50530
50531
50532
50533
50534
50535
50536
50537
# File 'lib/ovirtsdk4/types.rb', line 50527

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