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.
5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 |
# File 'lib/models/porcelain.rb', line 5475 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.
5454 5455 5456 |
# File 'lib/models/porcelain.rb', line 5454 def device @device end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
5457 5458 5459 |
# File 'lib/models/porcelain.rb', line 5457 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Relay.
5459 5460 5461 |
# File 'lib/models/porcelain.rb', line 5459 def id @id end |
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
5462 5463 5464 |
# File 'lib/models/porcelain.rb', line 5462 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.
5464 5465 5466 |
# File 'lib/models/porcelain.rb', line 5464 def name @name end |
#state ⇒ Object
The current state of the relay. One of: "new", "verifying_restart", "awaiting_restart", "restarting", "started", "stopped", "dead", "unknown".
5468 5469 5470 |
# File 'lib/models/porcelain.rb', line 5468 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
5470 5471 5472 |
# File 'lib/models/porcelain.rb', line 5470 def @tags end |
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
5473 5474 5475 |
# File 'lib/models/porcelain.rb', line 5473 def version @version end |
Instance Method Details
#to_json(options = {}) ⇒ Object
5495 5496 5497 5498 5499 5500 5501 |
# File 'lib/models/porcelain.rb', line 5495 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 |