Class: LinodeOpenapiClient::PostRebuildNodeBalancerConfigRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PostRebuildNodeBalancerConfigRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 171

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `LinodeOpenapiClient::PostRebuildNodeBalancerConfigRequest` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `LinodeOpenapiClient::PostRebuildNodeBalancerConfigRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'check_interval')
    self.check_interval = attributes[:'check_interval']
  else
    self.check_interval = 31
  end

  if attributes.key?(:'proxy_protocol')
    self.proxy_protocol = attributes[:'proxy_protocol']
  else
    self.proxy_protocol = 'none'
  end

  if attributes.key?(:'check')
    self.check = attributes[:'check']
  else
    self.check = 'none'
  end

  if attributes.key?(:'ssl_commonname')
    self.ssl_commonname = attributes[:'ssl_commonname']
  end

  if attributes.key?(:'nodebalancer_id')
    self.nodebalancer_id = attributes[:'nodebalancer_id']
  end

  if attributes.key?(:'ssl_cert')
    self.ssl_cert = attributes[:'ssl_cert']
  end

  if attributes.key?(:'nodes_status')
    self.nodes_status = attributes[:'nodes_status']
  end

  if attributes.key?(:'ssl_fingerprint')
    self.ssl_fingerprint = attributes[:'ssl_fingerprint']
  end

  if attributes.key?(:'check_attempts')
    self.check_attempts = attributes[:'check_attempts']
  else
    self.check_attempts = 3
  end

  if attributes.key?(:'port')
    self.port = attributes[:'port']
  else
    self.port = 80
  end

  if attributes.key?(:'protocol')
    self.protocol = attributes[:'protocol']
  else
    self.protocol = 'http'
  end

  if attributes.key?(:'check_body')
    self.check_body = attributes[:'check_body']
  end

  if attributes.key?(:'cipher_suite')
    self.cipher_suite = attributes[:'cipher_suite']
  else
    self.cipher_suite = 'recommended'
  end

  if attributes.key?(:'stickiness')
    self.stickiness = attributes[:'stickiness']
  else
    self.stickiness = 'none'
  end

  if attributes.key?(:'check_passive')
    self.check_passive = attributes[:'check_passive']
  else
    self.check_passive = true
  end

  if attributes.key?(:'ssl_key')
    self.ssl_key = attributes[:'ssl_key']
  end

  if attributes.key?(:'check_path')
    self.check_path = attributes[:'check_path']
  end

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'check_timeout')
    self.check_timeout = attributes[:'check_timeout']
  else
    self.check_timeout = 30
  end

  if attributes.key?(:'algorithm')
    self.algorithm = attributes[:'algorithm']
  else
    self.algorithm = 'roundrobin'
  end

  if attributes.key?(:'nodes')
    if (value = attributes[:'nodes']).is_a?(Array)
      self.nodes = value
    end
  else
    self.nodes = nil
  end
end

Instance Attribute Details

#algorithmObject

What algorithm this NodeBalancer should use for routing traffic to backends.



75
76
77
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 75

def algorithm
  @algorithm
end

#checkObject

The type of check to perform against backends to ensure they are serving requests. This is used to determine if backends are up or down. - If ‘none` no check is performed. - `connection` requires only a connection to the backend to succeed. - `http` and `http_body` rely on the backend serving HTTP, and that the response returned matches what is expected.



25
26
27
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 25

def check
  @check
end

#check_attemptsObject

How many times to attempt a check before considering a backend to be down.



42
43
44
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 42

def check_attempts
  @check_attempts
end

#check_bodyObject

This value must be present in the response body of the check in order for it to pass. If this value is not present in the response body of a check request, the backend is considered to be down.



51
52
53
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 51

def check_body
  @check_body
end

#check_intervalObject

How often, in seconds, to check that backends are up and serving requests. Must be greater than ‘check_timeout`.



19
20
21
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 19

def check_interval
  @check_interval
end

#check_passiveObject

If true, any response from this backend with a ‘5xx` status code will be enough for it to be considered unhealthy and taken out of rotation.



