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.


53154
53155
53156
53157
53158
53159
53160
53161
# File 'lib/ovirtsdk4/types.rb', line 53154

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.


53166
53167
53168
53169
53170
53171
53172
53173
# File 'lib/ovirtsdk4/types.rb', line 53166

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)

52691
52692
52693
# File 'lib/ovirtsdk4/types.rb', line 52691

def brick_dir
  @brick_dir
end

#brick_dir=(value) ⇒ Object

Sets the value of the brick_dir attribute.

Parameters:

  • value (String)

52700
52701
52702
# File 'lib/ovirtsdk4/types.rb', line 52700

def brick_dir=(value)
  @brick_dir = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

52709
52710
52711
# File 'lib/ovirtsdk4/types.rb', line 52709

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

52718
52719
52720
# File 'lib/ovirtsdk4/types.rb', line 52718

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

52727
52728
52729
# File 'lib/ovirtsdk4/types.rb', line 52727

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

52736
52737
52738
# File 'lib/ovirtsdk4/types.rb', line 52736

def description=(value)
  @description = value
end

#deviceString

Returns the value of the device attribute.

Returns:

  • (String)

52745
52746
52747
# File 'lib/ovirtsdk4/types.rb', line 52745

def device
  @device
end

#device=(value) ⇒ Object

Sets the value of the device attribute.

Parameters:

  • value (String)

52754
52755
52756
# File 'lib/ovirtsdk4/types.rb', line 52754

def device=(value)
  @device = value
end

#fs_nameString

Returns the value of the fs_name attribute.

Returns:

  • (String)

52763
52764
52765
# File 'lib/ovirtsdk4/types.rb', line 52763

def fs_name
  @fs_name
end

#fs_name=(value) ⇒ Object

Sets the value of the fs_name attribute.

Parameters:

  • value (String)

52772
52773
52774
# File 'lib/ovirtsdk4/types.rb', line 52772

def fs_name=(value)
  @fs_name = value
end

#gluster_clientsArray<GlusterClient>

Returns the value of the gluster_clients attribute.

Returns:


52781
52782
52783
# File 'lib/ovirtsdk4/types.rb', line 52781

def gluster_clients
  @gluster_clients
end

#gluster_clients=(list) ⇒ Object

Sets the value of the gluster_clients attribute.

Parameters:


52790
52791
52792
52793
52794
52795
52796
52797
52798
52799
52800
# File 'lib/ovirtsdk4/types.rb', line 52790

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:


52807
52808
52809
# File 'lib/ovirtsdk4/types.rb', line 52807

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:


52820
52821
52822
52823
52824
52825
# File 'lib/ovirtsdk4/types.rb', line 52820

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.


53178
53179
53180
53181
53182
53183
53184
53185
# File 'lib/ovirtsdk4/types.rb', line 53178

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)

52832
52833
52834
# File 'lib/ovirtsdk4/types.rb', line 52832

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

52841
52842
52843
# File 'lib/ovirtsdk4/types.rb', line 52841

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:


52850
52851
52852
# File 'lib/ovirtsdk4/types.rb', line 52850

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:


52863
52864
52865
52866
52867
52868
# File 'lib/ovirtsdk4/types.rb', line 52863

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:


52875
52876
52877
# File 'lib/ovirtsdk4/types.rb', line 52875

def memory_pools
  @memory_pools
end

#memory_pools=(list) ⇒ Object

Sets the value of the memory_pools attribute.

Parameters:


52884
52885
52886
52887
52888
52889
52890
52891
52892
52893
52894
# File 'lib/ovirtsdk4/types.rb', line 52884

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)

52901
52902
52903
# File 'lib/ovirtsdk4/types.rb', line 52901

def mnt_options
  @mnt_options
end

#mnt_options=(value) ⇒ Object

Sets the value of the mnt_options attribute.

Parameters:

  • value (String)

52910
52911
52912
# File 'lib/ovirtsdk4/types.rb', line 52910

def mnt_options=(value)
  @mnt_options = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

52919
52920
52921
# File 'lib/ovirtsdk4/types.rb', line 52919

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

52928
52929
52930
# File 'lib/ovirtsdk4/types.rb', line 52928

def name=(value)
  @name = value
end

#pidInteger

Returns the value of the pid attribute.

Returns:

  • (Integer)

52937
52938
52939
# File 'lib/ovirtsdk4/types.rb', line 52937

def pid
  @pid
end

#pid=(value) ⇒ Object

Sets the value of the pid attribute.

Parameters:

  • value (Integer)

52946
52947
52948
# File 'lib/ovirtsdk4/types.rb', line 52946

def pid=(value)
  @pid = value
end

#portInteger

Returns the value of the port attribute.

Returns:

  • (Integer)

52955
52956
52957
# File 'lib/ovirtsdk4/types.rb', line 52955

def port
  @port
end

#port=(value) ⇒ Object

Sets the value of the port attribute.

Parameters:

  • value (Integer)

52964
52965
52966
# File 'lib/ovirtsdk4/types.rb', line 52964

def port=(value)
  @port = value
end

#server_idString

Returns the value of the server_id attribute.

Returns:

  • (String)

52973
52974
52975
# File 'lib/ovirtsdk4/types.rb', line 52973

def server_id
  @server_id
end

#server_id=(value) ⇒ Object

Sets the value of the server_id attribute.

Parameters:

  • value (String)

52982
52983
52984
# File 'lib/ovirtsdk4/types.rb', line 52982

def server_id=(value)
  @server_id = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:


52991
52992
52993
# File 'lib/ovirtsdk4/types.rb', line 52991

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:


53000
53001
53002
53003
53004
53005
53006
53007
53008
53009
53010
# File 'lib/ovirtsdk4/types.rb', line 53000

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:


53017
53018
53019
# File 'lib/ovirtsdk4/types.rb', line 53017

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:


53026
53027
53028
# File 'lib/ovirtsdk4/types.rb', line 53026

def status=(value)
  @status = value
end

#templateTemplate

Returns the value of the template attribute.

Returns:


53035
53036
53037
# File 'lib/ovirtsdk4/types.rb', line 53035

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:


53048
53049
53050
53051
53052
53053
# File 'lib/ovirtsdk4/types.rb', line 53048

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:


53060
53061
53062
# File 'lib/ovirtsdk4/types.rb', line 53060

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)

53073
53074
53075
53076
53077
53078
# File 'lib/ovirtsdk4/types.rb', line 53073

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

53085
53086
53087
# File 'lib/ovirtsdk4/types.rb', line 53085

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)

53094
53095
53096
53097
53098
53099
53100
53101
53102
53103
53104
# File 'lib/ovirtsdk4/types.rb', line 53094

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