logs-py 1.14__py3-none-any.whl → 2.1__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.
Potentially problematic release.
This version of logs-py might be problematic. Click here for more details.
- LOGS/Auxiliary/Constants.py +2 -2
- LOGS/Auxiliary/DateTimeConverter.py +1 -1
- LOGS/Auxiliary/Exceptions.py +1 -1
- LOGS/Auxiliary/MinimalModelGenerator.py +28 -6
- LOGS/Auxiliary/Tools.py +4 -0
- LOGS/Entities/AutoloadClientInfo.py +6 -8
- LOGS/Entities/AutoloadStatus.py +3 -3
- LOGS/Entities/{AutoloadSource.py → Bridge.py} +11 -10
- LOGS/Entities/BridgeMinimal.py +8 -0
- LOGS/Entities/BridgeRelations.py +23 -0
- LOGS/Entities/BridgeRequestParameter.py +19 -0
- LOGS/Entities/{AutoloadSourceType.py → BridgeType.py} +1 -1
- LOGS/Entities/Bridges.py +12 -0
- LOGS/Entities/{AutoloadConfiguration.py → DataSource.py} +97 -23
- LOGS/Entities/DataSourceMinimal.py +8 -0
- LOGS/Entities/DataSourceRelations.py +23 -0
- LOGS/Entities/DataSourceRequestParameter.py +44 -0
- LOGS/Entities/{AutoloadConfigurationStatus.py → DataSourceStatus.py} +1 -1
- LOGS/Entities/DataSources.py +12 -0
- LOGS/Entities/Dataset.py +83 -71
- LOGS/Entities/DatasetCreator.py +38 -18
- LOGS/Entities/DatasetMatchTypes.py +38 -6
- LOGS/Entities/DatasetRelations.py +13 -2
- LOGS/Entities/DatasetRequestParameter.py +19 -7
- LOGS/Entities/Datasets.py +1 -1
- LOGS/Entities/Document.py +2 -2
- LOGS/Entities/Experiment.py +9 -24
- LOGS/Entities/ExperimentRelations.py +23 -0
- LOGS/Entities/ExperimentRequestParameter.py +27 -2
- LOGS/Entities/Format.py +27 -61
- LOGS/Entities/FormatFormat.py +8 -6
- LOGS/Entities/FormatInstrument.py +2 -2
- LOGS/Entities/FormatMetaData.py +13 -5
- LOGS/Entities/FormatMethod.py +34 -3
- LOGS/Entities/FormatMinimal.py +11 -1
- LOGS/Entities/FormatRequestParameter.py +8 -3
- LOGS/Entities/FormatVendor.py +14 -1
- LOGS/Entities/FormatVendorRequestParameter.py +1 -0
- LOGS/Entities/ICustomSchemaRequest.py +7 -0
- LOGS/Entities/IRelatedEntityRequest.py +9 -0
- LOGS/Entities/Instrument.py +16 -2
- LOGS/Entities/InstrumentRelations.py +23 -0
- LOGS/Entities/InstrumentRequestParameter.py +34 -2
- LOGS/Entities/LabNotebookEntry.py +67 -7
- LOGS/Entities/LabNotebookEntryRelations.py +81 -0
- LOGS/Entities/LabNotebookEntryRequestParameter.py +57 -2
- LOGS/Entities/Method.py +24 -2
- LOGS/Entities/MethodRelations.py +35 -0
- LOGS/Entities/MethodRequestParameter.py +35 -1
- LOGS/Entities/Origin.py +2 -2
- LOGS/Entities/OriginRequestParameter.py +3 -3
- LOGS/Entities/Person.py +34 -3
- LOGS/Entities/PersonRelations.py +36 -3
- LOGS/Entities/PersonRequestParameter.py +50 -10
- LOGS/Entities/Project.py +15 -2
- LOGS/Entities/ProjectRelations.py +11 -0
- LOGS/Entities/ProjectRequestParameter.py +44 -3
- LOGS/Entities/Role.py +45 -16
- LOGS/Entities/RoleRelations.py +23 -0
- LOGS/Entities/RoleRequestParameter.py +28 -1
- LOGS/Entities/Sample.py +26 -32
- LOGS/Entities/SampleRelations.py +4 -2
- LOGS/Entities/SampleRequestParameter.py +5 -10
- LOGS/Entities/__init__.py +8 -7
- LOGS/Entity/Entity.py +30 -6
- LOGS/Entity/EntityRelations.py +3 -2
- LOGS/Entity/EntityRequestParameter.py +10 -5
- LOGS/Entity/EntityWithIntId.py +1 -1
- LOGS/Entity/SerializeableContent.py +10 -4
- LOGS/Interfaces/ICreationRecord.py +12 -3
- LOGS/Interfaces/IModificationRecord.py +10 -1
- LOGS/Interfaces/IProjectBased.py +30 -0
- LOGS/Interfaces/IRelatedEntity.py +34 -0
- LOGS/Interfaces/IRelationModel.py +6 -0
- LOGS/Interfaces/IRelationRequest.py +12 -0
- LOGS/Interfaces/ITypedEntity.py +28 -0
- LOGS/Interfaces/IUniqueEntity.py +2 -3
- LOGS/LOGS.py +128 -40
- LOGS/LOGSConnection.py +2 -1
- {logs_py-1.14.dist-info → logs_py-2.1.dist-info}/METADATA +1 -1
- {logs_py-1.14.dist-info → logs_py-2.1.dist-info}/RECORD +84 -70
- LOGS/Entities/AutoloadConfigurationMinimal.py +0 -8
- LOGS/Entities/AutoloadConfigurationRequestParameter.py +0 -17
- LOGS/Entities/AutoloadConfigurations.py +0 -16
- LOGS/Entities/AutoloadSourceMinimal.py +0 -8
- LOGS/Entities/AutoloadSourceRequestParameter.py +0 -13
- LOGS/Entities/AutoloadSources.py +0 -12
- /LOGS/Interfaces/{ICustomFields.py → ICustomField.py} +0 -0
- {logs_py-1.14.dist-info → logs_py-2.1.dist-info}/WHEEL +0 -0
- {logs_py-1.14.dist-info → logs_py-2.1.dist-info}/top_level.txt +0 -0
LOGS/Auxiliary/Constants.py
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
|
2
2
|
from typing import TYPE_CHECKING, TypeVar, Union
|
|
3
3
|
|
|
4
4
|
if TYPE_CHECKING:
|
|
5
|
-
from LOGS.Entities.
|
|
5
|
+
from LOGS.Entities.Bridge import Bridge
|
|
6
6
|
from LOGS.Entities.Dataset import Dataset
|
|
7
7
|
from LOGS.Entities.Document import Document
|
|
8
8
|
from LOGS.Entities.Equipment import Equipment
|
|
@@ -65,7 +65,7 @@ class Constants:
|
|
|
65
65
|
"Project",
|
|
66
66
|
"Sample",
|
|
67
67
|
"Dataset",
|
|
68
|
-
"
|
|
68
|
+
"Bridge",
|
|
69
69
|
"Equipment",
|
|
70
70
|
"Experiment",
|
|
71
71
|
"Instrument",
|
|
@@ -5,7 +5,7 @@ from typing import List, cast
|
|
|
5
5
|
|
|
6
6
|
class DateTimeConverter:
|
|
7
7
|
# When adding pattern here put the pattern with most information on top
|
|
8
|
-
_patterns = ["%Y-%m-%dT%H:%M:%S.%fZ", "%Y-%m-%d"]
|
|
8
|
+
_patterns = ["%Y-%m-%dT%H:%M:%S.%fZ", "%Y-%m-%dT%H:%M:%SZ", "%Y-%m-%d"]
|
|
9
9
|
utc_offset_re = re.compile(r"([\+-])(\d+)$")
|
|
10
10
|
multiSpace_re = re.compile(r"( {2,})")
|
|
11
11
|
|
LOGS/Auxiliary/Exceptions.py
CHANGED
|
@@ -209,7 +209,7 @@ class EntityDeletingException(LOGSException):
|
|
|
209
209
|
elif isinstance(entityIds, Entity):
|
|
210
210
|
message = "Could not %s entity %a" % (self._action, entityIds.identifier)
|
|
211
211
|
else:
|
|
212
|
-
message = "%s entity failed" % (self._action.capitalize()
|
|
212
|
+
message = "%s entity failed" % (self.gerundVerb(self._action.capitalize()))
|
|
213
213
|
|
|
214
214
|
indent *= 2
|
|
215
215
|
if errors:
|
|
@@ -11,8 +11,8 @@ if TYPE_CHECKING:
|
|
|
11
11
|
|
|
12
12
|
def _typeByTypename(fieldType):
|
|
13
13
|
switcher = {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"BridgeMinimal": BridgeMinimalFromDict,
|
|
15
|
+
"Bridge": BridgeMinimalFromDict,
|
|
16
16
|
"DatasetMinimal": DatasetMinimalFromDict,
|
|
17
17
|
"Dataset": DatasetMinimalFromDict,
|
|
18
18
|
"EquipmentMinimal": EquipmentMinimalFromDict,
|
|
@@ -87,7 +87,13 @@ def MinimalFromList(
|
|
|
87
87
|
value = {"id": value}
|
|
88
88
|
|
|
89
89
|
if isinstance(value, list):
|
|
90
|
-
|
|
90
|
+
l = []
|
|
91
|
+
for v in value:
|
|
92
|
+
if isinstance(v, (int, str)):
|
|
93
|
+
l.append({"id": v})
|
|
94
|
+
else:
|
|
95
|
+
l.append(v)
|
|
96
|
+
value = l
|
|
91
97
|
|
|
92
98
|
l = Tools.checkListAndConvert(
|
|
93
99
|
value,
|
|
@@ -135,16 +141,16 @@ def _checkAndConvert(
|
|
|
135
141
|
return result
|
|
136
142
|
|
|
137
143
|
|
|
138
|
-
def
|
|
144
|
+
def BridgeMinimalFromDict(
|
|
139
145
|
ref: Optional[Union[dict, Constants.ID_TYPE]],
|
|
140
146
|
fieldName: Optional[str] = None,
|
|
141
147
|
connection: Optional["LOGSConnection"] = None,
|
|
142
148
|
):
|
|
143
|
-
from LOGS.Entities.
|
|
149
|
+
from LOGS.Entities.BridgeMinimal import BridgeMinimal
|
|
144
150
|
|
|
145
151
|
return _checkAndConvert(
|
|
146
152
|
ref,
|
|
147
|
-
|
|
153
|
+
BridgeMinimal,
|
|
148
154
|
fieldName=fieldName,
|
|
149
155
|
allowNone=True,
|
|
150
156
|
connection=connection,
|
|
@@ -393,3 +399,19 @@ def FormatFormatMinimalFromDict(
|
|
|
393
399
|
allowNone=True,
|
|
394
400
|
connection=connection,
|
|
395
401
|
)
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
def EntityMinimalWithStrIdFromDict(
|
|
405
|
+
ref: Optional[Union[dict, Constants.ID_TYPE]],
|
|
406
|
+
fieldName: Optional[str] = None,
|
|
407
|
+
connection: Optional["LOGSConnection"] = None,
|
|
408
|
+
):
|
|
409
|
+
from LOGS.Entity.EntityMinimalWithStrId import EntityMinimalWithStrId
|
|
410
|
+
|
|
411
|
+
return _checkAndConvert(
|
|
412
|
+
ref,
|
|
413
|
+
EntityMinimalWithStrId,
|
|
414
|
+
fieldName=fieldName,
|
|
415
|
+
allowNone=True,
|
|
416
|
+
connection=connection,
|
|
417
|
+
)
|
LOGS/Auxiliary/Tools.py
CHANGED
|
@@ -214,6 +214,8 @@ class Tools:
|
|
|
214
214
|
else:
|
|
215
215
|
raise Exception("Field %a cannot be 'None'." % (fieldName))
|
|
216
216
|
|
|
217
|
+
# print("converter", converter)
|
|
218
|
+
# print(f"{fieldName}({fieldType}) = {value}")
|
|
217
219
|
try:
|
|
218
220
|
value = converter(value)
|
|
219
221
|
except:
|
|
@@ -227,6 +229,8 @@ class Tools:
|
|
|
227
229
|
)
|
|
228
230
|
)
|
|
229
231
|
|
|
232
|
+
# print(f"{fieldName}({fieldType}) => {value}")
|
|
233
|
+
|
|
230
234
|
if value == None:
|
|
231
235
|
if allowNone:
|
|
232
236
|
return cast(Any, None)
|
|
@@ -14,7 +14,7 @@ class AutoloadClientInfo(SerializeableContent):
|
|
|
14
14
|
_operatingSystem: Optional[str] = None
|
|
15
15
|
_firstSeen: Optional[datetime] = None
|
|
16
16
|
_isApproved: Optional[bool] = None
|
|
17
|
-
|
|
17
|
+
_bridgeId: Optional[int] = None
|
|
18
18
|
|
|
19
19
|
@property
|
|
20
20
|
def id(self) -> Optional[UUID]:
|
|
@@ -85,11 +85,9 @@ class AutoloadClientInfo(SerializeableContent):
|
|
|
85
85
|
self._isApproved = self.checkAndConvertNullable(value, bool, "isApproved")
|
|
86
86
|
|
|
87
87
|
@property
|
|
88
|
-
def
|
|
89
|
-
return self.
|
|
88
|
+
def bridgeId(self) -> Optional[int]:
|
|
89
|
+
return self._bridgeId
|
|
90
90
|
|
|
91
|
-
@
|
|
92
|
-
def
|
|
93
|
-
self.
|
|
94
|
-
value, int, "autoloadSourceId"
|
|
95
|
-
)
|
|
91
|
+
@bridgeId.setter
|
|
92
|
+
def bridgeId(self, value):
|
|
93
|
+
self._bridgeId = self.checkAndConvertNullable(value, int, "bridgeId")
|
LOGS/Entities/AutoloadStatus.py
CHANGED
|
@@ -2,18 +2,18 @@ from datetime import datetime
|
|
|
2
2
|
from typing import List, Optional
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
|
|
5
|
-
from LOGS.Entities.AutoloadSourceType import AutoloadSourceType
|
|
6
5
|
from LOGS.Entities.AutoloadStatusError import AutoloadStatusError
|
|
6
|
+
from LOGS.Entities.BridgeType import BridgeType
|
|
7
7
|
from LOGS.Entities.RunState import RunState
|
|
8
8
|
from LOGS.Entity.SerializeableContent import SerializeableClass
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class AutoloadStatus(SerializeableClass):
|
|
12
|
-
type: Optional[
|
|
12
|
+
type: Optional[BridgeType]
|
|
13
13
|
uuid: Optional[UUID]
|
|
14
14
|
lastUpdated: Optional[datetime]
|
|
15
15
|
counter: Optional[int]
|
|
16
|
-
|
|
16
|
+
dataSourceId: Optional[int]
|
|
17
17
|
runState: Optional[RunState]
|
|
18
18
|
startedOn: Optional[datetime]
|
|
19
19
|
duration: Optional[str]
|
|
@@ -4,21 +4,24 @@ from LOGS.Auxiliary.Decorators import Endpoint
|
|
|
4
4
|
from LOGS.Auxiliary.Exceptions import LOGSMultilineException
|
|
5
5
|
from LOGS.Entities.AutoloadClientInfo import AutoloadClientInfo
|
|
6
6
|
from LOGS.Entities.AutoloadFileInfo import AutoloadFileInfo
|
|
7
|
-
from LOGS.Entities.
|
|
8
|
-
from LOGS.
|
|
7
|
+
from LOGS.Entities.BridgeRelations import BridgeRelations
|
|
8
|
+
from LOGS.Entities.BridgeType import BridgeType
|
|
9
|
+
from LOGS.Entity.EntityWithIntId import IEntityWithIntId
|
|
9
10
|
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
11
|
+
from LOGS.Interfaces.IRelatedEntity import IRelatedEntity
|
|
10
12
|
from LOGS.LOGSConnection import LOGSConnection
|
|
11
13
|
|
|
12
14
|
|
|
13
|
-
@Endpoint("
|
|
14
|
-
class
|
|
15
|
-
|
|
15
|
+
@Endpoint("bridges")
|
|
16
|
+
class Bridge(IEntityWithIntId, INamedEntity, IRelatedEntity[BridgeRelations]):
|
|
17
|
+
_relationType = type(BridgeRelations)
|
|
18
|
+
|
|
19
|
+
_type: Optional[BridgeType]
|
|
16
20
|
_hostname: Optional[str]
|
|
17
21
|
_ipAddress: Optional[str]
|
|
18
22
|
_description: Optional[str]
|
|
19
23
|
_username: Optional[str]
|
|
20
24
|
_port: Optional[int]
|
|
21
|
-
# _autoloadClientInfo: Optional[List[AutoloadClientInfo]]
|
|
22
25
|
_connectedClients: Optional[List[AutoloadClientInfo]]
|
|
23
26
|
_isConnected: Optional[bool]
|
|
24
27
|
_areMultipleClientsConnected: Optional[bool]
|
|
@@ -26,8 +29,6 @@ class AutoloadSource(INamedEntity, EntityWithIntId):
|
|
|
26
29
|
_password: Optional[str]
|
|
27
30
|
_privateKey: Optional[str]
|
|
28
31
|
|
|
29
|
-
# _connectedClients: List<AutoloadClientInfo>
|
|
30
|
-
|
|
31
32
|
def __init__(
|
|
32
33
|
self,
|
|
33
34
|
ref=None,
|
|
@@ -71,12 +72,12 @@ class AutoloadSource(INamedEntity, EntityWithIntId):
|
|
|
71
72
|
)
|
|
72
73
|
|
|
73
74
|
@property
|
|
74
|
-
def type(self) -> Optional[
|
|
75
|
+
def type(self) -> Optional[BridgeType]:
|
|
75
76
|
return self._type
|
|
76
77
|
|
|
77
78
|
@type.setter
|
|
78
79
|
def type(self, value):
|
|
79
|
-
self._type = self.checkAndConvertNullable(value,
|
|
80
|
+
self._type = self.checkAndConvertNullable(value, BridgeType, "type")
|
|
80
81
|
|
|
81
82
|
@property
|
|
82
83
|
def hostname(self) -> Optional[str]:
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entity.EntityRelation import EntityRelation
|
|
4
|
+
from LOGS.Entity.EntityRelations import EntityRelations
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from LOGS.Entities.Dataset import Dataset
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BridgeRelations(EntityRelations):
|
|
11
|
+
"""Relations of a Bridge with other entities"""
|
|
12
|
+
|
|
13
|
+
_datasets: Optional[EntityRelation["Dataset"]] = None
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def datasets(self) -> Optional[EntityRelation["Dataset"]]:
|
|
17
|
+
return self._datasets
|
|
18
|
+
|
|
19
|
+
@datasets.setter
|
|
20
|
+
def datasets(self, value):
|
|
21
|
+
from LOGS.Entities.Datasets import Datasets
|
|
22
|
+
|
|
23
|
+
self._datasets = self._entityConverter(value, Datasets)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import List, Optional
|
|
3
|
+
|
|
4
|
+
from LOGS.Entities.BridgeType import BridgeType
|
|
5
|
+
from LOGS.Entities.IRelatedEntityRequest import IRelatedEntityRequest
|
|
6
|
+
from LOGS.Entity.EntityRequestParameter import DefaultOrder, EntityRequestParameter
|
|
7
|
+
from LOGS.Interfaces.INamedEntity import INamedEntityRequest
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class BridgeRequestParameter(
|
|
12
|
+
EntityRequestParameter[DefaultOrder], INamedEntityRequest, IRelatedEntityRequest
|
|
13
|
+
):
|
|
14
|
+
hostnames: Optional[List[str]] = None
|
|
15
|
+
usernames: Optional[List[str]] = None
|
|
16
|
+
ipAddresses: Optional[List[str]] = None
|
|
17
|
+
dataSourceIds: Optional[List[int]] = None
|
|
18
|
+
types: Optional[List[BridgeType]] = None
|
|
19
|
+
isConfigured: Optional[bool] = None
|
LOGS/Entities/Bridges.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from LOGS.Auxiliary.Decorators import Endpoint
|
|
2
|
+
from LOGS.Entities.Bridge import Bridge
|
|
3
|
+
from LOGS.Entities.BridgeRequestParameter import BridgeRequestParameter
|
|
4
|
+
from LOGS.Entity.EntityIterator import EntityIterator
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@Endpoint("bridges")
|
|
8
|
+
class Bridges(EntityIterator[Bridge, BridgeRequestParameter]):
|
|
9
|
+
"""LOGS connected class Bridges iterator"""
|
|
10
|
+
|
|
11
|
+
_generatorType = Bridge
|
|
12
|
+
_parameterType = BridgeRequestParameter
|
|
@@ -1,29 +1,53 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
+
from enum import Enum
|
|
2
3
|
from typing import Dict, List, Optional
|
|
3
4
|
|
|
4
5
|
from LOGS.Auxiliary.Decorators import Endpoint
|
|
5
6
|
from LOGS.Auxiliary.Exceptions import EntityAPIException
|
|
6
7
|
from LOGS.Auxiliary.MinimalModelGenerator import (
|
|
8
|
+
BridgeMinimalFromDict,
|
|
7
9
|
InstrumentMinimalFromDict,
|
|
8
10
|
MethodMinimalFromDict,
|
|
11
|
+
MinimalFromList,
|
|
9
12
|
)
|
|
10
|
-
from LOGS.Entities.
|
|
13
|
+
from LOGS.Entities.BridgeMinimal import BridgeMinimal
|
|
14
|
+
from LOGS.Entities.DataSourceRelations import DataSourceRelations
|
|
15
|
+
from LOGS.Entities.DataSourceStatus import DataSourceStatus
|
|
11
16
|
from LOGS.Entities.Format import Format
|
|
17
|
+
from LOGS.Entities.FormatMinimal import FormatMinimal
|
|
12
18
|
from LOGS.Entities.InstrumentMinimal import InstrumentMinimal
|
|
13
19
|
from LOGS.Entities.MethodMinimal import MethodMinimal
|
|
14
|
-
from LOGS.Entity.
|
|
20
|
+
from LOGS.Entity.EntityMinimalWithStrId import EntityMinimalWithStrId
|
|
21
|
+
from LOGS.Entity.EntityWithIntId import IEntityWithIntId
|
|
15
22
|
from LOGS.Interfaces.ICreationRecord import ICreationRecord
|
|
16
23
|
from LOGS.Interfaces.IModificationRecord import IModificationRecord
|
|
17
24
|
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
25
|
+
from LOGS.Interfaces.IRelatedEntity import IRelatedEntity
|
|
26
|
+
from LOGS.LOGSConnection import LOGSConnection
|
|
18
27
|
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
class DataSourceType(Enum):
|
|
30
|
+
Crawling = "Crawling"
|
|
31
|
+
IconNMR = "IconNMR"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@Endpoint("data_sources")
|
|
35
|
+
class DataSource(
|
|
36
|
+
IEntityWithIntId,
|
|
37
|
+
INamedEntity,
|
|
38
|
+
ICreationRecord,
|
|
39
|
+
IModificationRecord,
|
|
40
|
+
IRelatedEntity[DataSourceRelations],
|
|
23
41
|
):
|
|
42
|
+
_relationType = type(DataSourceRelations)
|
|
43
|
+
|
|
44
|
+
_type: Optional[DataSourceType]
|
|
45
|
+
_bridge: Optional[BridgeMinimal]
|
|
46
|
+
_formatIds: Optional[List[int]]
|
|
47
|
+
_customImport: Optional[EntityMinimalWithStrId]
|
|
24
48
|
_enabled: Optional[bool]
|
|
25
|
-
|
|
26
|
-
_formats: Optional[List[
|
|
49
|
+
_bridgeId: Optional[int]
|
|
50
|
+
_formats: Optional[List[FormatMinimal]]
|
|
27
51
|
_directories: Optional[List[str]]
|
|
28
52
|
_intervalInSeconds: Optional[int]
|
|
29
53
|
_method: Optional[MethodMinimal]
|
|
@@ -31,7 +55,33 @@ class AutoloadConfiguration(
|
|
|
31
55
|
_cutoffDate: Optional[datetime]
|
|
32
56
|
_customImportId: Optional[str]
|
|
33
57
|
_parserDefinitions: Optional[Dict[str, Format]]
|
|
34
|
-
_status: Optional[
|
|
58
|
+
_status: Optional[DataSourceStatus]
|
|
59
|
+
|
|
60
|
+
def __init__(
|
|
61
|
+
self,
|
|
62
|
+
ref=None,
|
|
63
|
+
id: Optional[int] = None,
|
|
64
|
+
connection: Optional[LOGSConnection] = None,
|
|
65
|
+
):
|
|
66
|
+
"""Represents a connected LOGS entity type"""
|
|
67
|
+
|
|
68
|
+
self._type = None
|
|
69
|
+
self._bridge = None
|
|
70
|
+
self._formatIds = None
|
|
71
|
+
self._customImport = None
|
|
72
|
+
self._enabled = None
|
|
73
|
+
self._bridgeId = None
|
|
74
|
+
self._formats = None
|
|
75
|
+
self._directories = None
|
|
76
|
+
self._intervalInSeconds = None
|
|
77
|
+
self._method = None
|
|
78
|
+
self._instrument = None
|
|
79
|
+
self._cutoffDate = None
|
|
80
|
+
self._customImportId = None
|
|
81
|
+
self._parserDefinitions = None
|
|
82
|
+
self._status = None
|
|
83
|
+
|
|
84
|
+
super().__init__(ref=ref, id=id, connection=connection)
|
|
35
85
|
|
|
36
86
|
def triggerAutoload(self):
|
|
37
87
|
connection, endpoint, id = self._getConnectionData()
|
|
@@ -49,22 +99,14 @@ class AutoloadConfiguration(
|
|
|
49
99
|
self._enabled = self.checkAndConvertNullable(value, bool, "enabled")
|
|
50
100
|
|
|
51
101
|
@property
|
|
52
|
-
def
|
|
53
|
-
return self._autoloadSourceId
|
|
54
|
-
|
|
55
|
-
@autoloadSourceId.setter
|
|
56
|
-
def autoloadSourceId(self, value):
|
|
57
|
-
self._autoloadSourceId = self.checkAndConvertNullable(
|
|
58
|
-
value, int, "autoloadSourceId"
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
@property
|
|
62
|
-
def formats(self) -> Optional[List[str]]:
|
|
102
|
+
def formats(self) -> Optional[List[FormatMinimal]]:
|
|
63
103
|
return self._formats
|
|
64
104
|
|
|
65
105
|
@formats.setter
|
|
66
106
|
def formats(self, value):
|
|
67
|
-
self._formats =
|
|
107
|
+
self._formats = MinimalFromList(
|
|
108
|
+
value, "FormatMinimal", "formats", connection=self.connection
|
|
109
|
+
)
|
|
68
110
|
|
|
69
111
|
@property
|
|
70
112
|
def directories(self) -> Optional[List[str]]:
|
|
@@ -121,11 +163,43 @@ class AutoloadConfiguration(
|
|
|
121
163
|
)
|
|
122
164
|
|
|
123
165
|
@property
|
|
124
|
-
def status(self) -> Optional[
|
|
166
|
+
def status(self) -> Optional[DataSourceStatus]:
|
|
125
167
|
return self._status
|
|
126
168
|
|
|
127
169
|
@status.setter
|
|
128
170
|
def status(self, value):
|
|
129
|
-
self._status = self.checkAndConvertNullable(
|
|
130
|
-
|
|
171
|
+
self._status = self.checkAndConvertNullable(value, DataSourceStatus, "status")
|
|
172
|
+
|
|
173
|
+
@property
|
|
174
|
+
def type(self) -> Optional[DataSourceType]:
|
|
175
|
+
return self._type
|
|
176
|
+
|
|
177
|
+
@type.setter
|
|
178
|
+
def type(self, value):
|
|
179
|
+
self._type = self.checkAndConvertNullable(value, DataSourceType, "type")
|
|
180
|
+
|
|
181
|
+
@property
|
|
182
|
+
def bridge(self) -> Optional[BridgeMinimal]:
|
|
183
|
+
return self._bridge
|
|
184
|
+
|
|
185
|
+
@bridge.setter
|
|
186
|
+
def bridge(self, value):
|
|
187
|
+
self._bridge = BridgeMinimalFromDict(value, "bridge", self.connection)
|
|
188
|
+
|
|
189
|
+
@property
|
|
190
|
+
def formatIds(self) -> Optional[List[int]]:
|
|
191
|
+
return self._formatIds
|
|
192
|
+
|
|
193
|
+
@formatIds.setter
|
|
194
|
+
def formatIds(self, value):
|
|
195
|
+
self._formatIds = self.checkListAndConvertNullable(value, int, "formatIds")
|
|
196
|
+
|
|
197
|
+
@property
|
|
198
|
+
def customImport(self) -> Optional[EntityMinimalWithStrId]:
|
|
199
|
+
return self._customImport
|
|
200
|
+
|
|
201
|
+
@customImport.setter
|
|
202
|
+
def customImport(self, value):
|
|
203
|
+
self._customImport = self.checkAndConvertNullable(
|
|
204
|
+
value, EntityMinimalWithStrId, "customImport"
|
|
131
205
|
)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from LOGS.Auxiliary.Decorators import FullModel
|
|
2
|
+
from LOGS.Entities.DataSource import DataSource
|
|
3
|
+
from LOGS.Entity.EntityMinimalWithIntId import EntityMinimalWithIntId
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@FullModel(DataSource)
|
|
7
|
+
class DataSourceMinimal(EntityMinimalWithIntId[DataSource]):
|
|
8
|
+
pass
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entity.EntityRelation import EntityRelation
|
|
4
|
+
from LOGS.Entity.EntityRelations import EntityRelations
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from LOGS.Entities.Dataset import Dataset
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DataSourceRelations(EntityRelations):
|
|
11
|
+
"""Relations of a DataSource with other entities"""
|
|
12
|
+
|
|
13
|
+
_datasets: Optional[EntityRelation["Dataset"]] = None
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def datasets(self) -> Optional[EntityRelation["Dataset"]]:
|
|
17
|
+
return self._datasets
|
|
18
|
+
|
|
19
|
+
@datasets.setter
|
|
20
|
+
def datasets(self, value):
|
|
21
|
+
from LOGS.Entities.Datasets import Datasets
|
|
22
|
+
|
|
23
|
+
self._datasets = self._entityConverter(value, Datasets)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from LOGS.Entities.DataSource import DataSourceType
|
|
6
|
+
from LOGS.Entities.IRelatedEntityRequest import IRelatedEntityRequest
|
|
7
|
+
from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
|
|
8
|
+
from LOGS.Interfaces.INamedEntity import INamedEntityRequest
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DataSourceOrder(Enum):
|
|
12
|
+
ID_ASC = "ID_ASC"
|
|
13
|
+
ID_DESC = "ID_DESC"
|
|
14
|
+
NAME_ASC = "NAME_ASC"
|
|
15
|
+
NAME_DESC = "NAME_DESC"
|
|
16
|
+
TYPE_ASC = "TYPE_ASC"
|
|
17
|
+
TYPE_DESC = "TYPE_DESC"
|
|
18
|
+
BRIDGE_ASC = "BRIDGE_ASC"
|
|
19
|
+
BRIDGE_DESC = "BRIDGE_DESC"
|
|
20
|
+
INTERVAL_ASC = "INTERVAL_ASC"
|
|
21
|
+
INTERVAL_DESC = "INTERVAL_DESC"
|
|
22
|
+
ENABLED_ASC = "ENABLED_ASC"
|
|
23
|
+
ENABLED_DESC = "ENABLED_DESC"
|
|
24
|
+
METHOD_ASC = "METHOD_ASC"
|
|
25
|
+
METHOD_DESC = "METHOD_DESC"
|
|
26
|
+
INSTRUMENT_ASC = "INSTRUMENT_ASC"
|
|
27
|
+
INSTRUMENT_DESC = "INSTRUMENT_DESC"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass
|
|
31
|
+
class DataSourceRequestParameter(
|
|
32
|
+
EntityRequestParameter[DataSourceOrder], INamedEntityRequest, IRelatedEntityRequest
|
|
33
|
+
):
|
|
34
|
+
enabled: Optional[bool] = None
|
|
35
|
+
bridgeIds: Optional[List[int]] = None
|
|
36
|
+
datasetIds: Optional[List[int]] = None
|
|
37
|
+
formatIds: Optional[List[str]] = None
|
|
38
|
+
customImportIds: Optional[List[str]] = None
|
|
39
|
+
directories: Optional[List[str]] = None
|
|
40
|
+
methodIds: Optional[List[int]] = None
|
|
41
|
+
instrumentIds: Optional[List[int]] = None
|
|
42
|
+
sourceHostnames: Optional[List[str]] = None
|
|
43
|
+
sourceIpAddresses: Optional[List[str]] = None
|
|
44
|
+
types: Optional[List[DataSourceType]] = None
|
|
@@ -5,7 +5,7 @@ from LOGS.Entities.AutoloadStatus import AutoloadStatus
|
|
|
5
5
|
from LOGS.Entity.SerializeableContent import SerializeableClass
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
class
|
|
8
|
+
class DataSourceStatus(SerializeableClass):
|
|
9
9
|
isConnected: Optional[bool] = None
|
|
10
10
|
nextScheduledDate: Optional[datetime] = None
|
|
11
11
|
lastClientStatus: Optional[AutoloadStatus] = None
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from LOGS.Auxiliary.Decorators import Endpoint
|
|
2
|
+
from LOGS.Entities.DataSource import DataSource
|
|
3
|
+
from LOGS.Entities.DataSourceRequestParameter import DataSourceRequestParameter
|
|
4
|
+
from LOGS.Entity.EntityIterator import EntityIterator
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@Endpoint("autoload_configurations")
|
|
8
|
+
class DataSources(EntityIterator[DataSource, DataSourceRequestParameter]):
|
|
9
|
+
"""LOGS connected class AutouploadSource iterator"""
|
|
10
|
+
|
|
11
|
+
_generatorType = DataSource
|
|
12
|
+
_parameterType = DataSourceRequestParameter
|