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.
3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 |
# File 'lib/models/porcelain.rb', line 3633 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".
3608 3609 3610 |
# File 'lib/models/porcelain.rb', line 3608 def bind_address @bind_address end |
#device ⇒ Object
Device is a read only device name uploaded by the gateway process when it comes online.
3611 3612 3613 |
# File 'lib/models/porcelain.rb', line 3611 def device @device end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
3614 3615 3616 |
# File 'lib/models/porcelain.rb', line 3614 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Gateway.
3616 3617 3618 |
# File 'lib/models/porcelain.rb', line 3616 def id @id end |
#listen_address ⇒ Object
The public hostname/port tuple at which the gateway will be accessible to clients.
3618 3619 3620 |
# File 'lib/models/porcelain.rb', line 3618 def listen_address @listen_address end |
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
3621 3622 3623 |
# File 'lib/models/porcelain.rb', line 3621 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.
3623 3624 3625 |
# File 'lib/models/porcelain.rb', line 3623 def name @name end |
#state ⇒ Object
The current state of the gateway. One of: "new", "verifying_restart", "restarting", "started", "stopped", "dead", "unknown"
3626 3627 3628 |
# File 'lib/models/porcelain.rb', line 3626 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
3628 3629 3630 |
# File 'lib/models/porcelain.rb', line 3628 def @tags end |
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
3631 3632 3633 |
# File 'lib/models/porcelain.rb', line 3631 def version @version end |
Instance Method Details
#to_json(options = {}) ⇒ Object
3657 3658 3659 3660 3661 3662 3663 |
# File 'lib/models/porcelain.rb', line 3657 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 |