Class: SDM::Relay
- Inherits:
-
Object
- Object
- SDM::Relay
- Defined in:
- lib/models/porcelain.rb
Overview
Relay represents a StrongDM CLI installation running in relay mode.
Instance Attribute Summary collapse
-
#id ⇒ Object
Unique identifier of the Relay.
-
#name ⇒ Object
Unique human-readable name of the Relay.
-
#state ⇒ Object
The current state of the relay.
-
#tags ⇒ Object
Tags is a map of key, value pairs.
Instance Method Summary collapse
-
#initialize(id: nil, name: nil, state: nil, tags: nil) ⇒ Relay
constructor
A new instance of Relay.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(id: nil, name: nil, state: nil, tags: nil) ⇒ Relay
Returns a new instance of Relay.
4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 |
# File 'lib/models/porcelain.rb', line 4750 def initialize( id: nil, name: nil, state: nil, tags: nil ) if id != nil @id = id end if name != nil @name = name end if state != nil @state = state end if != nil @tags = end end |
Instance Attribute Details
#id ⇒ Object
Unique identifier of the Relay.
4740 4741 4742 |
# File 'lib/models/porcelain.rb', line 4740 def id @id end |
#name ⇒ Object
Unique human-readable name of the Relay. Node names must include only letters, numbers, and hyphens (no spaces, underscores, or other special characters). Generated if not provided on create.
4742 4743 4744 |
# File 'lib/models/porcelain.rb', line 4742 def name @name end |
#state ⇒ Object
The current state of the relay. One of: “new”, “verifying_restart”, “awaiting_restart”, “restarting”, “started”, “stopped”, “dead”, “unknown”.
4746 4747 4748 |
# File 'lib/models/porcelain.rb', line 4746 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
4748 4749 4750 |
# File 'lib/models/porcelain.rb', line 4748 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
4770 4771 4772 4773 4774 4775 4776 |
# File 'lib/models/porcelain.rb', line 4770 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 |