corvix.web.routes_api ===================== .. py:module:: corvix.web.routes_api .. autoapi-nested-parse:: Versioned ``/api/v1/*`` JSON route handlers (plus ``/metrics``). Thin decorated handlers that delegate to the implementation helpers in ``snapshot``, ``rule_snippets``, and ``actions``; this module owns only the HTTP surface (paths, verbs, response types) and the theme presets. Attributes ---------- .. autoapisummary:: corvix.web.routes_api.THEMES Functions --------- .. autoapisummary:: corvix.web.routes_api.metrics_endpoint corvix.web.routes_api.api_themes corvix.web.routes_api.dashboards corvix.web.routes_api.snapshot corvix.web.routes_api.notification_rule_snippets corvix.web.routes_api.dismiss_notification corvix.web.routes_api.mark_notification_read Module Contents --------------- .. py:data:: THEMES :type: dict[str, dict[str, str]] .. py:function:: metrics_endpoint() -> litestar.Response[bytes] Expose Prometheus metrics in text exposition format for scraping. .. py:function:: api_themes() -> dict[str, object] Return available theme presets. .. py:function:: dashboards() -> dict[str, object] List configured dashboard names. .. py:function:: snapshot(dashboard: str | None = None) -> corvix.web.schemas.SnapshotResponse Return the selected dashboard data from storage. .. py:function:: notification_rule_snippets(account_id: str, thread_id: str, dashboard: str | None = None) -> corvix.web.schemas.RuleSnippetsResponse Return prefilled ignore-rule snippets for a notification. .. py:function:: dismiss_notification(account_id: str, thread_id: str) -> litestar.Response[None] Dismiss a notification thread (removes it from the GitHub inbox). Calls DELETE /notifications/threads/{id} on GitHub, then marks the record as dismissed in local storage. Returns 204 No Content on success. .. py:function:: mark_notification_read(account_id: str, thread_id: str) -> litestar.Response[None] Mark a notification thread as read in GitHub and local storage.