aas-http-client 0.1.92__tar.gz → 0.2.0__tar.gz
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 aas-http-client might be problematic. Click here for more details.
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/PKG-INFO +1 -1
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client/wrapper/sdk_wrapper.py +21 -9
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client.egg-info/PKG-INFO +1 -1
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/pyproject.toml +1 -1
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/LICENSE +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/README.md +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client/__init__.py +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client/client.py +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client/core/encoder.py +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client/core/version_check.py +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client/demo/demo_process.py +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client/demo/logging_handler.py +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client/utilities/__init__.py +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client/utilities/model_builder.py +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client.egg-info/SOURCES.txt +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client.egg-info/dependency_links.txt +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client.egg-info/top_level.txt +0 -0
- {aas_http_client-0.1.92 → aas_http_client-0.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aas-http-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Generic HTTP client for communicating with various types of AAS servers
|
|
5
5
|
Author-email: Daniel Klein <daniel.klein@em.ag>
|
|
6
6
|
License: # :em engineering methods AG Software License
|
|
@@ -6,7 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
|
|
7
7
|
import basyx.aas.adapter.json
|
|
8
8
|
|
|
9
|
-
from basyx.aas.model import AssetAdministrationShell, Reference, Submodel
|
|
9
|
+
from basyx.aas.model import AssetAdministrationShell, Reference, Submodel, ModelReference
|
|
10
10
|
from aas_http_client.client import AasHttpClient, _create_client
|
|
11
11
|
logger = logging.getLogger(__name__)
|
|
12
12
|
|
|
@@ -37,7 +37,7 @@ class SdkWrapper():
|
|
|
37
37
|
|
|
38
38
|
return self._client.put_shells(identifier, aas_data)
|
|
39
39
|
|
|
40
|
-
def
|
|
40
|
+
def put_shells_submodels_by_id(self, aas_id: str, submodel_id: str, submodel: Submodel) -> bool:
|
|
41
41
|
"""Update a submodel by its ID for a specific Asset Administration Shell (AAS).
|
|
42
42
|
|
|
43
43
|
:param aas_id: ID of the AAS to update the submodel for
|
|
@@ -85,11 +85,16 @@ class SdkWrapper():
|
|
|
85
85
|
:return: AAS object or None if an error occurred
|
|
86
86
|
"""
|
|
87
87
|
content: dict = self._client.get_shells_by_id(aas_id)
|
|
88
|
-
|
|
88
|
+
aas_dict_string = json.dumps(content)
|
|
89
|
+
return json.loads(aas_dict_string, cls=basyx.aas.adapter.json.AASFromJsonDecoder)
|
|
89
90
|
|
|
90
91
|
def get_shells_reference_by_id(self, aas_id: str) -> Reference | None:
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
#workaround because serialization not working
|
|
93
|
+
aas = self.get_shells_by_id(aas_id)
|
|
94
|
+
return ModelReference.from_referable(aas)
|
|
95
|
+
|
|
96
|
+
# content: dict = self._client.get_shells_reference_by_id(aas_id)
|
|
97
|
+
# return json.loads(content, cls=basyx.aas.adapter.json.AASFromJsonDecoder)
|
|
93
98
|
|
|
94
99
|
def get_shells_submodels_by_id(self, aas_id: str, submodel_id: str) -> Submodel | None:
|
|
95
100
|
"""Get a submodel by its ID for a specific Asset Administration Shell (AAS).
|
|
@@ -99,7 +104,8 @@ class SdkWrapper():
|
|
|
99
104
|
:return: Submodel object or None if an error occurred
|
|
100
105
|
"""
|
|
101
106
|
content: dict = self._client.get_shells_submodels_by_id(aas_id, submodel_id)
|
|
102
|
-
|
|
107
|
+
sm_dict_string = json.dumps(content)
|
|
108
|
+
return json.loads(sm_dict_string, cls=basyx.aas.adapter.json.AASFromJsonDecoder)
|
|
103
109
|
|
|
104
110
|
def delete_shells_by_id(self, aas_id: str) -> bool:
|
|
105
111
|
"""Get an Asset Administration Shell (AAS) by its ID from the REST API.
|
|
@@ -176,8 +182,9 @@ class SdkWrapper():
|
|
|
176
182
|
if not isinstance(content, dict):
|
|
177
183
|
logger.error(f"Invalid submodel data: {content}")
|
|
178
184
|
return None
|
|
179
|
-
|
|
180
|
-
|
|
185
|
+
|
|
186
|
+
sm_dict_string = json.dumps(content)
|
|
187
|
+
return json.loads(sm_dict_string, cls=basyx.aas.adapter.json.AASFromJsonDecoder)
|
|
181
188
|
|
|
182
189
|
def patch_submodel_by_id(self, submodel_id: str, submodel: Submodel):
|
|
183
190
|
sm_dict_string = json.dumps(submodel, cls=basyx.aas.adapter.json.AASToJsonEncoder)
|
|
@@ -248,5 +255,10 @@ def create_wrapper_by_config(config_file: Path, password: str = "") -> AasHttpCl
|
|
|
248
255
|
logger.debug(f"Server config file '{config_file}' found.")
|
|
249
256
|
|
|
250
257
|
wrapper = SdkWrapper()
|
|
251
|
-
|
|
258
|
+
client = _create_client(config_string, password)
|
|
259
|
+
|
|
260
|
+
if not client:
|
|
261
|
+
return None
|
|
262
|
+
|
|
263
|
+
wrapper._client = _create_client(config_string, password)
|
|
252
264
|
return wrapper
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aas-http-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Generic HTTP client for communicating with various types of AAS servers
|
|
5
5
|
Author-email: Daniel Klein <daniel.klein@em.ag>
|
|
6
6
|
License: # :em engineering methods AG Software License
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "aas-http-client"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.2.00"
|
|
8
8
|
description = "Generic HTTP client for communicating with various types of AAS servers"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aas_http_client-0.1.92 → aas_http_client-0.2.0}/aas_http_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|