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(id: nil, name: nil, state: nil, listen_address: nil, bind_address: nil) ⇒ Gateway

Returns a new instance of Gateway.



4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
# File 'lib/models/porcelain.rb', line 4385

def initialize(
	id:nil \
,
	name:nil \
,
	state:nil \
,
	listen_address:nil \
,
	bind_address:nil \
)
	if id != nil
		@id = id
	end
	if name != nil
		@name = name
	end
	if state != nil
		@state = state
	end
	if listen_address != nil
		@listen_address = listen_address
	end
	if bind_address != nil
		@bind_address = bind_address
	end
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>”.



4384
4385
4386
# File 'lib/models/porcelain.rb', line 4384

def bind_address
  @bind_address
end

#idObject

Unique identifier of the Gateway.



4374
4375
4376
# File 'lib/models/porcelain.rb', line 4374

def id
  @id
end

#listen_addressObject

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



4381
4382
4383
# File 'lib/models/porcelain.rb', line 4381

def listen_address
  @listen_address
end

#nameObject

Unique human-readable name of the Gateway. Generated if not provided on create.



4376
4377
4378
# File 'lib/models/porcelain.rb', line 4376

def name
  @name
end

#stateObject

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



4379
4380
4381
# File 'lib/models/porcelain.rb', line 4379

def state
  @state
end

Instance Method Details

#to_json(options = {}) ⇒ Object



4412
4413
4414
4415
4416
4417
4418
# File 'lib/models/porcelain.rb', line 4412

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