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.
3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 |
# File 'lib/models/porcelain.rb', line 3149 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 != nil @tags = end 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>”.
3133 3134 3135 |
# File 'lib/models/porcelain.rb', line 3133 def bind_address @bind_address end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
3136 3137 3138 |
# File 'lib/models/porcelain.rb', line 3136 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Gateway.
3138 3139 3140 |
# File 'lib/models/porcelain.rb', line 3138 def id @id end |
#listen_address ⇒ Object
The public hostname/port tuple at which the gateway will be accessible to clients.
3140 3141 3142 |
# File 'lib/models/porcelain.rb', line 3140 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.
3142 3143 3144 |
# File 'lib/models/porcelain.rb', line 3142 def name @name end |
#state ⇒ Object
The current state of the gateway. One of: “new”, “verifying_restart”, “restarting”, “started”, “stopped”, “dead”, “unknown”
3145 3146 3147 |
# File 'lib/models/porcelain.rb', line 3145 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
3147 3148 3149 |
# File 'lib/models/porcelain.rb', line 3147 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
3181 3182 3183 3184 3185 3186 3187 |
# File 'lib/models/porcelain.rb', line 3181 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 |