Related to https://github.com/grafana/oncall-private/issues/2806#issuecomment-2246286918. Prepare engine for the backend plugin enablement/migration: - Refactor sync code - Improve plugin user authentication to set up user on-the-fly (when missing) - Implement v2 endpoints for install, sync and status (to be used via the backend plugin) (most of the changes come from https://github.com/grafana/oncall/pull/4657; backport all engine changes that keep backwards compatibility)
20 lines
650 B
Python
20 lines
650 B
Python
from dataclasses import dataclass
|
|
from typing import Dict, List, Optional
|
|
|
|
|
|
@dataclass
|
|
class OnCallError:
|
|
code: int
|
|
message: str
|
|
fields: Optional[Dict[str, List[str]]] = None
|
|
|
|
|
|
SELF_HOSTED_ONLY_FEATURE_ERROR = OnCallError(
|
|
code=1001, message="This feature is not available in Cloud versions of OnCall"
|
|
)
|
|
|
|
INVALID_SELF_HOSTED_ID = OnCallError(code=1001, message="Invalid stack or org id for self-hosted organization")
|
|
|
|
CLOUD_ONLY_FEATURE_ERROR = OnCallError(code=1002, message="This feature is not available in OSS versions of OnCall")
|
|
|
|
INSTALL_ERROR = OnCallError(code=1003, message="Install failed check /plugin/status for details")
|