Class: SDM::Relay

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

Relay represents a StrongDM CLI installation running in relay mode.

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
  @version = version == nil ? "" : version
end

Instance Attribute Details

#connects_toObject

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

#deviceObject

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_filterObject

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

#idObject

Unique identifier of the Relay.



6800
6801
6802
# File 'lib/models/porcelain.rb', line 6800

def id
  @id
end

#locationObject

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

#nameObject

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

#stateObject

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

#tagsObject

Tags is a map of key, value pairs.



6811
6812
6813
# File 'lib/models/porcelain.rb', line 6811

def tags
  @tags
end

#versionObject

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(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end