Skip to content

Connectors

The functions of connectors.core, taken from their docstrings.

connectors.core

record_event(connector_id, kind, ok, message='', subject='', duration=None)

Keep one thing a connector did. It never raises: a journal that cannot be written must not stop a notification, an AI call or a test, which is what it is a journal of.

record_ai_usage(connector_id, ok, prompt_tokens=0, completion_tokens=0, cost=0.0)

Add one AI call to the figures of its day. It never raises, like record_event.

connector_encrypt(value)

Encrypt a secret with the connectors key (CONNECTORS_ENCRYPTION_KEY).

connector_decrypt(value)

The plain text of a value made by connector_encrypt.

litellm_default_api_base(provider) cached

Return the API URL that LiteLLM uses for a provider when no api_base is given, or '' if unavailable.

is_paused(connector_id)

A paused connector keeps its settings but does nothing until it is resumed.

set_paused(connector_id, paused)

Pause or resume a connector. KeyError: unknown connector. PermissionError: read-only connector.

get_all_connectors()

Every connector, by id, with its masked values, its state and its last health check.

get_connector_by_id(connector_id, reveal=False)

One connector; reveal decrypts its secrets. KeyError: unknown connector.

connector_exists(connector_id)

Whether a connector of this id is registered.

get_connector_count()

How many connectors are registered.

save_connector_overrides(connector_id, fields)

Save field overrides for a connector. Sensitive fields are encrypted before storage. fields is a dict {field_name: plain_value}.

reset_connector_field(connector_id, field_name)

Remove a field's override entirely so it goes back to tracking settings.py/env live, instead of staying frozen at whatever value (even empty) was last saved for it.

get_connector_health(connector_id)

Outcome of the last test: {'status': 'healthy' | 'unhealthy' | 'unknown' (never tested), 'message', 'checked_at'}.

record_health_check(connector_id, success, message)

Persist the outcome of a connectivity test (manual or scheduled).

test_connector(connector_id, kind='test')

Call the plugin's health_check, persist the outcome, and return {'success': bool, 'message': str}. kind is what the Deliveries tab says it was: 'test' (the button) or 'health' (the weekly check).

run_weekly_health_checks()

Test every connector so its badge stays current; only a configured, unpaused one that fails queues a PendingAction.

get_config_value(connector_id, field_name)

The live, decrypted value of a field: the one saved on the Connectors page, else settings.py / env. Read it here, not from settings.

get_smtp_config()

Settings of the SMTP connector, as saved on the Connectors page or read from the environment.

get_slack_config()

Settings of the Slack connector.

get_citadel_config()

Settings of the Citadel connector.

get_thehive_config()

Settings of the TheHive connector.

get_misp_config()

Settings of the MISP connector.

get_certstream_config()

Settings of the CertStream connector.

get_suspicious_config()

Settings of the Suspicious connector (an empty address switches it off).

get_searxng_config()

Settings of the SearXNG connector.

get_cyberwatch_cve_config()

Addresses of the CVE feed, the CISA catalogue and the EPSS scores; an empty one switches its feed off.

get_ransomware_live_config()

Addresses of the ransomware.live API.

get_ransomlook_config()

Addresses of the RansomLook API.