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
-
#id ⇒ Object
Unique identifier of the Relay.
-
#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.
Instance Method Summary collapse
-
#initialize(id: nil, name: nil, state: nil, tags: nil) ⇒ Relay
constructor
A new instance of Relay.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(id: nil, name: nil, state: nil, tags: nil) ⇒ Relay
Returns a new instance of Relay.
4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 |
# File 'lib/models/porcelain.rb', line 4359 def initialize( id: nil, name: nil, state: nil, tags: nil ) if id != nil @id = id end if name != nil @name = name end if state != nil @state = state end if != nil @tags = end end |
Instance Attribute Details
#id ⇒ Object
Unique identifier of the Relay.
4349 4350 4351 |
# File 'lib/models/porcelain.rb', line 4349 def id @id end |
#name ⇒ Object
Unique human-readable name of the Relay. Generated if not provided on create.
4351 4352 4353 |
# File 'lib/models/porcelain.rb', line 4351 def name @name end |
#state ⇒ Object
The current state of the relay. One of: “new”, “verifying_restart”, “awaiting_restart”, “restarting”, “started”, “stopped”, “dead”, “unknown”.
4355 4356 4357 |
# File 'lib/models/porcelain.rb', line 4355 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
4357 4358 4359 |
# File 'lib/models/porcelain.rb', line 4357 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
4379 4380 4381 4382 4383 4384 4385 |
# File 'lib/models/porcelain.rb', line 4379 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 |