WebhookSender
Send logs and metadata to webhook endpoints with optional custom headers.
-
class WebhookSender(url: str, logger: MdmLogger, logfile: Path | str | None = None, headers: dict[str, str] | None = None)[source]
Bases: object
Helper class for sending log files to Tray webhooks.
- Parameters:
-
-
send_logfile(**metadata: Any) → bool[source]
Send log file to Tray webhook with optional metadata.
- Parameters:
metadata (Any) – Additional metadata to include (e.g., hostname, serial, user, script_name)
- Returns:
True if successful, False otherwise
- Return type:
bool
-
send(**metadata: Any) → bool[source]
Send information to a webhook with optional metadata.
- Parameters:
metadata (Any) – Additional metadata to include (e.g., hostname, serial, user, script_name)
- Returns:
True if successful, False otherwise
- Return type:
bool