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.



42349
42350
42351
42352
42353
42354
42355
42356
42357
42358
42359
42360
42361
42362
# File 'lib/ovirtsdk4/types.rb', line 42349

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.



42367
42368
42369
42370
42371
42372
42373
42374
42375
42376
42377
42378
42379
42380
# File 'lib/ovirtsdk4/types.rb', line 42367

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:



42015
42016
42017
# File 'lib/ovirtsdk4/types.rb', line 42015

def bricks
  @bricks
end

#bricks=(list) ⇒ Object

Sets the value of the bricks attribute.

Parameters:



42024
42025
42026
42027
42028
42029
42030
42031
42032
42033
42034
# File 'lib/ovirtsdk4/types.rb', line 42024

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:



42041
42042
42043
# File 'lib/ovirtsdk4/types.rb', line 42041

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:



42054
42055
42056
42057
42058
42059
# File 'lib/ovirtsdk4/types.rb', line 42054

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)


42066
42067
42068
# File 'lib/ovirtsdk4/types.rb', line 42066

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


42075
42076
42077
# File 'lib/ovirtsdk4/types.rb', line 42075

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


42084
42085
42086
# File 'lib/ovirtsdk4/types.rb', line 42084

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


42093
42094
42095
# File 'lib/ovirtsdk4/types.rb', line 42093

def description=(value)
  @description = value
end

#disperse_countInteger

Returns the value of the disperse_count attribute.

Returns:

  • (Integer)


42102
42103
42104
# File 'lib/ovirtsdk4/types.rb', line 42102

def disperse_count
  @disperse_count
end

#disperse_count=(value) ⇒ Object

Sets the value of the disperse_count attribute.

Parameters:

  • value (Integer)


42111
42112
42113
# File 'lib/ovirtsdk4/types.rb', line 42111

def disperse_count=(value)
  @disperse_count = value
end

#hashObject

Generates a hash value for this object.



42385
42386
42387
42388
42389
42390
42391
42392
42393
42394
42395
42396
42397
42398
# File 'lib/ovirtsdk4/types.rb', line 42385

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)


42120
42121
42122
# File 'lib/ovirtsdk4/types.rb', line 42120

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


42129
42130
42131
# File 'lib/ovirtsdk4/types.rb', line 42129

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


42138
42139
42140
# File 'lib/ovirtsdk4/types.rb', line 42138

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


42147
42148
42149
# File 'lib/ovirtsdk4/types.rb', line 42147

def name=(value)
  @name = value
end

#optionsArray<Option>

Returns the value of the options attribute.

Returns:



42156
42157
42158
# File 'lib/ovirtsdk4/types.rb', line 42156

def options
  @options
end

#options=(list) ⇒ Object

Sets the value of the options attribute.

Parameters:



42165
42166
42167
42168
42169
42170
42171
42172
42173
42174
42175
# File 'lib/ovirtsdk4/types.rb', line 42165

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)


42182
42183
42184
# File 'lib/ovirtsdk4/types.rb', line 42182

def redundancy_count
  @redundancy_count
end

#redundancy_count=(value) ⇒ Object

Sets the value of the redundancy_count attribute.

Parameters:

  • value (Integer)


42191
42192
42193
# File 'lib/ovirtsdk4/types.rb', line 42191

def redundancy_count=(value)
  @redundancy_count = value
end

#replica_countInteger

Returns the value of the replica_count attribute.

Returns:

  • (Integer)


42200
42201
42202
# File 'lib/ovirtsdk4/types.rb', line 42200

def replica_count
  @replica_count
end

#replica_count=(value) ⇒ Object

Sets the value of the replica_count attribute.

Parameters:

  • value (Integer)


42209
42210
42211
# File 'lib/ovirtsdk4/types.rb', line 42209

def replica_count=(value)
  @replica_count = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



42218
42219
42220
# File 'lib/ovirtsdk4/types.rb', line 42218

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



42227
42228
42229
42230
42231
42232
42233
42234
42235
42236
42237
# File 'lib/ovirtsdk4/types.rb', line 42227

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:



42244
42245
42246
# File 'lib/ovirtsdk4/types.rb', line 42244

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



42253
42254
42255
# File 'lib/ovirtsdk4/types.rb', line 42253

def status=(value)
  @status = value
end

#stripe_countInteger

Returns the value of the stripe_count attribute.

Returns:

  • (Integer)


42262
42263
42264
# File 'lib/ovirtsdk4/types.rb', line 42262

def stripe_count
  @stripe_count
end

#stripe_count=(value) ⇒ Object

Sets the value of the stripe_count attribute.

Parameters:

  • value (Integer)


42271
42272
42273
# File 'lib/ovirtsdk4/types.rb', line 42271

def stripe_count=(value)
  @stripe_count = value
end

#transport_typesArray<TransportType>

Returns the value of the transport_types attribute.

Returns:



42280
42281
42282
# File 'lib/ovirtsdk4/types.rb', line 42280

def transport_types
  @transport_types
end

#transport_types=(list) ⇒ Object

Sets the value of the transport_types attribute.

Parameters:



42289
42290
42291
# File 'lib/ovirtsdk4/types.rb', line 42289

def transport_types=(list)
  @transport_types = list
end

#volume_typeGlusterVolumeType

Returns the value of the volume_type attribute.

Returns:



42298
42299
42300
# File 'lib/ovirtsdk4/types.rb', line 42298

def volume_type
  @volume_type
end

#volume_type=(value) ⇒ Object

Sets the value of the volume_type attribute.

Parameters:



42307
42308
42309
# File 'lib/ovirtsdk4/types.rb', line 42307

def volume_type=(value)
  @volume_type = value
end