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

Returns a new instance of Gateway.



6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
# File 'lib/models/porcelain.rb', line 6060

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



6053
6054
6055
# File 'lib/models/porcelain.rb', line 6053

def bind_address
  @bind_address
end

#gateway_filterObject

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



6058
6059
6060
# File 'lib/models/porcelain.rb', line 6058

def gateway_filter
  @gateway_filter
end

#idObject

Unique identifier of the Gateway.



6043
6044
6045
# File 'lib/models/porcelain.rb', line 6043

def id
  @id
end

#listen_addressObject

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



6050
6051
6052
# File 'lib/models/porcelain.rb', line 6050

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.



6045
6046
6047
# File 'lib/models/porcelain.rb', line 6045

def name
  @name
end

#stateObject

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



6048
6049
6050
# File 'lib/models/porcelain.rb', line 6048

def state
  @state
end

#tagsObject

Tags is a map of key, value pairs.



6055
6056
6057
# File 'lib/models/porcelain.rb', line 6055

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



6092
6093
6094
6095
6096
6097
6098
# File 'lib/models/porcelain.rb', line 6092

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