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.
-
#connects_to ⇒ Object
ConnectsTo can be used to restrict the peering between relays and gateways.
-
#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, connects_to: 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, connects_to: 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.
3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 |
# File 'lib/models/porcelain.rb', line 3842 def initialize( bind_address: nil, connects_to: 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 @connects_to = connects_to == nil ? "" : connects_to @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 = == 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".
3814 3815 3816 |
# File 'lib/models/porcelain.rb', line 3814 def bind_address @bind_address end |
#connects_to ⇒ Object
ConnectsTo can be used to restrict the peering between relays and gateways.
3817 3818 3819 |
# File 'lib/models/porcelain.rb', line 3817 def connects_to @connects_to end |
#device ⇒ Object
Device is a read only device name uploaded by the gateway process when it comes online.
3820 3821 3822 |
# File 'lib/models/porcelain.rb', line 3820 def device @device end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways. Deprecated.
3823 3824 3825 |
# File 'lib/models/porcelain.rb', line 3823 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Gateway.
3825 3826 3827 |
# File 'lib/models/porcelain.rb', line 3825 def id @id end |
#listen_address ⇒ Object
The public hostname/port tuple at which the gateway will be accessible to clients.
3827 3828 3829 |
# File 'lib/models/porcelain.rb', line 3827 def listen_address @listen_address end |
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
3830 3831 3832 |
# File 'lib/models/porcelain.rb', line 3830 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.
3832 3833 3834 |
# File 'lib/models/porcelain.rb', line 3832 def name @name end |
#state ⇒ Object
The current state of the gateway. One of: "new", "verifying_restart", "restarting", "started", "stopped", "dead", "unknown"
3835 3836 3837 |
# File 'lib/models/porcelain.rb', line 3835 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
3837 3838 3839 |
# File 'lib/models/porcelain.rb', line 3837 def end |
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
3840 3841 3842 |
# File 'lib/models/porcelain.rb', line 3840 def version @version end |
Instance Method Details
#to_json(options = {}) ⇒ Object
3868 3869 3870 3871 3872 3873 3874 |
# File 'lib/models/porcelain.rb', line 3868 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 |