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.
7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 |
# File 'lib/models/porcelain.rb', line 7131 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
7115 7116 7117 |
# File 'lib/models/porcelain.rb', line 7115 def error_msg @error_msg end |
#healthy ⇒ Object
Whether the healthcheck succeeded.
7117 7118 7119 |
# File 'lib/models/porcelain.rb', line 7117 def healthy @healthy end |
#id ⇒ Object
Unique identifier of the healthcheck.
7119 7120 7121 |
# File 'lib/models/porcelain.rb', line 7119 def id @id end |
#node_id ⇒ Object
Unique identifier of the healthcheck node.
7121 7122 7123 |
# File 'lib/models/porcelain.rb', line 7121 def node_id @node_id end |
#node_name ⇒ Object
The name of the node.
7123 7124 7125 |
# File 'lib/models/porcelain.rb', line 7123 def node_name @node_name end |
#resource_id ⇒ Object
Unique identifier of the healthcheck resource.
7125 7126 7127 |
# File 'lib/models/porcelain.rb', line 7125 def resource_id @resource_id end |
#resource_name ⇒ Object
The name of the resource.
7127 7128 7129 |
# File 'lib/models/porcelain.rb', line 7127 def resource_name @resource_name end |
#timestamp ⇒ Object
The time at which the healthcheck state was recorded.
7129 7130 7131 |
# File 'lib/models/porcelain.rb', line 7129 def @timestamp end |
Instance Method Details
#to_json(options = {}) ⇒ Object
7151 7152 7153 7154 7155 7156 7157 |
# File 'lib/models/porcelain.rb', line 7151 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 |