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.



51464
51465
51466
51467
51468
51469
51470
51471
# File 'lib/ovirtsdk4/types.rb', line 51464

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.



51476
51477
51478
51479
51480
51481
51482
51483
# File 'lib/ovirtsdk4/types.rb', line 51476

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)


51001
51002
51003
# File 'lib/ovirtsdk4/types.rb', line 51001

def brick_dir
  @brick_dir
end

#brick_dir=(value) ⇒ Object

Sets the value of the brick_dir attribute.

Parameters:

  • value (String)


51010
51011
51012
# File 'lib/ovirtsdk4/types.rb', line 51010

def brick_dir=(value)
  @brick_dir = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


51019
51020
51021
# File 'lib/ovirtsdk4/types.rb', line 51019

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


51028
51029
51030
# File 'lib/ovirtsdk4/types.rb', line 51028

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


51037
51038
51039
# File 'lib/ovirtsdk4/types.rb', line 51037

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


51046
51047
51048
# File 'lib/ovirtsdk4/types.rb', line 51046

def description=(value)
  @description = value
end

#deviceString

Returns the value of the device attribute.

Returns:

  • (String)


51055
51056
51057
# File 'lib/ovirtsdk4/types.rb', line 51055

def device
  @device
end

#device=(value) ⇒ Object

Sets the value of the device attribute.

Parameters:

  • value (String)


51064
51065
51066
# File 'lib/ovirtsdk4/types.rb', line 51064

def device=(value)
  @device = value
end

#fs_nameString

Returns the value of the fs_name attribute.

Returns:

  • (String)


51073
51074
51075
# File 'lib/ovirtsdk4/types.rb', line 51073

def fs_name
  @fs_name
end

#fs_name=(value) ⇒ Object

Sets the value of the fs_name attribute.

Parameters:

  • value (String)


51082
51083
51084
# File 'lib/ovirtsdk4/types.rb', line 51082

def fs_name=(value)
  @fs_name = value
end

#gluster_clientsArray<GlusterClient>

Returns the value of the gluster_clients attribute.

Returns:



51091
51092
51093
# File 'lib/ovirtsdk4/types.rb', line 51091

def gluster_clients
  @gluster_clients
end

#gluster_clients=(list) ⇒ Object

Sets the value of the gluster_clients attribute.

Parameters:



51100
51101
51102
51103
51104
51105
51106
51107
51108
51109
51110
# File 'lib/ovirtsdk4/types.rb', line 51100

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:



51117
51118
51119
# File 'lib/ovirtsdk4/types.rb', line 51117

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:



51130
51131
51132
51133
51134
51135
# File 'lib/ovirtsdk4/types.rb', line 51130

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.



51488
51489
51490
51491
51492
51493
51494
51495
# File 'lib/ovirtsdk4/types.rb', line 51488

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)


51142
51143
51144
# File 'lib/ovirtsdk4/types.rb', line 51142

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


51151
51152
51153
# File 'lib/ovirtsdk4/types.rb', line 51151

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:



51160
51161
51162
# File 'lib/ovirtsdk4/types.rb', line 51160

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:



51173
51174
51175
51176
51177
51178
# File 'lib/ovirtsdk4/types.rb', line 51173

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:



51185
51186
51187
# File 'lib/ovirtsdk4/types.rb', line 51185

def memory_pools
  @memory_pools
end

#memory_pools=(list) ⇒ Object

Sets the value of the memory_pools attribute.

Parameters:



51194
51195
51196
51197
51198
51199
51200
51201
51202
51203
51204
# File 'lib/ovirtsdk4/types.rb', line 51194

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)


51211
51212
51213
# File 'lib/ovirtsdk4/types.rb', line 51211

def mnt_options
  @mnt_options
end

#mnt_options=(value) ⇒ Object

Sets the value of the mnt_options attribute.

Parameters:

  • value (String)


51220
51221
51222
# File 'lib/ovirtsdk4/types.rb', line 51220

def mnt_options=(value)
  @mnt_options = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


51229
51230
51231
# File 'lib/ovirtsdk4/types.rb', line 51229

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


51238
51239
51240
# File 'lib/ovirtsdk4/types.rb', line 51238

def name=(value)
  @name = value
end

#pidInteger

Returns the value of the pid attribute.

Returns:

  • (Integer)


51247
51248
51249
# File 'lib/ovirtsdk4/types.rb', line 51247

def pid
  @pid
end

#pid=(value) ⇒ Object

Sets the value of the pid attribute.

Parameters:

  • value (Integer)


51256
51257
51258
# File 'lib/ovirtsdk4/types.rb', line 51256

def pid=(value)
  @pid = value
end

#portInteger

Returns the value of the port attribute.

Returns:

  • (Integer)


51265
51266
51267
# File 'lib/ovirtsdk4/types.rb', line 51265

def port
  @port
end

#port=(value) ⇒ Object

Sets the value of the port attribute.

Parameters:

  • value (Integer)


51274
51275
51276
# File 'lib/ovirtsdk4/types.rb', line 51274

def port=(value)
  @port = value
end

#server_idString

Returns the value of the server_id attribute.

Returns:

  • (String)


51283
51284
51285
# File 'lib/ovirtsdk4/types.rb', line 51283

def server_id
  @server_id
end

#server_id=(value) ⇒ Object

Sets the value of the server_id attribute.

Parameters:

  • value (String)


51292
51293
51294
# File 'lib/ovirtsdk4/types.rb', line 51292

def server_id=(value)
  @server_id = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



51301
51302
51303
# File 'lib/ovirtsdk4/types.rb', line 51301

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



51310
51311
51312
51313
51314
51315
51316
51317
51318
51319
51320
# File 'lib/ovirtsdk4/types.rb', line 51310

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:



51327
51328
51329
# File 'lib/ovirtsdk4/types.rb', line 51327

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



51336
51337
51338
# File 'lib/ovirtsdk4/types.rb', line 51336

def status=(value)
  @status = value
end

#templateTemplate

Returns the value of the template attribute.

Returns:



51345
51346
51347
# File 'lib/ovirtsdk4/types.rb', line 51345

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:



51358
51359
51360
51361
51362
51363
# File 'lib/ovirtsdk4/types.rb', line 51358

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:



51370
51371
51372
# File 'lib/ovirtsdk4/types.rb', line 51370

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)


51383
51384
51385
51386
51387
51388
# File 'lib/ovirtsdk4/types.rb', line 51383

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>)


51395
51396
51397
# File 'lib/ovirtsdk4/types.rb', line 51395

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


51404
51405
51406
51407
51408
51409
51410
51411
51412
51413
51414
# File 'lib/ovirtsdk4/types.rb', line 51404

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