-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
88 lines (79 loc) · 2.53 KB
/
__init__.py
File metadata and controls
88 lines (79 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
"""
Response models for API endpoints and internal data structures.
Copyright (c) 2026 Stefan Kumarasinghe.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
License. See http://www.apache.org/licenses/LICENSE-2.0 for details.
"""
from __future__ import annotations
from importlib import import_module
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .analysis import AnalysisQuality, AnalysisReport, MetricSeriesDistributionStats
from .anomalies import MetricAnomaly
from .base import NpModel
from .jobs import (
AnalyzeConfigTemplateResponse,
AnalyzeJobCreateResponse,
AnalyzeJobListResponse,
AnalyzeJobResultResponse,
AnalyzeJobSummary,
AnalyzeReportDeleteResponse,
AnalyzeReportResponse,
JobStatus,
)
from .logs import LogBurst, LogPattern
from .rca import RootCause
from .slo import BudgetStatus, SloBurnAlert
from .traces import ErrorPropagation, ServiceLatency
_EXPORT_MODULES = {
"NpModel": ".base",
"MetricAnomaly": ".anomalies",
"LogBurst": ".logs",
"LogPattern": ".logs",
"ServiceLatency": ".traces",
"ErrorPropagation": ".traces",
"RootCause": ".rca",
"SloBurnAlert": ".slo",
"BudgetStatus": ".slo",
"AnalysisQuality": ".analysis",
"AnalysisReport": ".analysis",
"MetricSeriesDistributionStats": ".analysis",
"JobStatus": ".jobs",
"AnalyzeConfigTemplateResponse": ".jobs",
"AnalyzeJobCreateResponse": ".jobs",
"AnalyzeJobSummary": ".jobs",
"AnalyzeJobListResponse": ".jobs",
"AnalyzeJobResultResponse": ".jobs",
"AnalyzeReportResponse": ".jobs",
"AnalyzeReportDeleteResponse": ".jobs",
}
__all__ = [
"AnalysisQuality",
"AnalysisReport",
"AnalyzeConfigTemplateResponse",
"AnalyzeJobCreateResponse",
"AnalyzeJobListResponse",
"AnalyzeJobResultResponse",
"AnalyzeJobSummary",
"AnalyzeReportDeleteResponse",
"AnalyzeReportResponse",
"BudgetStatus",
"ErrorPropagation",
"JobStatus",
"LogBurst",
"LogPattern",
"MetricAnomaly",
"MetricSeriesDistributionStats",
"NpModel",
"RootCause",
"ServiceLatency",
"SloBurnAlert",
]
def __getattr__(name: str) -> Any:
module_name = _EXPORT_MODULES.get(name)
if module_name is None:
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
module = import_module(module_name, __name__)
value = getattr(module, name)
globals()[name] = value
return value