Class: SDM::Healthcheck
- Inherits:
-
Object
- Object
- SDM::Healthcheck
- Defined in:
- lib/models/porcelain.rb
Overview
Healthcheck defines the status of the link between a node and a resource
Instance Attribute Summary collapse
-
#error_msg ⇒ Object
The error if unhealthy.
-
#healthy ⇒ Object
Whether the healthcheck succeeded.
-
#id ⇒ Object
Unique identifier of the healthcheck.
-
#node_id ⇒ Object
Unique identifier of the healthcheck node.
-
#node_name ⇒ Object
The name of the node.
-
#resource_id ⇒ Object
Unique identifier of the healthcheck resource.
-
#resource_name ⇒ Object
The name of the resource.
-
#timestamp ⇒ Object
The time at which the healthcheck state was recorded.
Instance Method Summary collapse
-
#initialize(error_msg: nil, healthy: nil, id: nil, node_id: nil, node_name: nil, resource_id: nil, resource_name: nil, timestamp: nil) ⇒ Healthcheck
constructor
A new instance of Healthcheck.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(error_msg: nil, healthy: nil, id: nil, node_id: nil, node_name: nil, resource_id: nil, resource_name: nil, timestamp: nil) ⇒ Healthcheck
Returns a new instance of Healthcheck.
9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 |
# File 'lib/models/porcelain.rb', line 9296 def initialize( error_msg: nil, healthy: nil, id: nil, node_id: nil, node_name: nil, resource_id: nil, resource_name: nil, timestamp: nil ) @error_msg = error_msg == nil ? "" : error_msg @healthy = healthy == nil ? false : healthy @id = id == nil ? "" : id @node_id = node_id == nil ? "" : node_id @node_name = node_name == nil ? "" : node_name @resource_id = resource_id == nil ? "" : resource_id @resource_name = resource_name == nil ? "" : resource_name @timestamp = == nil ? nil : end |
Instance Attribute Details
#error_msg ⇒ Object
The error if unhealthy
9280 9281 9282 |
# File 'lib/models/porcelain.rb', line 9280 def error_msg @error_msg end |
#healthy ⇒ Object
Whether the healthcheck succeeded.
9282 9283 9284 |
# File 'lib/models/porcelain.rb', line 9282 def healthy @healthy end |
#id ⇒ Object
Unique identifier of the healthcheck.
9284 9285 9286 |
# File 'lib/models/porcelain.rb', line 9284 def id @id end |
#node_id ⇒ Object
Unique identifier of the healthcheck node.
9286 9287 9288 |
# File 'lib/models/porcelain.rb', line 9286 def node_id @node_id end |
#node_name ⇒ Object
The name of the node.
9288 9289 9290 |
# File 'lib/models/porcelain.rb', line 9288 def node_name @node_name end |
#resource_id ⇒ Object
Unique identifier of the healthcheck resource.
9290 9291 9292 |
# File 'lib/models/porcelain.rb', line 9290 def resource_id @resource_id end |
#resource_name ⇒ Object
The name of the resource.
9292 9293 9294 |
# File 'lib/models/porcelain.rb', line 9292 def resource_name @resource_name end |
#timestamp ⇒ Object
The time at which the healthcheck state was recorded.
9294 9295 9296 |
# File 'lib/models/porcelain.rb', line 9294 def @timestamp end |
Instance Method Details
#to_json(options = {}) ⇒ Object
9316 9317 9318 9319 9320 9321 9322 |
# File 'lib/models/porcelain.rb', line 9316 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |