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.
6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 |
# File 'lib/models/porcelain.rb', line 6579 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.
6558 6559 6560 |
# File 'lib/models/porcelain.rb', line 6558 def device @device end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
6561 6562 6563 |
# File 'lib/models/porcelain.rb', line 6561 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Relay.
6563 6564 6565 |
# File 'lib/models/porcelain.rb', line 6563 def id @id end |
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
6566 6567 6568 |
# File 'lib/models/porcelain.rb', line 6566 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.
6568 6569 6570 |
# File 'lib/models/porcelain.rb', line 6568 def name @name end |
#state ⇒ Object
The current state of the relay. One of: "new", "verifying_restart", "awaiting_restart", "restarting", "started", "stopped", "dead", "unknown".
6572 6573 6574 |
# File 'lib/models/porcelain.rb', line 6572 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
6574 6575 6576 |
# File 'lib/models/porcelain.rb', line 6574 def @tags end |
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
6577 6578 6579 |
# File 'lib/models/porcelain.rb', line 6577 def version @version end |
Instance Method Details
#to_json(options = {}) ⇒ Object
6599 6600 6601 6602 6603 6604 6605 |
# File 'lib/models/porcelain.rb', line 6599 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 |