Class: SDM::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

Gateway represents a StrongDM CLI installation running in gateway mode.

Instance Attribute Summary collapse

Instance Method Summary collapse

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.



3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
# File 'lib/models/porcelain.rb', line 3673

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 = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
  @version = version == nil ? "" : version
end

Instance Attribute Details

#bind_addressObject

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".



3648
3649
3650
# File 'lib/models/porcelain.rb', line 3648

def bind_address
  @bind_address
end

#deviceObject

Device is a read only device name uploaded by the gateway process when it comes online.



3651
3652
3653
# File 'lib/models/porcelain.rb', line 3651

def device
  @device
end

#gateway_filterObject

GatewayFilter can be used to restrict the peering between relays and gateways.



3654
3655
3656
# File 'lib/models/porcelain.rb', line 3654

def gateway_filter
  @gateway_filter
end

#idObject

Unique identifier of the Gateway.



3656
3657
3658
# File 'lib/models/porcelain.rb', line 3656

def id
  @id
end

#listen_addressObject

The public hostname/port tuple at which the gateway will be accessible to clients.



3658
3659
3660
# File 'lib/models/porcelain.rb', line 3658

def listen_address
  @listen_address
end

#locationObject

Location is a read only network location uploaded by the gateway process when it comes online.



3661
3662
3663
# File 'lib/models/porcelain.rb', line 3661

def location
  @location
end

#nameObject

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.



3663
3664
3665
# File 'lib/models/porcelain.rb', line 3663

def name
  @name
end

#stateObject

The current state of the gateway. One of: "new", "verifying_restart", "restarting", "started", "stopped", "dead", "unknown"



3666
3667
3668
# File 'lib/models/porcelain.rb', line 3666

def state
  @state
end

#tagsObject

Tags is a map of key, value pairs.



3668
3669
3670
# File 'lib/models/porcelain.rb', line 3668

def tags
  @tags
end

#versionObject

Version is a read only sdm binary version uploaded by the gateway process when it comes online.



3671
3672
3673
# File 'lib/models/porcelain.rb', line 3671

def version
  @version
end

Instance Method Details

#to_json(options = {}) ⇒ Object



3697
3698
3699
3700
3701
3702
3703
# File 'lib/models/porcelain.rb', line 3697

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end