Class: OCI::LoadBalancer::Models::HealthCheckResult
- Inherits:
-
Object
- Object
- OCI::LoadBalancer::Models::HealthCheckResult
- Defined in:
- lib/oci/load_balancer/models/health_check_result.rb
Overview
Information about a single backend server health check result reported by a load balancer.
Constant Summary collapse
- HEALTH_CHECK_STATUS_ENUM =
[ HEALTH_CHECK_STATUS_OK = 'OK'.freeze, HEALTH_CHECK_STATUS_INVALID_STATUS_CODE = 'INVALID_STATUS_CODE'.freeze, HEALTH_CHECK_STATUS_TIMED_OUT = 'TIMED_OUT'.freeze, HEALTH_CHECK_STATUS_REGEX_MISMATCH = 'REGEX_MISMATCH'.freeze, HEALTH_CHECK_STATUS_CONNECT_FAILED = 'CONNECT_FAILED'.freeze, HEALTH_CHECK_STATUS_IO_ERROR = 'IO_ERROR'.freeze, HEALTH_CHECK_STATUS_OFFLINE = 'OFFLINE'.freeze, HEALTH_CHECK_STATUS_UNKNOWN = 'UNKNOWN'.freeze, HEALTH_CHECK_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#health_check_status ⇒ String
[Required] The result of the most recent health check.
-
#source_ip_address ⇒ String
[Required] The IP address of the health check status report provider.
-
#subnet_id ⇒ String
[Required] The OCID of the subnet hosting the load balancer that reported this health check status.
-
#timestamp ⇒ DateTime
[Required] The date and time the data was retrieved, in the format defined by RFC3339.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ HealthCheckResult
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ HealthCheckResult
Initializes the object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 84 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.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId'] raise 'You cannot provide both :subnetId and :subnet_id' if attributes.key?(:'subnetId') && attributes.key?(:'subnet_id') self.subnet_id = attributes[:'subnet_id'] if attributes[:'subnet_id'] self.source_ip_address = attributes[:'sourceIpAddress'] if attributes[:'sourceIpAddress'] raise 'You cannot provide both :sourceIpAddress and :source_ip_address' if attributes.key?(:'sourceIpAddress') && attributes.key?(:'source_ip_address') self.source_ip_address = attributes[:'source_ip_address'] if attributes[:'source_ip_address'] self. = attributes[:'timestamp'] if attributes[:'timestamp'] self.health_check_status = attributes[:'healthCheckStatus'] if attributes[:'healthCheckStatus'] raise 'You cannot provide both :healthCheckStatus and :health_check_status' if attributes.key?(:'healthCheckStatus') && attributes.key?(:'health_check_status') self.health_check_status = attributes[:'health_check_status'] if attributes[:'health_check_status'] end |
Instance Attribute Details
#health_check_status ⇒ String
[Required] The result of the most recent health check.
48 49 50 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 48 def health_check_status @health_check_status end |
#source_ip_address ⇒ String
[Required] The IP address of the health check status report provider. This identifier helps you differentiate same-subnet load balancers that report health check status.
Example: 10.0.0.7
36 37 38 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 36 def source_ip_address @source_ip_address end |
#subnet_id ⇒ String
[Required] The OCID of the subnet hosting the load balancer that reported this health check status.
28 29 30 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 28 def subnet_id @subnet_id end |
#timestamp ⇒ DateTime
[Required] The date and time the data was retrieved, in the format defined by RFC3339.
Example: 2017-06-02T18:28:11+00:00
43 44 45 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 43 def @timestamp end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 51 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'subnet_id': :'subnetId', 'source_ip_address': :'sourceIpAddress', 'timestamp': :'timestamp', 'health_check_status': :'healthCheckStatus' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 63 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'subnet_id': :'String', 'source_ip_address': :'String', 'timestamp': :'DateTime', 'health_check_status': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
131 132 133 134 135 136 137 138 139 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 131 def ==(other) return true if equal?(other) self.class == other.class && subnet_id == other.subnet_id && source_ip_address == other.source_ip_address && == other. && health_check_status == other.health_check_status end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 164 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
144 145 146 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 144 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
153 154 155 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 153 def hash [subnet_id, source_ip_address, , health_check_status].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
197 198 199 200 201 202 203 204 205 206 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 197 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_s ⇒ String
Returns the string representation of the object
191 192 193 |
# File 'lib/oci/load_balancer/models/health_check_result.rb', line 191 def to_s to_hash.to_s end |