Class: SDM::Gateway
- Inherits:
-
Object
- Object
- SDM::Gateway
- Defined in:
- lib/models/porcelain.rb
Overview
Gateway represents a StrongDM CLI installation running in gateway mode.
Instance Attribute Summary collapse
-
#bind_address ⇒ Object
The hostname/port tuple which the gateway daemon will bind to.
-
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
-
#id ⇒ Object
Unique identifier of the Gateway.
-
#listen_address ⇒ Object
The public hostname/port tuple at which the gateway will be accessible to clients.
-
#name ⇒ Object
Unique human-readable name of the Gateway.
-
#state ⇒ Object
The current state of the gateway.
-
#tags ⇒ Object
Tags is a map of key, value pairs.
Instance Method Summary collapse
-
#initialize(bind_address: nil, gateway_filter: nil, id: nil, listen_address: nil, name: nil, state: nil, tags: nil) ⇒ Gateway
constructor
A new instance of Gateway.
- #to_json(options = {}) ⇒ Object
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.
2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 |
# File 'lib/models/porcelain.rb', line 2409 def initialize( bind_address: nil, gateway_filter: nil, id: nil, listen_address: nil, name: nil, state: nil, tags: nil ) @bind_address = bind_address == nil ? "" : bind_address @gateway_filter = gateway_filter == nil ? "" : gateway_filter @id = id == nil ? "" : id @listen_address = listen_address == nil ? "" : listen_address @name = name == nil ? "" : name @state = state == nil ? "" : state @tags = == nil ? SDM::() : end |
Instance Attribute Details
#bind_address ⇒ Object
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".
2393 2394 2395 |
# File 'lib/models/porcelain.rb', line 2393 def bind_address @bind_address end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
2396 2397 2398 |
# File 'lib/models/porcelain.rb', line 2396 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Gateway.
2398 2399 2400 |
# File 'lib/models/porcelain.rb', line 2398 def id @id end |
#listen_address ⇒ Object
The public hostname/port tuple at which the gateway will be accessible to clients.
2400 2401 2402 |
# File 'lib/models/porcelain.rb', line 2400 def listen_address @listen_address end |
#name ⇒ Object
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.
2402 2403 2404 |
# File 'lib/models/porcelain.rb', line 2402 def name @name end |
#state ⇒ Object
The current state of the gateway. One of: "new", "verifying_restart", "restarting", "started", "stopped", "dead", "unknown"
2405 2406 2407 |
# File 'lib/models/porcelain.rb', line 2405 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
2407 2408 2409 |
# File 'lib/models/porcelain.rb', line 2407 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
2427 2428 2429 2430 2431 2432 2433 |
# File 'lib/models/porcelain.rb', line 2427 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |