Class: SDM::ProxyClusterKey

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

Overview

Proxy Cluster Keys are authentication keys for all proxies within a cluster. The proxies within a cluster share the same key. One cluster can have multiple keys in order to facilitate key rotation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(created_at: nil, id: nil, last_used_at: nil, proxy_cluster_id: nil) ⇒ ProxyClusterKey

Returns a new instance of ProxyClusterKey.



10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
# File 'lib/models/porcelain.rb', line 10844

def initialize(
  created_at: nil,
  id: nil,
  last_used_at: nil,
  proxy_cluster_id: nil
)
  @created_at = created_at == nil ? nil : created_at
  @id = id == nil ? "" : id
  @last_used_at = last_used_at == nil ? nil : last_used_at
  @proxy_cluster_id = proxy_cluster_id == nil ? "" : proxy_cluster_id
end

Instance Attribute Details

#created_atObject

The timestamp when this key was created.



10836
10837
10838
# File 'lib/models/porcelain.rb', line 10836

def created_at
  @created_at
end

#idObject

Unique identifier of the Relay.



10838
10839
10840
# File 'lib/models/porcelain.rb', line 10838

def id
  @id
end

#last_used_atObject

The timestamp when this key was last used, if at all.



10840
10841
10842
# File 'lib/models/porcelain.rb', line 10840

def last_used_at
  @last_used_at
end

#proxy_cluster_idObject

The ID of the proxy cluster which this key authenticates to.



10842
10843
10844
# File 'lib/models/porcelain.rb', line 10842

def proxy_cluster_id
  @proxy_cluster_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



10856
10857
10858
10859
10860
10861
10862
# File 'lib/models/porcelain.rb', line 10856

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