Class: SDM::MongoReplicaSet

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, name: nil, healthy: nil, tags: nil, hostname: nil, auth_database: nil, port_override: nil, username: nil, password: nil, port: nil, replica_set: nil, connect_to_replica: nil, tls_required: nil) ⇒ MongoReplicaSet

Returns a new instance of MongoReplicaSet.



2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
# File 'lib/models/porcelain.rb', line 2404

def initialize(
  id: nil,
  name: nil,
  healthy: nil,
  tags: nil,
  hostname: nil,
  auth_database: nil,
  port_override: nil,
  username: nil,
  password: nil,
  port: nil,
  replica_set: nil,
  connect_to_replica: nil,
  tls_required: nil
)
  if id != nil
    @id = id
  end
  if name != nil
    @name = name
  end
  if healthy != nil
    @healthy = healthy
  end
  if tags != nil
    @tags = tags
  end
  if hostname != nil
    @hostname = hostname
  end
  if auth_database != nil
    @auth_database = auth_database
  end
  if port_override != nil
    @port_override = port_override
  end
  if username != nil
    @username = username
  end
  if password != nil
    @password = password
  end
  if port != nil
    @port = port
  end
  if replica_set != nil
    @replica_set = replica_set
  end
  if connect_to_replica != nil
    @connect_to_replica = connect_to_replica
  end
  if tls_required != nil
    @tls_required = tls_required
  end
end

Instance Attribute Details

#auth_databaseObject

Returns the value of attribute auth_database.



2388
2389
2390
# File 'lib/models/porcelain.rb', line 2388

def auth_database
  @auth_database
end

#connect_to_replicaObject

Returns the value of attribute connect_to_replica.



2400
2401
2402
# File 'lib/models/porcelain.rb', line 2400

def connect_to_replica
  @connect_to_replica
end

#healthyObject

True if the datasource is reachable and the credentials are valid.



2382
2383
2384
# File 'lib/models/porcelain.rb', line 2382

def healthy
  @healthy
end

#hostnameObject

Returns the value of attribute hostname.



2386
2387
2388
# File 'lib/models/porcelain.rb', line 2386

def hostname
  @hostname
end

#idObject

Unique identifier of the Resource.



2378
2379
2380
# File 'lib/models/porcelain.rb', line 2378

def id
  @id
end

#nameObject

Unique human-readable name of the Resource.



2380
2381
2382
# File 'lib/models/porcelain.rb', line 2380

def name
  @name
end

#passwordObject

Returns the value of attribute password.



2394
2395
2396
# File 'lib/models/porcelain.rb', line 2394

def password
  @password
end

#portObject

Returns the value of attribute port.



2396
2397
2398
# File 'lib/models/porcelain.rb', line 2396

def port
  @port
end

#port_overrideObject

Returns the value of attribute port_override.



2390
2391
2392
# File 'lib/models/porcelain.rb', line 2390

def port_override
  @port_override
end

#replica_setObject

Returns the value of attribute replica_set.



2398
2399
2400
# File 'lib/models/porcelain.rb', line 2398

def replica_set
  @replica_set
end

#tagsObject

Tags is a map of key, value pairs.



2384
2385
2386
# File 'lib/models/porcelain.rb', line 2384

def tags
  @tags
end

#tls_requiredObject

Returns the value of attribute tls_required.



2402
2403
2404
# File 'lib/models/porcelain.rb', line 2402

def tls_required
  @tls_required
end

#usernameObject

Returns the value of attribute username.



2392
2393
2394
# File 'lib/models/porcelain.rb', line 2392

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



2460
2461
2462
2463
2464
2465
2466
# File 'lib/models/porcelain.rb', line 2460

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