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.


52208
52209
52210
52211
52212
52213
52214
52215
# File 'lib/ovirtsdk4/types.rb', line 52208

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.


52220
52221
52222
52223
52224
52225
52226
52227
# File 'lib/ovirtsdk4/types.rb', line 52220

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)

51745
51746
51747
# File 'lib/ovirtsdk4/types.rb', line 51745

def brick_dir
  @brick_dir
end

#brick_dir=(value) ⇒ Object

Sets the value of the brick_dir attribute.

Parameters:

  • value (String)

51754
51755
51756
# File 'lib/ovirtsdk4/types.rb', line 51754

def brick_dir=(value)
  @brick_dir = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

51763
51764
51765
# File 'lib/ovirtsdk4/types.rb', line 51763

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

51772
51773
51774
# File 'lib/ovirtsdk4/types.rb', line 51772

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

51781
51782
51783
# File 'lib/ovirtsdk4/types.rb', line 51781

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

51790
51791
51792
# File 'lib/ovirtsdk4/types.rb', line 51790

def description=(value)
  @description = value
end

#deviceString

Returns the value of the device attribute.

Returns:

  • (String)

51799
51800
51801
# File 'lib/ovirtsdk4/types.rb', line 51799

def device
  @device
end

#device=(value) ⇒ Object

Sets the value of the device attribute.

Parameters:

  • value (String)

51808
51809
51810
# File 'lib/ovirtsdk4/types.rb', line 51808

def device=(value)
  @device = value
end

#fs_nameString

Returns the value of the fs_name attribute.

Returns:

  • (String)

51817
51818
51819
# File 'lib/ovirtsdk4/types.rb', line 51817

def fs_name
  @fs_name
end

#fs_name=(value) ⇒ Object

Sets the value of the fs_name attribute.

Parameters:

  • value (String)

51826
51827
51828
# File 'lib/ovirtsdk4/types.rb', line 51826

def fs_name=(value)
  @fs_name = value
end

#gluster_clientsArray<GlusterClient>

Returns the value of the gluster_clients attribute.

Returns:


51835
51836
51837
# File 'lib/ovirtsdk4/types.rb', line 51835

def gluster_clients
  @gluster_clients
end

#gluster_clients=(list) ⇒ Object

Sets the value of the gluster_clients attribute.

Parameters:


51844
51845
51846
51847
51848
51849
51850
51851
51852
51853
51854
# File 'lib/ovirtsdk4/types.rb', line 51844

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:


51861
51862
51863
# File 'lib/ovirtsdk4/types.rb', line 51861

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:


51874
51875
51876
51877
51878
51879
# File 'lib/ovirtsdk4/types.rb', line 51874

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.


52232
52233
52234
52235
52236
52237
52238
52239
# File 'lib/ovirtsdk4/types.rb', line 52232

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)

51886
51887
51888
# File 'lib/ovirtsdk4/types.rb', line 51886

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

51895
51896
51897
# File 'lib/ovirtsdk4/types.rb', line 51895

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:


51904
51905
51906
# File 'lib/ovirtsdk4/types.rb', line 51904

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:


51917
51918
51919
51920
51921
51922
# File 'lib/ovirtsdk4/types.rb', line 51917

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:


51929
51930
51931
# File 'lib/ovirtsdk4/types.rb', line 51929

def memory_pools
  @memory_pools
end

#memory_pools=(list) ⇒ Object

Sets the value of the memory_pools attribute.

Parameters:


51938
51939
51940
51941
51942
51943
51944
51945
51946
51947
51948
# File 'lib/ovirtsdk4/types.rb', line 51938

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)

51955
51956
51957
# File 'lib/ovirtsdk4/types.rb', line 51955

def mnt_options
  @mnt_options
end

#mnt_options=(value) ⇒ Object

Sets the value of the mnt_options attribute.

Parameters:

  • value (String)

51964
51965
51966
# File 'lib/ovirtsdk4/types.rb', line 51964

def mnt_options=(value)
  @mnt_options = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

51973
51974
51975
# File 'lib/ovirtsdk4/types.rb', line 51973

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

51982
51983
51984
# File 'lib/ovirtsdk4/types.rb', line 51982

def name=(value)
  @name = value
end

#pidInteger

Returns the value of the pid attribute.

Returns:

  • (Integer)

51991
51992
51993
# File 'lib/ovirtsdk4/types.rb', line 51991

def pid
  @pid
end

#pid=(value) ⇒ Object

Sets the value of the pid attribute.

Parameters:

  • value (Integer)

52000
52001
52002
# File 'lib/ovirtsdk4/types.rb', line 52000

def pid=(value)
  @pid = value
end

#portInteger

Returns the value of the port attribute.

Returns:

  • (Integer)

52009
52010
52011
# File 'lib/ovirtsdk4/types.rb', line 52009

def port
  @port
end

#port=(value) ⇒ Object

Sets the value of the port attribute.

Parameters:

  • value (Integer)

52018
52019
52020
# File 'lib/ovirtsdk4/types.rb', line 52018

def port=(value)
  @port = value
end

#server_idString

Returns the value of the server_id attribute.

Returns:

  • (String)

52027
52028
52029
# File 'lib/ovirtsdk4/types.rb', line 52027

def server_id
  @server_id
end

#server_id=(value) ⇒ Object

Sets the value of the server_id attribute.

Parameters:

  • value (String)

52036
52037
52038
# File 'lib/ovirtsdk4/types.rb', line 52036

def server_id=(value)
  @server_id = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:


52045
52046
52047
# File 'lib/ovirtsdk4/types.rb', line 52045

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:


52054
52055
52056
52057
52058
52059
52060
52061
52062
52063
52064
# File 'lib/ovirtsdk4/types.rb', line 52054

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:


52071
52072
52073
# File 'lib/ovirtsdk4/types.rb', line 52071

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:


52080
52081
52082
# File 'lib/ovirtsdk4/types.rb', line 52080

def status=(value)
  @status = value
end

#templateTemplate

Returns the value of the template attribute.

Returns:


52089
52090
52091
# File 'lib/ovirtsdk4/types.rb', line 52089

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:


52102
52103
52104
52105
52106
52107
# File 'lib/ovirtsdk4/types.rb', line 52102

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:


52114
52115
52116
# File 'lib/ovirtsdk4/types.rb', line 52114

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)

52127
52128
52129
52130
52131
52132
# File 'lib/ovirtsdk4/types.rb', line 52127

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

52139
52140
52141
# File 'lib/ovirtsdk4/types.rb', line 52139

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)

52148
52149
52150
52151
52152
52153
52154
52155
52156
52157
52158
# File 'lib/ovirtsdk4/types.rb', line 52148

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