Class: OvirtSDK4::GlusterVolume

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 = {}) ⇒ GlusterVolume

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

  • :bricks (Array<GlusterBrick>, Array<Hash>)

    The values of attribute bricks.

  • :cluster (Cluster, Hash)

    The value of attribute cluster.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :disperse_count (Integer)

    The value of attribute disperse_count.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :options (Array<Option>, Array<Hash>)

    The values of attribute options.

  • :redundancy_count (Integer)

    The value of attribute redundancy_count.

  • :replica_count (Integer)

    The value of attribute replica_count.

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

    The values of attribute statistics.

  • :status (GlusterVolumeStatus)

    The value of attribute status.

  • :stripe_count (Integer)

    The value of attribute stripe_count.

  • :transport_types (Array<TransportType>, Array<Hash>)

    The values of attribute transport_types.

  • :volume_type (GlusterVolumeType)

    The value of attribute volume_type.


41466
41467
41468
41469
41470
41471
41472
41473
41474
41475
41476
41477
41478
41479
# File 'lib/ovirtsdk4/types.rb', line 41466

def initialize(opts = {})
  super(opts)
  self.bricks = opts[:bricks]
  self.cluster = opts[:cluster]
  self.disperse_count = opts[:disperse_count]
  self.options = opts[:options]
  self.redundancy_count = opts[:redundancy_count]
  self.replica_count = opts[:replica_count]
  self.statistics = opts[:statistics]
  self.status = opts[:status]
  self.stripe_count = opts[:stripe_count]
  self.transport_types = opts[:transport_types]
  self.volume_type = opts[:volume_type]
end

Instance Method Details

#==(other) ⇒ Object

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


41484
41485
41486
41487
41488
41489
41490
41491
41492
41493
41494
41495
41496
41497
# File 'lib/ovirtsdk4/types.rb', line 41484

def ==(other)
  super &&
  @bricks == other.bricks &&
  @cluster == other.cluster &&
  @disperse_count == other.disperse_count &&
  @options == other.options &&
  @redundancy_count == other.redundancy_count &&
  @replica_count == other.replica_count &&
  @statistics == other.statistics &&
  @status == other.status &&
  @stripe_count == other.stripe_count &&
  @transport_types == other.transport_types &&
  @volume_type == other.volume_type
end

#bricksArray<GlusterBrick>

Returns the value of the bricks attribute.

Returns:


41132
41133
41134
# File 'lib/ovirtsdk4/types.rb', line 41132

def bricks
  @bricks
end

#bricks=(list) ⇒ Object

Sets the value of the bricks attribute.

Parameters:


41141
41142
41143
41144
41145
41146
41147
41148
41149
41150
41151
# File 'lib/ovirtsdk4/types.rb', line 41141

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

#clusterCluster

Returns the value of the cluster attribute.

Returns:


41158
41159
41160
# File 'lib/ovirtsdk4/types.rb', line 41158

def cluster
  @cluster
end

#cluster=(value) ⇒ Object

Sets the value of the cluster attribute.

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


41171
41172
41173
41174
41175
41176
# File 'lib/ovirtsdk4/types.rb', line 41171

def cluster=(value)
  if value.is_a?(Hash)
    value = Cluster.new(value)
  end
  @cluster = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

41183
41184
41185
# File 'lib/ovirtsdk4/types.rb', line 41183

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

41192
41193
41194
# File 'lib/ovirtsdk4/types.rb', line 41192

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

41201
41202
41203
# File 'lib/ovirtsdk4/types.rb', line 41201

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

41210
41211
41212
# File 'lib/ovirtsdk4/types.rb', line 41210

def description=(value)
  @description = value
end

#disperse_countInteger

Returns the value of the disperse_count attribute.

Returns:

  • (Integer)

41219
41220
41221
# File 'lib/ovirtsdk4/types.rb', line 41219

def disperse_count
  @disperse_count
end

#disperse_count=(value) ⇒ Object

Sets the value of the disperse_count attribute.

Parameters:

  • value (Integer)

41228
41229
41230
# File 'lib/ovirtsdk4/types.rb', line 41228

def disperse_count=(value)
  @disperse_count = value
end

#hashObject

Generates a hash value for this object.


