Class: LinodeOpenapiClient::PostNodeBalancerConfigRequest
- Inherits:
-
Object
- Object
- LinodeOpenapiClient::PostNodeBalancerConfigRequest
- Defined in:
- lib/linode_openapi_client/models/post_node_balancer_config_request.rb
Overview
A NodeBalancer config represents the configuration of this NodeBalancer on a single port. For example, a NodeBalancer Config on port 80 would typically represent how this NodeBalancer response to HTTP requests. NodeBalancer configs have a list of backends, called "nodes," that they forward requests between based on their configuration.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
What algorithm this NodeBalancer should use for routing traffic to backends.
-
#check ⇒ Object
The type of check to perform against backends to ensure they are serving requests.
-
#check_attempts ⇒ Object
How many times to attempt a check before considering a backend to be down.
-
#check_body ⇒ Object
This value must be present in the response body of the check in order for it to pass.
-
#check_interval ⇒ Object
How often, in seconds, to check that backends are up and serving requests.
-
#check_passive ⇒ Object
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.
-
#check_path ⇒ Object
The URL path to check on each backend.
-
#check_timeout ⇒ Object
How long, in seconds, to wait for a check attempt before considering it failed.
-
#cipher_suite ⇒ Object
What ciphers to use for SSL connections served by this NodeBalancer.
-
#id ⇒ Object
Read-only This config’s unique ID.
-
#nodebalancer_id ⇒ Object
Read-only The ID for the NodeBalancer this config belongs to.
-
#nodes_status ⇒ Object
Returns the value of attribute nodes_status.
-
#port ⇒ Object
The port this Config is for.
-
#protocol ⇒ Object
The protocol this port is configured to serve.
-
#proxy_protocol ⇒ Object
ProxyProtocol is a TCP extension that sends initial TCP connection information such as source/destination IPs and ports to backend devices.
-
#ssl_cert ⇒ Object
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.
-
#ssl_commonname ⇒ Object
Read-only The read-only common name automatically derived from the SSL certificate assigned to this NodeBalancerConfig.
-
#ssl_fingerprint ⇒ Object
Read-only The read-only SHA1-encoded fingerprint automatically derived from the SSL certificate assigned to this NodeBalancerConfig.
-
#ssl_key ⇒ Object
The PEM-formatted private key for the SSL certificate set in the ‘ssl_cert` field.
-
#stickiness ⇒ Object
Controls how session stickiness is handled on this port.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PostNodeBalancerConfigRequest
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ PostNodeBalancerConfigRequest
Initializes the object
167 168 169 170 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 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 167 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `LinodeOpenapiClient::PostNodeBalancerConfigRequest` 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::PostNodeBalancerConfigRequest`. 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_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?(:'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?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'check_path') self.check_path = attributes[:'check_path'] end if attributes.key?(:'cipher_suite') self.cipher_suite = attributes[:'cipher_suite'] else self.cipher_suite = 'recommended' end if attributes.key?(:'check_body') self.check_body = attributes[:'check_body'] end if attributes.key?(:'stickiness') self.stickiness = attributes[:'stickiness'] else self.stickiness = 'none' end if attributes.key?(:'protocol') self.protocol = attributes[:'protocol'] else self.protocol = 'http' end if attributes.key?(:'nodes_status') self.nodes_status = attributes[:'nodes_status'] 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?(:'ssl_fingerprint') self.ssl_fingerprint = attributes[:'ssl_fingerprint'] 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?(:'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?(:'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 end |
Instance Attribute Details
#algorithm ⇒ Object
What algorithm this NodeBalancer should use for routing traffic to backends.
23 24 25 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 23 def algorithm @algorithm end |
#check ⇒ Object
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.
67 68 69 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 67 def check @check end |
#check_attempts ⇒ Object
How many times to attempt a check before considering a backend to be down.
52 53 54 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 52 def check_attempts @check_attempts end |
#check_body ⇒ Object
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.
41 42 43 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 41 def check_body @check_body end |
#check_interval ⇒ Object
How often, in seconds, to check that backends are up and serving requests. Must be greater than ‘check_timeout`.
73 74 75 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 73 def check_interval @check_interval end |
#check_passive ⇒ Object
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.
26 27 28 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 26 def check_passive @check_passive end |
#check_path ⇒ Object
The URL path to check on each backend. If the backend does not respond to this request it is considered to be down.
35 36 37 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 35 def check_path @check_path end |
#check_timeout ⇒ Object
How long, in seconds, to wait for a check attempt before considering it failed. Must be less than ‘check_interval`.
20 21 22 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 20 def check_timeout @check_timeout end |
#cipher_suite ⇒ Object
What ciphers to use for SSL connections served by this NodeBalancer. - ‘legacy` is considered insecure and should only be used if necessary.
38 39 40 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 38 def cipher_suite @cipher_suite end |
#id ⇒ Object
Read-only This config’s unique ID.
32 33 34 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 32 def id @id end |
#nodebalancer_id ⇒ Object
Read-only The ID for the NodeBalancer this config belongs to.
61 62 63 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 61 def nodebalancer_id @nodebalancer_id end |
#nodes_status ⇒ Object
Returns the value of attribute nodes_status.
49 50 51 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 49 def nodes_status @nodes_status end |
#port ⇒ Object
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.
55 56 57 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 55 def port @port end |
#protocol ⇒ Object
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.
47 48 49 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 47 def protocol @protocol end |
#proxy_protocol ⇒ Object
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.
76 77 78 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 76 def proxy_protocol @proxy_protocol end |
#ssl_cert ⇒ Object
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.
64 65 66 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 64 def ssl_cert @ssl_cert end |
#ssl_commonname ⇒ Object
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.
70 71 72 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 70 def ssl_commonname @ssl_commonname end |
#ssl_fingerprint ⇒ Object
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.
58 59 60 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 58 def ssl_fingerprint @ssl_fingerprint end |
#ssl_key ⇒ Object
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.
29 30 31 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 29 def ssl_key @ssl_key end |
#stickiness ⇒ Object
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.
44 45 46 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 44 def stickiness @stickiness end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 541 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_attributes ⇒ Object
Returns all the JSON keys this model knows about
127 128 129 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 127 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 101 def self.attribute_map { :'check_timeout' => :'check_timeout', :'algorithm' => :'algorithm', :'check_passive' => :'check_passive', :'ssl_key' => :'ssl_key', :'id' => :'id', :'check_path' => :'check_path', :'cipher_suite' => :'cipher_suite', :'check_body' => :'check_body', :'stickiness' => :'stickiness', :'protocol' => :'protocol', :'nodes_status' => :'nodes_status', :'check_attempts' => :'check_attempts', :'port' => :'port', :'ssl_fingerprint' => :'ssl_fingerprint', :'nodebalancer_id' => :'nodebalancer_id', :'ssl_cert' => :'ssl_cert', :'check' => :'check', :'ssl_commonname' => :'ssl_commonname', :'check_interval' => :'check_interval', :'proxy_protocol' => :'proxy_protocol' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 517 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_nullable ⇒ Object
List of attributes with nullable: true
158 159 160 161 162 163 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 158 def self.openapi_nullable Set.new([ :'ssl_key', :'ssl_cert', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 132 def self.openapi_types { :'check_timeout' => :'Integer', :'algorithm' => :'String', :'check_passive' => :'Boolean', :'ssl_key' => :'String', :'id' => :'Integer', :'check_path' => :'String', :'cipher_suite' => :'String', :'check_body' => :'String', :'stickiness' => :'String', :'protocol' => :'String', :'nodes_status' => :'PostNodeBalancerConfigRequestNodesStatus', :'check_attempts' => :'Integer', :'port' => :'Integer', :'ssl_fingerprint' => :'String', :'nodebalancer_id' => :'Integer', :'ssl_cert' => :'String', :'check' => :'String', :'ssl_commonname' => :'String', :'check_interval' => :'Integer', :'proxy_protocol' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 477 def ==(o) return true if self.equal?(o) self.class == o.class && check_timeout == o.check_timeout && algorithm == o.algorithm && check_passive == o.check_passive && ssl_key == o.ssl_key && id == o.id && check_path == o.check_path && cipher_suite == o.cipher_suite && check_body == o.check_body && stickiness == o.stickiness && protocol == o.protocol && nodes_status == o.nodes_status && check_attempts == o.check_attempts && port == o.port && ssl_fingerprint == o.ssl_fingerprint && nodebalancer_id == o.nodebalancer_id && ssl_cert == o.ssl_cert && check == o.check && ssl_commonname == o.ssl_commonname && check_interval == o.check_interval && proxy_protocol == o.proxy_protocol end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
612 613 614 615 616 617 618 619 620 621 622 623 624 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 612 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
504 505 506 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 504 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
510 511 512 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 510 def hash [check_timeout, algorithm, check_passive, ssl_key, id, check_path, cipher_suite, check_body, stickiness, protocol, nodes_status, check_attempts, port, ssl_fingerprint, nodebalancer_id, ssl_cert, check, ssl_commonname, check_interval, proxy_protocol].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 285 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new 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 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_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 invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
588 589 590 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 588 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
594 595 596 597 598 599 600 601 602 603 604 605 606 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 594 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_s ⇒ String
Returns the string representation of the object
582 583 584 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 582 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/linode_openapi_client/models/post_node_balancer_config_request.rb', line 322 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' 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 !@check_path.nil? && @check_path !~ Regexp.new(/^[a-zA-Z0-9\/\-%?&=.]*$/) 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) protocol_validator = EnumAttributeValidator.new('String', ["http", "https", "tcp"]) return false unless protocol_validator.valid?(@protocol) 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 check_validator = EnumAttributeValidator.new('String', ["none", "connection", "http", "http_body"]) return false unless check_validator.valid?(@check) proxy_protocol_validator = EnumAttributeValidator.new('String', ["none", "v1", "v2"]) return false unless proxy_protocol_validator.valid?(@proxy_protocol) true end |