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
-
#connects_to ⇒ Object
ConnectsTo can be used to restrict the peering between relays and gateways.
-
#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(connects_to: nil, 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(connects_to: nil, device: nil, gateway_filter: nil, id: nil, location: nil, name: nil, state: nil, tags: nil, version: nil) ⇒ Relay
Returns a new instance of Relay.
6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 |
# File 'lib/models/porcelain.rb', line 6816 def initialize( connects_to: nil, device: nil, gateway_filter: nil, id: nil, location: nil, name: nil, state: nil, tags: nil, version: nil ) @connects_to = connects_to == nil ? "" : connects_to @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
#connects_to ⇒ Object
ConnectsTo can be used to restrict the peering between relays and gateways.
6792 6793 6794 |
# File 'lib/models/porcelain.rb', line 6792 def connects_to @connects_to end |
#device ⇒ Object
Device is a read only device name uploaded by the gateway process when it comes online.
6795 6796 6797 |
# File 'lib/models/porcelain.rb', line 6795 def device @device end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways. Deprecated.
6798 6799 6800 |
# File 'lib/models/porcelain.rb', line 6798 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Relay.
6800 6801 6802 |
# File 'lib/models/porcelain.rb', line 6800 def id @id end |
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
6803 6804 6805 |
# File 'lib/models/porcelain.rb', line 6803 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.
6805 6806 6807 |
# File 'lib/models/porcelain.rb', line 6805 def name @name end |
#state ⇒ Object
The current state of the relay. One of: "new", "verifying_restart", "awaiting_restart", "restarting", "started", "stopped", "dead", "unknown".
6809 6810 6811 |
# File 'lib/models/porcelain.rb', line 6809 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
6811 6812 6813 |
# File 'lib/models/porcelain.rb', line 6811 def @tags end |
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
6814 6815 6816 |
# File 'lib/models/porcelain.rb', line 6814 def version @version end |
Instance Method Details
#to_json(options = {}) ⇒ Object
6838 6839 6840 6841 6842 6843 6844 |
# File 'lib/models/porcelain.rb', line 6838 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 |