41502
41503
41504
41505
41506
41507
41508
41509
41510
41511
41512
41513
41514
41515
# File 'lib/ovirtsdk4/types.rb', line 41502

def hash
  super +
  @bricks.hash +
  @cluster.hash +
  @disperse_count.hash +
  @options.hash +
  @redundancy_count.hash +
  @replica_count.hash +
  @statistics.hash +
  @status.hash +
  @stripe_count.hash +
  @transport_types.hash +
  @volume_type.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

41237
41238
41239
# File 'lib/ovirtsdk4/types.rb', line 41237

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

41246
41247
41248
# File 'lib/ovirtsdk4/types.rb', line 41246

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

41255
41256
41257
# File 'lib/ovirtsdk4/types.rb', line 41255

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

41264
41265
41266
# File 'lib/ovirtsdk4/types.rb', line 41264

def name=(value)
  @name = value
end

#optionsArray<Option>

Returns the value of the options attribute.

Returns:


41273
41274
41275
# File 'lib/ovirtsdk4/types.rb', line 41273

def options
  @options
end

#options=(list) ⇒ Object

Sets the value of the options attribute.

Parameters:


41282
41283
41284
41285
41286
41287
41288
41289
41290
41291
41292
# File 'lib/ovirtsdk4/types.rb', line 41282

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

#redundancy_countInteger

Returns the value of the redundancy_count attribute.

Returns:

  • (Integer)

41299
41300
41301
# File 'lib/ovirtsdk4/types.rb', line 41299

def redundancy_count
  @redundancy_count
end

#redundancy_count=(value) ⇒ Object

Sets the value of the redundancy_count attribute.

Parameters:

  • value (Integer)

41308
41309
41310
# File 'lib/ovirtsdk4/types.rb', line 41308

def redundancy_count=(value)
  @redundancy_count = value
end

#replica_countInteger

Returns the value of the replica_count attribute.

Returns:

  • (Integer)

41317
41318
41319
# File 'lib/ovirtsdk4/types.rb', line 41317

def replica_count
  @replica_count
end

#replica_count=(value) ⇒ Object

Sets the value of the replica_count attribute.

Parameters:

  • value (Integer)

41326
41327
41328
# File 'lib/ovirtsdk4/types.rb', line 41326

def replica_count=(value)
  @replica_count = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:


41335
41336
41337
# File 'lib/ovirtsdk4/types.rb', line 41335

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:


41344
41345
41346
41347
41348
41349
41350
41351
41352
41353
41354
# File 'lib/ovirtsdk4/types.rb', line 41344

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

#statusGlusterVolumeStatus

Returns the value of the status attribute.

Returns:


41361
41362
41363
# File 'lib/ovirtsdk4/types.rb', line 41361

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:


41370
41371
41372
# File 'lib/ovirtsdk4/types.rb', line 41370

def status=(value)
  @status = value
end

#stripe_countInteger

Returns the value of the stripe_count attribute.

Returns:

  • (Integer)

41379
41380
41381
# File 'lib/ovirtsdk4/types.rb', line 41379

def stripe_count
  @stripe_count
end

#stripe_count=(value) ⇒ Object

Sets the value of the stripe_count attribute.

Parameters:

  • value (Integer)

41388
41389
41390
# File 'lib/ovirtsdk4/types.rb', line 41388

def stripe_count=(value)
  @stripe_count = value
end

#transport_typesArray<TransportType>

Returns the value of the transport_types attribute.

Returns:


41397
41398
41399
# File 'lib/ovirtsdk4/types.rb', line 41397

def transport_types
  @transport_types
end

#transport_types=(list) ⇒ Object

Sets the value of the transport_types attribute.

Parameters:


41406
41407
41408
# File 'lib/ovirtsdk4/types.rb', line 41406

def transport_types=(list)
  @transport_types = list
end

#volume_typeGlusterVolumeType

Returns the value of the volume_type attribute.

Returns:


41415
41416
41417
# File 'lib/ovirtsdk4/types.rb', line 41415

def volume_type
  @volume_type
end

#volume_type=(value) ⇒ Object

Sets the value of the volume_type attribute.

Parameters:


41424
41425
41426
# File 'lib/ovirtsdk4/types.rb', line 41424

def volume_type=(value)
  @volume_type = value
end