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
-
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
-
#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(gateway_filter: nil, id: nil, name: nil, state: nil, tags: nil) ⇒ Relay
constructor
A new instance of Relay.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(gateway_filter: nil, id: nil, name: nil, state: nil, tags: nil) ⇒ Relay
Returns a new instance of Relay.
4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 |
# File 'lib/models/porcelain.rb', line 4627 def initialize( gateway_filter: nil, id: nil, name: nil, state: nil, tags: nil ) @gateway_filter = gateway_filter == nil ? "" : gateway_filter @id = id == nil ? "" : id @name = name == nil ? "" : name @state = state == nil ? "" : state @tags = == nil ? SDM::() : end |
Instance Attribute Details
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
4615 4616 4617 |
# File 'lib/models/porcelain.rb', line 4615 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Relay.
4617 4618 4619 |
# File 'lib/models/porcelain.rb', line 4617 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.
4619 4620 4621 |
# File 'lib/models/porcelain.rb', line 4619 def name @name end |
#state ⇒ Object
The current state of the relay. One of: "new", "verifying_restart", "awaiting_restart", "restarting", "started", "stopped", "dead", "unknown".
4623 4624 4625 |
# File 'lib/models/porcelain.rb', line 4623 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
4625 4626 4627 |
# File 'lib/models/porcelain.rb', line 4625 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
4641 4642 4643 4644 4645 4646 4647 |
# File 'lib/models/porcelain.rb', line 4641 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 |