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.
-
#device ⇒ Object
Device is a read only device name uploaded by the gateway process when it comes online.
-
#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.
-
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
-
#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.
-
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
Instance Method Summary collapse
-
#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
constructor
A new instance of Gateway.
- #to_json(options = {}) ⇒ Object
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.
3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 |
# File 'lib/models/porcelain.rb', line 3030 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 = == nil ? SDM::() : @version = version == nil ? "" : version 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".
3005 3006 3007 |
# File 'lib/models/porcelain.rb', line 3005 def bind_address @bind_address end |
#device ⇒ Object
Device is a read only device name uploaded by the gateway process when it comes online.
3008 3009 3010 |
# File 'lib/models/porcelain.rb', line 3008 def device @device end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
3011 3012 3013 |
# File 'lib/models/porcelain.rb', line 3011 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Gateway.
3013 3014 3015 |
# File 'lib/models/porcelain.rb', line 3013 def id @id end |
#listen_address ⇒ Object
The public hostname/port tuple at which the gateway will be accessible to clients.
3015 3016 3017 |
# File 'lib/models/porcelain.rb', line 3015 def listen_address @listen_address end |
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
3018 3019 3020 |
# File 'lib/models/porcelain.rb', line 3018 def location @location 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.
3020 3021 3022 |
# File 'lib/models/porcelain.rb', line 3020 def name @name end |
#state ⇒ Object
The current state of the gateway. One of: "new", "verifying_restart", "restarting", "started", "stopped", "dead", "unknown"
3023 3024 3025 |
# File 'lib/models/porcelain.rb', line 3023 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
3025 3026 3027 |
# File 'lib/models/porcelain.rb', line 3025 def @tags end |
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
3028 3029 3030 |
# File 'lib/models/porcelain.rb', line 3028 def version @version end |
Instance Method Details
#to_json(options = {}) ⇒ Object
3054 3055 3056 3057 3058 3059 3060 |
# File 'lib/models/porcelain.rb', line 3054 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 |