60
61
62
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 60

def check_passive
  @check_passive
end

#check_pathObject

The URL path to check on each backend. If the backend does not respond to this request it is considered to be down.



66
67
68
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 66

def check_path
  @check_path
end

#check_timeoutObject

How long, in seconds, to wait for a check attempt before considering it failed. Must be less than ‘check_interval`.



72
73
74
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 72

def check_timeout
  @check_timeout
end

#cipher_suiteObject

What ciphers to use for SSL connections served by this NodeBalancer. - ‘legacy` is considered insecure and should only be used if necessary.



54
55
56
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 54

def cipher_suite
  @cipher_suite
end

#idObject

Read-only This config’s unique ID.



69
70
71
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 69

def id
  @id
end

#nodebalancer_idObject

Read-only The ID for the NodeBalancer this config belongs to.



31
32
33
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 31

def nodebalancer_id
  @nodebalancer_id
end

#nodesObject

The NodeBalancer Nodes that serve this Config. Some considerations for Nodes when rebuilding a config: - Current Nodes excluded from the request body will be deleted from the Config. - Current Nodes (identified by their Node ID) will be updated. - New Nodes (included without a Node ID) will be created.



78
79
80
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 78

def nodes
  @nodes
end

#nodes_statusObject

Returns the value of attribute nodes_status.



36
37
38
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 36

def nodes_status
  @nodes_status
end

#portObject

The port this Config is for. These values must be unique across configs on a single NodeBalancer (you can’t have two configs for port 80, for example). While some ports imply some protocols, no enforcement is done and you may configure your NodeBalancer however is useful to you. For example, while port 443 is generally used for HTTPS, you do not need SSL configured to have a NodeBalancer listening on port 443.



45
46
47
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 45

def port
  @port
end

#protocolObject

