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
-
#device ⇒ Object
Device is a read only device name uploaded by the gateway process when it comes online.
-
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
-
#id ⇒ Object
Unique identifier of the Relay.
-
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
-
#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.
-
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
Instance Method Summary collapse
-
#initialize(device: nil, gateway_filter: nil, id: nil, location: nil, name: nil, state: nil, tags: nil, version: nil) ⇒ Relay
constructor
A new instance of Relay.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(device: nil, gateway_filter: nil, id: nil, location: nil, name: nil, state: nil, tags: nil, version: nil) ⇒ Relay
Returns a new instance of Relay.
6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 |
# File 'lib/models/porcelain.rb', line 6635 def initialize( device: nil, gateway_filter: nil, id: nil, location: nil, name: nil, state: nil, tags: nil, version: nil ) @device = device == nil ? "" : device @gateway_filter = gateway_filter == nil ? "" : gateway_filter @id = id == nil ? "" : id @location = location == nil ? "" : location @name = name == nil ? "" : name @state = state == nil ? "" : state @tags = == nil ? SDM::() : @version = version == nil ? "" : version end |
Instance Attribute Details
#device ⇒ Object
Device is a read only device name uploaded by the gateway process when it comes online.
6614 6615 6616 |
# File 'lib/models/porcelain.rb', line 6614 def device @device end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
6617 6618 6619 |
# File 'lib/models/porcelain.rb', line 6617 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Relay.
6619 6620 6621 |
# File 'lib/models/porcelain.rb', line 6619 def id @id end |
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
6622 6623 6624 |
# File 'lib/models/porcelain.rb', line 6622 def location @location 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.
6624 6625 6626 |
# File 'lib/models/porcelain.rb', line 6624 def name @name end |
#state ⇒ Object
The current state of the relay. One of: "new", "verifying_restart", "awaiting_restart", "restarting", "started", "stopped", "dead", "unknown".
6628 6629 6630 |
# File 'lib/models/porcelain.rb', line 6628 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
6630 6631 6632 |
# File 'lib/models/porcelain.rb', line 6630 def @tags end |
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
6633 6634 6635 |
# File 'lib/models/porcelain.rb', line 6633 def version @version end |
Instance Method Details
#to_json(options = {}) ⇒ Object
6655 6656 6657 6658 6659 6660 6661 |
# File 'lib/models/porcelain.rb', line 6655 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 |