perfact-api-dg 0.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- perfact/api/dg/__init__.py +0 -0
- perfact/api/dg/model/__init__.py +7 -0
- perfact/api/dg/model/dgkpi.py +22 -0
- perfact/api/dg/model/dgval.py +45 -0
- perfact/api/dg/model/py.typed +0 -0
- perfact/api/dg/py.typed +0 -0
- perfact/api/dg/services/.gitkeep +0 -0
- perfact_api_dg-0.1.dist-info/METADATA +24 -0
- perfact_api_dg-0.1.dist-info/RECORD +11 -0
- perfact_api_dg-0.1.dist-info/WHEEL +6 -0
- perfact_api_dg-0.1.dist-info/top_level.txt +1 -0
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
from perfact.api.base.model import Base, Mapped
|
|
4
|
+
from sqlalchemy import DateTime
|
|
5
|
+
from sqlalchemy.orm import mapped_column
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DgKpi(Base):
|
|
9
|
+
# COLS
|
|
10
|
+
name: Mapped[str | None]
|
|
11
|
+
description: Mapped[str | None]
|
|
12
|
+
plugin: Mapped[str | None]
|
|
13
|
+
lastcheck: Mapped[datetime] = mapped_column(DateTime(timezone=True))
|
|
14
|
+
maxage: Mapped[str | None]
|
|
15
|
+
updateactive: Mapped[bool | None]
|
|
16
|
+
thresholdmin: Mapped[float | None]
|
|
17
|
+
thresholdmax: Mapped[float | None]
|
|
18
|
+
deviationmax: Mapped[float | None]
|
|
19
|
+
|
|
20
|
+
# FKS
|
|
21
|
+
# mtunit_id: Mapped[int | None] = mapped_column(ForeignKey("mtunit.id"))
|
|
22
|
+
# RELATIONSHIPS
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from perfact.api.base.model import Base, ForeignKey, Mapped
|
|
5
|
+
from sqlalchemy import DateTime, func, select
|
|
6
|
+
from sqlalchemy.dialects.postgresql import JSONB
|
|
7
|
+
from sqlalchemy.orm import mapped_column
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DgVal(Base):
|
|
11
|
+
# COLS
|
|
12
|
+
value: Mapped[float | None]
|
|
13
|
+
name: Mapped[str | None]
|
|
14
|
+
refid: Mapped[int | None]
|
|
15
|
+
createtime: Mapped[datetime] = mapped_column(
|
|
16
|
+
DateTime(timezone=True), default=func.now()
|
|
17
|
+
)
|
|
18
|
+
reftime: Mapped[datetime | None] = mapped_column(DateTime(timezone=True))
|
|
19
|
+
reftable: Mapped[str | None]
|
|
20
|
+
identstring: Mapped[str | None]
|
|
21
|
+
data: Mapped[dict[str, Any] | None] = mapped_column(JSONB)
|
|
22
|
+
sortkey: Mapped[str | None]
|
|
23
|
+
|
|
24
|
+
# FKS
|
|
25
|
+
dgkpi_id: Mapped[int] = mapped_column(ForeignKey("dgkpi.id"))
|
|
26
|
+
# mtunit_id: Mapped[int | None] = mapped_column(ForeignKey("mtunit.id"))
|
|
27
|
+
# RELATIONSHIPS
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def get_newest_dgval(
|
|
31
|
+
cls,
|
|
32
|
+
reftable: str,
|
|
33
|
+
refid: int,
|
|
34
|
+
identstring: str,
|
|
35
|
+
/,
|
|
36
|
+
):
|
|
37
|
+
"""SQL-level: newest matching dgval row for table/ref/day."""
|
|
38
|
+
return (
|
|
39
|
+
select(cls)
|
|
40
|
+
.where(cls.reftable == reftable)
|
|
41
|
+
.where(cls.refid == refid)
|
|
42
|
+
.where(cls.identstring == identstring)
|
|
43
|
+
.order_by(cls.id.desc())
|
|
44
|
+
.limit(1)
|
|
45
|
+
)
|
|
File without changes
|
perfact/api/dg/py.typed
ADDED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: perfact-api-dg
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: PerFact API - dg
|
|
5
|
+
Author-email: Viktor Dick <viktor.dick@perfact.de>
|
|
6
|
+
License: GPL-2.0-or-later
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: SQL
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: psycopg[binary]
|
|
13
|
+
Requires-Dist: sqlalchemy
|
|
14
|
+
Requires-Dist: perfact-api-base
|
|
15
|
+
Requires-Dist: perfact-api-app
|
|
16
|
+
Requires-Dist: pydantic-settings
|
|
17
|
+
|
|
18
|
+
# PerFact API - dg - model
|
|
19
|
+
|
|
20
|
+
This package contains the domain models and services for the dg module of the PerFact software.
|
|
21
|
+
|
|
22
|
+
## getting started
|
|
23
|
+
As this package does not contain an own main entrypoint, you have to install it into the base and run that one.
|
|
24
|
+
Please refer to the documentation of the *API Base* to get more information about how the discovery works and how to include this module to your app bundle.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
perfact/api/dg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
perfact/api/dg/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
perfact/api/dg/model/__init__.py,sha256=YxvcR89flCUuMXk7bVNOoVWoGC3tlZxPp5Ska-cJE84,91
|
|
4
|
+
perfact/api/dg/model/dgkpi.py,sha256=MJHxDl3BTm86_0S29UPlXvawOvwtzxQKU2Y2JlyJ2NI,647
|
|
5
|
+
perfact/api/dg/model/dgval.py,sha256=NQ0GTfJe8nUOO1DnugUSdg_cPLFhijhf1Ne_yk1Iss0,1356
|
|
6
|
+
perfact/api/dg/model/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
perfact/api/dg/services/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
perfact_api_dg-0.1.dist-info/METADATA,sha256=Y2HpfrjLVbSRoQ3iAW10-OmTB9CQbje4HBV5_2LOUB0,925
|
|
9
|
+
perfact_api_dg-0.1.dist-info/WHEEL,sha256=TdQ5LtNwLuxTCjgxN51AgdU5w-KkB9ttmLbzjTH02pg,109
|
|
10
|
+
perfact_api_dg-0.1.dist-info/top_level.txt,sha256=1odO3B1JiDF2Lqgnop8k7K4Xs1y_LdwehM53l1NDOnc,8
|
|
11
|
+
perfact_api_dg-0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
perfact
|