The protocol this port is configured to serve. - The ‘http` and `tcp` protocols do not support `ssl_cert` and `ssl_key`. - The `https` protocol is mutually required with `ssl_cert` and `ssl_key`. Review our guide on [Available Protocols](www.linode.com/docs/products/networking/nodebalancers/guides/protocols/) for information on protocol features.



48
49
50
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 48

def protocol
  @protocol
end

#proxy_protocolObject

ProxyProtocol is a TCP extension that sends initial TCP connection information such as source/destination IPs and ports to backend devices. This information would be lost otherwise. Backend devices must be configured to work with ProxyProtocol if enabled. - If omitted, or set to ‘none`, the NodeBalancer doesn’t send any auxiliary data over TCP connections. This is the default. - If set to ‘v1`, the human-readable header format (Version 1) is used. Requires `tcp` protocol. - If set to `v2`, the binary header format (Version 2) is used. Requires `tcp` protocol.



22
23
24
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 22

def proxy_protocol
  @proxy_protocol
end

#ssl_certObject

The PEM-formatted public SSL certificate (or the combined PEM-formatted SSL certificate and Certificate Authority chain) that should be served on this NodeBalancerConfig’s port. Line breaks must be represented as ‘\n` in the string for requests (but not when using the Linode CLI). [Diffie-Hellman Parameters](www.linode.com/docs/products/networking/nodebalancers/guides/ssl-termination/#diffie-hellman-parameters) can be included in this value to enable forward secrecy. The contents of this field will not be shown in any responses that display the NodeBalancerConfig. Instead, `<REDACTED>` will be printed where the field appears. The read-only `ssl_commonname` and `ssl_fingerprint` fields in a NodeBalancerConfig response are automatically derived from your certificate. Please refer to these fields to verify that the appropriate certificate was assigned to your NodeBalancerConfig.



34
35
36
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 34

def ssl_cert
  @ssl_cert
end

#ssl_commonnameObject

Read-only The read-only common name automatically derived from the SSL certificate assigned to this NodeBalancerConfig. Please refer to this field to verify that the appropriate certificate is assigned to your NodeBalancerConfig.



28
29
30
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 28

def ssl_commonname
  @ssl_commonname
end

#ssl_fingerprintObject

Read-only The read-only SHA1-encoded fingerprint automatically derived from the SSL certificate assigned to this NodeBalancerConfig. Please refer to this field to verify that the appropriate certificate is assigned to your NodeBalancerConfig.



39
40
41
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 39

def ssl_fingerprint
  @ssl_fingerprint
end

#ssl_keyObject

The PEM-formatted private key for the SSL certificate set in the ‘ssl_cert` field. Line breaks must be represented as `\n` in the string for requests (but not when using the Linode CLI). The contents of this field will not be shown in any responses that display the NodeBalancerConfig. Instead, `<REDACTED>` will be printed where the field appears. The read-only `ssl_commonname` and `ssl_fingerprint` fields in a NodeBalancerConfig response are automatically derived from your certificate. Please refer to these fields to verify that the appropriate certificate was assigned to your NodeBalancerConfig.



63
64
65
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 63

def ssl_key
  @ssl_key
end

#stickinessObject

Controls how session stickiness is handled on this port. - If set to ‘none` connections will always be assigned a backend based on the algorithm configured. - If set to `table` sessions from the same remote address will be routed to the same backend. - For HTTP or HTTPS clients, `http_cookie` allows sessions to be routed to the same backend based on a cookie set by the NodeBalancer.



57
58
59
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 57

def stickiness
  @stickiness
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 559

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = LinodeOpenapiClient.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



130
131
132
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 130

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 103

def self.attribute_map
  {
    :'check_interval' => :'check_interval',
    :'proxy_protocol' => :'proxy_protocol',
    :'check' => :'check',
    :'ssl_commonname' => :'ssl_commonname',
    :'nodebalancer_id' => :'nodebalancer_id',
    :'ssl_cert' => :'ssl_cert',
    :'nodes_status' => :'nodes_status',
    :'ssl_fingerprint' => :'ssl_fingerprint',
    :'check_attempts' => :'check_attempts',
    :'port' => :'port',
    :'protocol' => :'protocol',
    :'check_body' => :'check_body',
    :'cipher_suite' => :'cipher_suite',
    :'stickiness' => :'stickiness',
    :'check_passive' => :'check_passive',
    :'ssl_key' => :'ssl_key',
    :'check_path' => :'check_path',
    :'id' => :'id',
    :'check_timeout' => :'check_timeout',
    :'algorithm' => :'algorithm',
    :'nodes' => :'nodes'
  }
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



535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 535

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



162
163
164
165
166
167
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 162

def self.openapi_nullable
  Set.new([
    :'ssl_cert',
    :'ssl_key',
  ])
end

.openapi_typesObject

Attribute type mapping.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 135

def self.openapi_types
  {
    :'check_interval' => :'Integer',
    :'proxy_protocol' => :'String',
    :'check' => :'String',
    :'ssl_commonname' => :'String',
    :'nodebalancer_id' => :'Integer',
    :'ssl_cert' => :'String',
    :'nodes_status' => :'GetNodeBalancerConfig200ResponseNodesStatus',
    :'ssl_fingerprint' => :'String',
    :'check_attempts' => :'Integer',
    :'port' => :'Integer',
    :'protocol' => :'String',
    :'check_body' => :'String',
    :'cipher_suite' => :'String',
    :'stickiness' => :'String',
    :'check_passive' => :'Boolean',
    :'ssl_key' => :'String',
    :'check_path' => :'String',
    :'id' => :'Integer',
    :'check_timeout' => :'Integer',
    :'algorithm' => :'String',
    :'nodes' => :'Array<PostRebuildNodeBalancerConfigRequestAllOfNodesInner>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 494

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      check_interval == o.check_interval &&
      proxy_protocol == o.proxy_protocol &&
      check == o.check &&
      ssl_commonname == o.ssl_commonname &&
      nodebalancer_id == o.nodebalancer_id &&
      ssl_cert == o.ssl_cert &&
      nodes_status == o.nodes_status &&
      ssl_fingerprint == o.ssl_fingerprint &&
      check_attempts == o.check_attempts &&
      port == o.port &&
      protocol == o.protocol &&
      check_body == o.check_body &&
      cipher_suite == o.cipher_suite &&
      stickiness == o.stickiness &&
      check_passive == o.check_passive &&
      ssl_key == o.ssl_key &&
      check_path == o.check_path &&
      id == o.id &&
      check_timeout == o.check_timeout &&
      algorithm == o.algorithm &&
      nodes == o.nodes
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



630
631
632
633
634
635
636
637
638
639
640
641
642
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 630

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


522
523
524
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 522

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



528
529
530
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 528

def hash
  [check_interval, proxy_protocol, check, ssl_commonname, nodebalancer_id, ssl_cert, nodes_status, ssl_fingerprint, check_attempts, port, protocol, check_body, cipher_suite, stickiness, check_passive, ssl_key, check_path, id, check_timeout, algorithm, nodes].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 297

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if !@check_attempts.nil? && @check_attempts > 30
    invalid_properties.push('invalid value for "check_attempts", must be smaller than or equal to 30.')
  end

  if !@check_attempts.nil? && @check_attempts < 1
    invalid_properties.push('invalid value for "check_attempts", must be greater than or equal to 1.')
  end

  if !@port.nil? && @port > 65535
    invalid_properties.push('invalid value for "port", must be smaller than or equal to 65535.')
  end

  if !@port.nil? && @port < 1
    invalid_properties.push('invalid value for "port", must be greater than or equal to 1.')
  end

  pattern = Regexp.new(/^[a-zA-Z0-9\/\-%?&=.]*$/)
  if !@check_path.nil? && @check_path !~ pattern
    invalid_properties.push("invalid value for \"check_path\", must conform to the pattern #{pattern}.")
  end

  if !@check_timeout.nil? && @check_timeout > 30
    invalid_properties.push('invalid value for "check_timeout", must be smaller than or equal to 30.')
  end

  if !@check_timeout.nil? && @check_timeout < 1
    invalid_properties.push('invalid value for "check_timeout", must be greater than or equal to 1.')
  end

  if @nodes.nil?
    invalid_properties.push('invalid value for "nodes", nodes cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



606
607
608
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 606

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



612
613
614
615
616
617
618
619
620
621
622
623
624
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 612

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



600
601
602
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 600

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/linode_openapi_client/models/post_rebuild_node_balancer_config_request.rb', line 338

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  proxy_protocol_validator = EnumAttributeValidator.new('String', ["none", "v1", "v2"])
  return false unless proxy_protocol_validator.valid?(@proxy_protocol)
  check_validator = EnumAttributeValidator.new('String', ["none", "connection", "http", "http_body"])
  return false unless check_validator.valid?(@check)
  return false if !@check_attempts.nil? && @check_attempts > 30
  return false if !@check_attempts.nil? && @check_attempts < 1
  return false if !@port.nil? && @port > 65535
  return false if !@port.nil? && @port < 1
  protocol_validator = EnumAttributeValidator.new('String', ["http", "https", "tcp"])
  return false unless protocol_validator.valid?(@protocol)
  cipher_suite_validator = EnumAttributeValidator.new('String', ["recommended", "legacy"])
  return false unless cipher_suite_validator.valid?(@cipher_suite)
  stickiness_validator = EnumAttributeValidator.new('String', ["none", "table", "http_cookie"])
  return false unless stickiness_validator.valid?(@stickiness)
  return false if !@check_path.nil? && @check_path !~ Regexp.new(/^[a-zA-Z0-9\/\-%?&=.]*$/)
  return false if !@check_timeout.nil? && @check_timeout > 30
  return false if !@check_timeout.nil? && @check_timeout < 1
  algorithm_validator = EnumAttributeValidator.new('String', ["roundrobin", "leastconn", "source"])
  return false unless algorithm_validator.valid?(@algorithm)
  return false if @nodes.nil?
  true
end