Check Helpers API Documentation
sys_utils
- foursight_core.checks.helpers.sys_utils.cat_indices(client)
Wrapper function for the ES API _cat/indices so that the result returned is comprehensible.
- Parameters
client – es client to use
- Returns
2-tuple lists of header, rows
- foursight_core.checks.helpers.sys_utils.parse_datetime_to_utc(time_str, manual_format=None)
Attempt to parse the string time_str with the given string format. If no format is given, attempt to automatically parse the given string that may or may not contain timezone information. Returns a datetime object of the string in UTC or None if the parsing was unsuccessful.
- foursight_core.checks.helpers.sys_utils.wipe_build_indices(es_url, check)
Wipes all number-prefixed indices on the given es_url. Be careful not to run while builds are running as this will cause them to fail.
wrangler_utils
- foursight_core.checks.helpers.wrangler_utils.last_modified_from(days_back)
Check if input is a number and return a string to search for items last modified from n days ago. Also returns a message with the resulting number.
- foursight_core.checks.helpers.wrangler_utils.md_cell_maker(item)
Builds a markdown cell
- foursight_core.checks.helpers.wrangler_utils.md_table_maker(rows, keys, jsx_key, col_widths='[]')
Builds markdown table