The oslo_db.options Module

oslo_db.options.list_opts()

Returns a list of oslo.config options available in the library.

The returned list includes all oslo.config options which may be registered at runtime by the library.

Each element of the list is a tuple. The first element is the name of the group under which the list of elements in the second element will be registered. A group name of None corresponds to the [DEFAULT] group in config files.

The purpose of this is to allow tools like the Oslo sample config file generator to discover the options exposed to users by this library.

Returns:a list of (group_name, opts) tuples
oslo_db.options.set_defaults(conf, connection=None, sqlite_db=None, max_pool_size=None, max_overflow=None, pool_timeout=None)

Set defaults for configuration variables.

Overrides default options values.

Parameters:
  • conf (oslo.config.cfg.ConfigOpts instance.) – Config instance specified to set default options in it. Using of instances instead of a global config object prevents conflicts between options declaration.
  • connection (str) – SQL connection string. Valid SQLite URL forms are: * sqlite:///:memory: (or, sqlite://) * sqlite:///relative/path/to/file.db * sqlite:////absolute/path/to/file.db
  • sqlite_db (str) – path to SQLite database file.
  • max_pool_size (int) – maximum connections pool size. The size of the pool to be maintained, defaults to 5. This is the largest number of connections that will be kept persistently in the pool. Note that the pool begins with no connections; once this number of connections is requested, that number of connections will remain.
  • max_overflow (int) – The maximum overflow size of the pool. When the number of checked-out connections reaches the size set in pool_size, additional connections will be returned up to this limit. When those additional connections are returned to the pool, they are disconnected and discarded. It follows then that the total number of simultaneous connections the pool will allow is pool_size + max_overflow, and the total number of “sleeping” connections the pool will allow is pool_size. max_overflow can be set to -1 to indicate no overflow limit; no limit will be placed on the total number of concurrent connections. Defaults to 10, will be used if value of the parameter in None.
  • pool_timeout (int) – The number of seconds to wait before giving up on returning a connection. Defaults to 30, will be used if value of the parameter is None.
Default max_pool_size:
 

5

Default max_overflow:
 

None

Default pool_timeout:
 

None

Previous topic

The oslo_db.exception Module

Next topic

The oslo_db.sqlalchemy.compat.utils Module

Project Source

This Page