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.



14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
# File 'lib/models/porcelain.rb', line 14357

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_at ⇒ Object

The timestamp when this key was created.



14349
14350
14351
# File 'lib/models/porcelain.rb', line 14349

def created_at
  @created_at
end

#id ⇒ Object

Unique identifier of the Relay.



14351
14352
14353
# File 'lib/models/porcelain.rb', line 14351

def id
  @id
end

#last_used_at ⇒ Object

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



14353
14354
14355
# File 'lib/models/porcelain.rb', line 14353

def last_used_at
  @last_used_at
end

#proxy_cluster_id ⇒ Object

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



14355
14356
14357
# File 'lib/models/porcelain.rb', line 14355

def proxy_cluster_id
  @proxy_cluster_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



14369
14370
14371
14372
14373
14374
14375
# File 'lib/models/porcelain.rb', line 14369

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