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.
7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 |
# File 'lib/models/porcelain.rb', line 7992 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
7976 7977 7978 |
# File 'lib/models/porcelain.rb', line 7976 def error_msg @error_msg end |
#healthy ⇒ Object
Whether the healthcheck succeeded.
7978 7979 7980 |
# File 'lib/models/porcelain.rb', line 7978 def healthy @healthy end |
#id ⇒ Object
Unique identifier of the healthcheck.
7980 7981 7982 |
# File 'lib/models/porcelain.rb', line 7980 def id @id end |
#node_id ⇒ Object
Unique identifier of the healthcheck node.
7982 7983 7984 |
# File 'lib/models/porcelain.rb', line 7982 def node_id @node_id end |
#node_name ⇒ Object
The name of the node.
7984 7985 7986 |
# File 'lib/models/porcelain.rb', line 7984 def node_name @node_name end |
#resource_id ⇒ Object
Unique identifier of the healthcheck resource.
7986 7987 7988 |
# File 'lib/models/porcelain.rb', line 7986 def resource_id @resource_id end |
#resource_name ⇒ Object
The name of the resource.
7988 7989 7990 |
# File 'lib/models/porcelain.rb', line 7988 def resource_name @resource_name end |
#timestamp ⇒ Object
The time at which the healthcheck state was recorded.
7990 7991 7992 |
# File 'lib/models/porcelain.rb', line 7990 def @timestamp end |
Instance Method Details
#to_json(options = {}) ⇒ Object
8012 8013 8014 8015 8016 8017 8018 |
# File 'lib/models/porcelain.rb', line 8012 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 |