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

Returns a new instance of Gateway.



2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
# File 'lib/models/porcelain.rb', line 2680

def initialize(
  bind_address: nil,
  gateway_filter: nil,
  id: nil,
  listen_address: nil,
  name: nil,
  state: nil,
  tags: nil
)
  if bind_address != nil
    @bind_address = bind_address
  end
  if gateway_filter != nil
    @gateway_filter = gateway_filter
  end
  if id != nil
    @id = id
  end
  if listen_address != nil
    @listen_address = listen_address
  end
  if name != nil
    @name = name
  end
  if state != nil
    @state = state
  end
  if tags != nil
    @tags = tags
  end
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>”.



2664
2665
2666
# File 'lib/models/porcelain.rb', line 2664

def bind_address
  @bind_address
end

#gateway_filterObject

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



2667
2668
2669
# File 'lib/models/porcelain.rb', line 2667

def gateway_filter
  @gateway_filter
end

#idObject

Unique identifier of the Gateway.



2669
2670
2671
# File 'lib/models/porcelain.rb', line 2669

def id
  @id
end

#listen_addressObject

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



2671
2672
2673
# File 'lib/models/porcelain.rb', line 2671

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



2673
2674
2675
# File 'lib/models/porcelain.rb', line 2673

def name
  @name
end

#stateObject

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



2676
2677
2678
# File 'lib/models/porcelain.rb', line 2676

def state
  @state
end

#tagsObject

Tags is a map of key, value pairs.



2678
2679
2680
# File 'lib/models/porcelain.rb', line 2678

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



2712
2713
2714
2715
2716
2717
2718
# File 'lib/models/porcelain.rb', line 2712

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