Class: SDM::SecretStoreHealth

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

SecretStoreHealth denotes a secret store's health status. Note a secret store is not healthy in terms of a simple boolean, but rather healthy with respect to a particular node or set of nodes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(changed_at: nil, checked_at: nil, error: nil, flags: nil, node_id: nil, reachability: nil, secret_store_id: nil, status: nil) ⇒ SecretStoreHealth

Returns a new instance of SecretStoreHealth.



17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
# File 'lib/models/porcelain.rb', line 17105

def initialize(
  changed_at: nil,
  checked_at: nil,
  error: nil,
  flags: nil,
  node_id: nil,
  reachability: nil,
  secret_store_id: nil,
  status: nil
)
  @changed_at = changed_at == nil ? nil : changed_at
  @checked_at = checked_at == nil ? nil : checked_at
  @error = error == nil ? "" : error
  @flags = flags == nil ? [] : flags
  @node_id = node_id == nil ? "" : node_id
  @reachability = reachability == nil ? "" : reachability
  @secret_store_id = secret_store_id == nil ? "" : secret_store_id
  @status = status == nil ? "" : status
end

Instance Attribute Details

#changed_atObject

The time when the status last changed



17089
17090
17091
# File 'lib/models/porcelain.rb', line 17089

def changed_at
  @changed_at
end

#checked_atObject

The time when the status was last checked by the node



17091
17092
17093
# File 'lib/models/porcelain.rb', line 17091

def checked_at
  @checked_at
end

#errorObject

The error associated with this health check, if it occurred after reachability checks succeeded.



17093
17094
17095
# File 'lib/models/porcelain.rb', line 17093

def error
  @error
end

#flagsObject

Any specific status or error flags associated with this health check.



17095
17096
17097
# File 'lib/models/porcelain.rb', line 17095

def flags
  @flags
end

#node_idObject

Associated node id for this health



17097
17098
17099
# File 'lib/models/porcelain.rb', line 17097

def node_id
  @node_id
end

#reachabilityObject

The error associated with this health check, if it occurred during reachability checks.



17099
17100
17101
# File 'lib/models/porcelain.rb', line 17099

def reachability
  @reachability
end

#secret_store_idObject

Associated secret store for this health



17101
17102
17103
# File 'lib/models/porcelain.rb', line 17101

def secret_store_id
  @secret_store_id
end

#statusObject

The status of the link between the node and secret store



17103
17104
17105
# File 'lib/models/porcelain.rb', line 17103

def status
  @status
end

Instance Method Details

#to_json(options = {}) ⇒ Object



17125
17126
17127
17128
17129
17130
17131
# File 'lib/models/porcelain.rb', line 17125

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end