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.



13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
# File 'lib/models/porcelain.rb', line 13890

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



13874
13875
13876
# File 'lib/models/porcelain.rb', line 13874

def changed_at
  @changed_at
end

#checked_atObject

The time when the status was last checked by the node



13876
13877
13878
# File 'lib/models/porcelain.rb', line 13876

def checked_at
  @checked_at
end

#errorObject

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



13878
13879
13880
# File 'lib/models/porcelain.rb', line 13878

def error
  @error
end

#flagsObject

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



13880
13881
13882
# File 'lib/models/porcelain.rb', line 13880

def flags
  @flags
end

#node_idObject

Associated node id for this health



13882
13883
13884
# File 'lib/models/porcelain.rb', line 13882

def node_id
  @node_id
end

#reachabilityObject

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



13884
13885
13886
# File 'lib/models/porcelain.rb', line 13884

def reachability
  @reachability
end

#secret_store_idObject

Associated secret store for this health



13886
13887
13888
# File 'lib/models/porcelain.rb', line 13886

def secret_store_id
  @secret_store_id
end

#statusObject

The status of the link between the node and secret store



13888
13889
13890
# File 'lib/models/porcelain.rb', line 13888

def status
  @status
end

Instance Method Details

#to_json(options = {}) ⇒ Object



13910
13911
13912
13913
13914
13915
13916
# File 'lib/models/porcelain.rb', line 13910

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