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.
6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 |
# File 'lib/models/porcelain.rb', line 6526 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.
6505 6506 6507 |
# File 'lib/models/porcelain.rb', line 6505 def device @device end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
6508 6509 6510 |
# File 'lib/models/porcelain.rb', line 6508 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Relay.
6510 6511 6512 |
# File 'lib/models/porcelain.rb', line 6510 def id @id end |
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
6513 6514 6515 |
# File 'lib/models/porcelain.rb', line 6513 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.
6515 6516 6517 |
# File 'lib/models/porcelain.rb', line 6515 def name @name end |
#state ⇒ Object
The current state of the relay. One of: "new", "verifying_restart", "awaiting_restart", "restarting", "started", "stopped", "dead", "unknown".
6519 6520 6521 |
# File 'lib/models/porcelain.rb', line 6519 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
6521 6522 6523 |
# File 'lib/models/porcelain.rb', line 6521 def @tags end |
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
6524 6525 6526 |
# File 'lib/models/porcelain.rb', line 6524 def version @version end |
Instance Method Details
#to_json(options = {}) ⇒ Object
6546 6547 6548 6549 6550 6551 6552 |
# File 'lib/models/porcelain.rb', line 6546 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 |