Class: SDM::MongoHost

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, tls_required: nil) ⇒ MongoHost

Returns a new instance of MongoHost.



2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
# File 'lib/models/porcelain.rb', line 2319

def initialize(
  id: nil,
  name: nil,
  healthy: nil,
  tags: nil,
  hostname: nil,
  auth_database: nil,
  port_override: nil,
  username: nil,
  password: nil,
  port: 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 tls_required != nil
    @tls_required = tls_required
  end
end

Instance Attribute Details

#auth_databaseObject

Returns the value of attribute auth_database.



2307
2308
2309
# File 'lib/models/porcelain.rb', line 2307

def auth_database
  @auth_database
end

#healthyObject

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



2301
2302
2303
# File 'lib/models/porcelain.rb', line 2301

def healthy
  @healthy
end

#hostnameObject

Returns the value of attribute hostname.



2305
2306
2307
# File 'lib/models/porcelain.rb', line 2305

def hostname
  @hostname
end

#idObject

Unique identifier of the Resource.



2297
2298
2299
# File 'lib/models/porcelain.rb', line 2297

def id
  @id
end

#nameObject

Unique human-readable name of the Resource.



2299
2300
2301
# File 'lib/models/porcelain.rb', line 2299

def name
  @name
end

#passwordObject

Returns the value of attribute password.



2313
2314
2315
# File 'lib/models/porcelain.rb', line 2313

def password
  @password
end

#portObject

Returns the value of attribute port.



2315
2316
2317
# File 'lib/models/porcelain.rb', line 2315

def port
  @port
end

#port_overrideObject

Returns the value of attribute port_override.



2309
2310
2311
# File 'lib/models/porcelain.rb', line 2309

def port_override
  @port_override
end

#tagsObject

Tags is a map of key, value pairs.



2303
2304
2305
# File 'lib/models/porcelain.rb', line 2303

def tags
  @tags
end

#tls_requiredObject

Returns the value of attribute tls_required.



2317
2318
2319
# File 'lib/models/porcelain.rb', line 2317

def tls_required
  @tls_required
end

#usernameObject

Returns the value of attribute username.



2311
2312
2313
# File 'lib/models/porcelain.rb', line 2311

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



2367
2368
2369
2370
2371
2372
2373
# File 'lib/models/porcelain.rb', line 2367

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