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(gateway_filter: nil, id: nil, name: nil, state: nil, tags: nil) ⇒ Relay

Returns a new instance of Relay.



4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
# File 'lib/models/porcelain.rb', line 4901

def initialize(
  gateway_filter: nil,
  id: nil,
  name: nil,
  state: nil,
  tags: nil
)
  @gateway_filter = gateway_filter == nil ? "" : gateway_filter
  @id = id == nil ? "" : id
  @name = name == nil ? "" : name
  @state = state == nil ? "" : state
  @tags = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
end

Instance Attribute Details

#gateway_filterObject

GatewayFilter can be used to restrict the peering between relays and gateways.



4889
4890
4891
# File 'lib/models/porcelain.rb', line 4889

def gateway_filter
  @gateway_filter
end

#idObject

Unique identifier of the Relay.



4891
4892
4893
# File 'lib/models/porcelain.rb', line 4891

def id
  @id
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.



4893
4894
4895
# File 'lib/models/porcelain.rb', line 4893

def name
  @name
end

#stateObject

The current state of the relay. One of: "new", "verifying_restart", "awaiting_restart", "restarting", "started", "stopped", "dead", "unknown".



4897
4898
4899
# File 'lib/models/porcelain.rb', line 4897

def state
  @state
end

#tagsObject

Tags is a map of key, value pairs.



4899
4900
4901
# File 'lib/models/porcelain.rb', line 4899

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



4915
4916
4917
4918
4919
4920
4921
# File 'lib/models/porcelain.rb', line 4915

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