common Package¶
health
Module¶
-
lemur.common.health.
health
()
managers
Module¶
-
class
lemur.common.managers.
InstanceManager
(class_list=None, instances=True) Bases:
object
-
add
(class_path)
-
all
() Returns a list of cached instances.
-
get_class_list
()
-
remove
(class_path)
-
update
(class_list) Updates the class list and wipes the cache.
-
utils
Module¶
-
lemur.common.utils.
column_windows
(session, column, windowsize) Return a series of WHERE clauses against a given column that break it into windows.
Result is an iterable of tuples, consisting of ((start, end), whereclause), where (start, end) are the ids.
Requires a database that supports window functions, i.e. Postgresql, SQL Server, Oracle.
Enhance this yourself ! Add a “where” argument so that windows of just a subset of rows can be computed.
-
lemur.common.utils.
generate_private_key
(key_type) Generates a new private key based on key_type.
Valid key types: RSA2048, RSA4096
Parameters: key_type – Returns:
-
lemur.common.utils.
get_psuedo_random_string
() Create a random and strongish challenge.
-
lemur.common.utils.
is_weekend
(date) Determines if a given date is on a weekend.
Parameters: date – Returns:
-
lemur.common.utils.
parse_certificate
(body) Helper function that parses a PEM certificate.
Parameters: body – Returns:
-
lemur.common.utils.
validate_conf
(app, required_vars) Ensures that the given fields are set in the applications conf.
Parameters: - app –
- required_vars – list
-
lemur.common.utils.
windowed_query
(q, column, windowsize) “Break a Query into windows on a given column.