Class: OCI::Opensearch::Models::LoadBalancerConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/opensearch/models/load_balancer_config.rb

Overview

This config is used to choose the load balancer service and bandwidth for OpenSearch and OpenDashboard load balancers.

Constant Summary collapse

LOAD_BALANCER_SERVICE_TYPE_ENUM =
[
  LOAD_BALANCER_SERVICE_TYPE_LOAD_BALANCER = 'LOAD_BALANCER'.freeze,
  LOAD_BALANCER_SERVICE_TYPE_NETWORK_LOAD_BALANCER = 'NETWORK_LOAD_BALANCER'.freeze,
  LOAD_BALANCER_SERVICE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LoadBalancerConfig

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 62

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.load_balancer_service_type = attributes[:'loadBalancerServiceType'] if attributes[:'loadBalancerServiceType']
  self.load_balancer_service_type = "LOAD_BALANCER" if load_balancer_service_type.nil? && !attributes.key?(:'loadBalancerServiceType') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :loadBalancerServiceType and :load_balancer_service_type' if attributes.key?(:'loadBalancerServiceType') && attributes.key?(:'load_balancer_service_type')

  self.load_balancer_service_type = attributes[:'load_balancer_service_type'] if attributes[:'load_balancer_service_type']
  self.load_balancer_service_type = "LOAD_BALANCER" if load_balancer_service_type.nil? && !attributes.key?(:'loadBalancerServiceType') && !attributes.key?(:'load_balancer_service_type') # rubocop:disable Style/StringLiterals

  self.load_balancer_min_bandwidth_in_mbps = attributes[:'loadBalancerMinBandwidthInMbps'] if attributes[:'loadBalancerMinBandwidthInMbps']

  raise 'You cannot provide both :loadBalancerMinBandwidthInMbps and :load_balancer_min_bandwidth_in_mbps' if attributes.key?(:'loadBalancerMinBandwidthInMbps') && attributes.key?(:'load_balancer_min_bandwidth_in_mbps')

  self.load_balancer_min_bandwidth_in_mbps = attributes[:'load_balancer_min_bandwidth_in_mbps'] if attributes[:'load_balancer_min_bandwidth_in_mbps']

  self.load_balancer_max_bandwidth_in_mbps = attributes[:'loadBalancerMaxBandwidthInMbps'] if attributes[:'loadBalancerMaxBandwidthInMbps']

  raise 'You cannot provide both :loadBalancerMaxBandwidthInMbps and :load_balancer_max_bandwidth_in_mbps' if attributes.key?(:'loadBalancerMaxBandwidthInMbps') && attributes.key?(:'load_balancer_max_bandwidth_in_mbps')

  self.load_balancer_max_bandwidth_in_mbps = attributes[:'load_balancer_max_bandwidth_in_mbps'] if attributes[:'load_balancer_max_bandwidth_in_mbps']
end

Instance Attribute Details

#load_balancer_max_bandwidth_in_mbpsInteger

Maximum bandwidth (Mbps) of OpenSearch load balancer. Not applicable for network load balancer service.

Returns:

  • (Integer)


29
30
31
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 29

def load_balancer_max_bandwidth_in_mbps
  @load_balancer_max_bandwidth_in_mbps
end

#load_balancer_min_bandwidth_in_mbpsInteger

Minimum bandwidth (Mbps) of OpenSearch load balancer. Not applicable for network load balancer service.

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 25

def load_balancer_min_bandwidth_in_mbps
  @load_balancer_min_bandwidth_in_mbps
end

#load_balancer_service_typeString

[Required] Load balancer service for OpenSearch and OpenDashboard load balancer. Default value is LOAD_BALANCER.

Returns:

  • (String)


21
22
23
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 21

def load_balancer_service_type
  @load_balancer_service_type
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



32
33
34
35
36
37
38
39
40
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 32

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'load_balancer_service_type': :'loadBalancerServiceType',
    'load_balancer_min_bandwidth_in_mbps': :'loadBalancerMinBandwidthInMbps',
    'load_balancer_max_bandwidth_in_mbps': :'loadBalancerMaxBandwidthInMbps'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



43
44
45
46
47
48
49
50
51
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 43

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'load_balancer_service_type': :'String',
    'load_balancer_min_bandwidth_in_mbps': :'Integer',
    'load_balancer_max_bandwidth_in_mbps': :'Integer'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



109
110
111
112
113
114
115
116
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 109

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    load_balancer_service_type == other.load_balancer_service_type &&
    load_balancer_min_bandwidth_in_mbps == other.load_balancer_min_bandwidth_in_mbps &&
    load_balancer_max_bandwidth_in_mbps == other.load_balancer_max_bandwidth_in_mbps
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 141

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


121
122
123
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 121

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



130
131
132
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 130

def hash
  [load_balancer_service_type, load_balancer_min_bandwidth_in_mbps, load_balancer_max_bandwidth_in_mbps].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



174
175
176
177
178
179
180
181
182
183
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 174

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



168
169
170
# File 'lib/oci/opensearch/models/load_balancer_config.rb', line 168

def to_s
  to_hash.to_s
end