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.
2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 |
# File 'lib/models/porcelain.rb', line 2951 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".
2926 2927 2928 |
# File 'lib/models/porcelain.rb', line 2926 def bind_address @bind_address end |
#device ⇒ Object
Device is a read only device name uploaded by the gateway process when it comes online.
2929 2930 2931 |
# File 'lib/models/porcelain.rb', line 2929 def device @device end |
#gateway_filter ⇒ Object
GatewayFilter can be used to restrict the peering between relays and gateways.
2932 2933 2934 |
# File 'lib/models/porcelain.rb', line 2932 def gateway_filter @gateway_filter end |
#id ⇒ Object
Unique identifier of the Gateway.
2934 2935 2936 |
# File 'lib/models/porcelain.rb', line 2934 def id @id end |
#listen_address ⇒ Object
The public hostname/port tuple at which the gateway will be accessible to clients.
2936 2937 2938 |
# File 'lib/models/porcelain.rb', line 2936 def listen_address @listen_address end |
#location ⇒ Object
Location is a read only network location uploaded by the gateway process when it comes online.
2939 2940 2941 |
# File 'lib/models/porcelain.rb', line 2939 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.
2941 2942 2943 |
# File 'lib/models/porcelain.rb', line 2941 def name @name end |
#state ⇒ Object
The current state of the gateway. One of: "new", "verifying_restart", "restarting", "started", "stopped", "dead", "unknown"
2944 2945 2946 |
# File 'lib/models/porcelain.rb', line 2944 def state @state end |
#tags ⇒ Object
Tags is a map of key, value pairs.
2946 2947 2948 |
# File 'lib/models/porcelain.rb', line 2946 def @tags end |
#version ⇒ Object
Version is a read only sdm binary version uploaded by the gateway process when it comes online.
2949 2950 2951 |
# File 'lib/models/porcelain.rb', line 2949 def version @version end |
Instance Method Details
#to_json(options = {}) ⇒ Object
2975 2976 2977 2978 2979 2980 2981 |
# File 'lib/models/porcelain.rb', line 2975 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 |