Class: SDM::Gateway

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

Overview

Gateway represents a StrongDM CLI installation running in gateway mode.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bind_address: nil, device: nil, gateway_filter: nil, id: nil, listen_address: nil, location: nil, name: nil, state: nil, tags: nil, version: nil) ⇒ Gateway

Returns a new instance of Gateway.



2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
# File 'lib/models/porcelain.rb', line 2918

def initialize(
  bind_address: nil,
  device: nil,
  gateway_filter: nil,
  id: nil,
  listen_address: nil,
  location: nil,
  name: nil,
  state: nil,
  tags: nil,
  version: nil
)
  @bind_address = bind_address == nil ? "" : bind_address
  @device = device == nil ? "" : device
  @gateway_filter = gateway_filter == nil ? "" : gateway_filter
  @id = id == nil ? "" : id
  @listen_address = listen_address == nil ? "" : listen_address
  @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

#bind_addressObject

The hostname/port tuple which the gateway daemon will bind to. If not provided on create, set to "0.0.0.0:listen_address_port".



2893
2894
2895
# File 'lib/models/porcelain.rb', line 2893

def bind_address
  @bind_address
end

#deviceObject

Device is a read only device name uploaded by the gateway process when it comes online.



2896
2897
2898
# File 'lib/models/porcelain.rb', line 2896

def device
  @device
end

#gateway_filterObject

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



2899
2900
2901
# File 'lib/models/porcelain.rb', line 2899

def gateway_filter
  @gateway_filter
end

#idObject

Unique identifier of the Gateway.



2901
2902
2903
# File 'lib/models/porcelain.rb', line 2901

def id
  @id
end

#listen_addressObject

The public hostname/port tuple at which the gateway will be accessible to clients.



2903
2904
2905
# File 'lib/models/porcelain.rb', line 2903

def listen_address
  @listen_address
end

#locationObject

Location is a read only network location uploaded by the gateway process when it comes online.



2906
2907
2908
# File 'lib/models/porcelain.rb', line 2906

def location
  @location
end

#nameObject

Unique human-readable name of the Gateway. Node names must include only letters, numbers, and hyphens (no spaces, underscores, or other special characters). Generated if not provided on create.



2908
2909
2910
# File 'lib/models/porcelain.rb', line 2908

def name
  @name
end

#stateObject

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



2911
2912
2913
# File 'lib/models/porcelain.rb', line 2911

def state
  @state
end

#tagsObject

Tags is a map of key, value pairs.



2913
2914
2915
# File 'lib/models/porcelain.rb', line 2913

def tags
  @tags
end

#versionObject

Version is a read only sdm binary version uploaded by the gateway process when it comes online.



2916
2917
2918
# File 'lib/models/porcelain.rb', line 2916

def version
  @version
end

Instance Method Details

#to_json(options = {}) ⇒ Object



2942
2943
2944
2945
2946
2947
2948
# File 'lib/models/porcelain.rb', line 2942

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