aas-http-client 0.1.5__py3-none-any.whl → 0.1.7__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 aas-http-client might be problematic. Click here for more details.
- aas_http_client/__init__.py +3 -1
- aas_http_client/client.py +7 -29
- aas_http_client/utilities/model_builder.py +8 -2
- {aas_http_client-0.1.5.dist-info → aas_http_client-0.1.7.dist-info}/METADATA +5 -4
- {aas_http_client-0.1.5.dist-info → aas_http_client-0.1.7.dist-info}/RECORD +8 -8
- {aas_http_client-0.1.5.dist-info → aas_http_client-0.1.7.dist-info}/WHEEL +0 -0
- {aas_http_client-0.1.5.dist-info → aas_http_client-0.1.7.dist-info}/licenses/LICENSE +0 -0
- {aas_http_client-0.1.5.dist-info → aas_http_client-0.1.7.dist-info}/top_level.txt +0 -0
aas_http_client/__init__.py
CHANGED
|
@@ -14,7 +14,9 @@ __package__ = "aas-http-client"
|
|
|
14
14
|
|
|
15
15
|
from aas_http_client.core.version_check import check_for_update
|
|
16
16
|
from aas_http_client.client import create_client_by_config, create_client_by_url, AasHttpClient
|
|
17
|
+
from aas_http_client.utilities import model_builder
|
|
18
|
+
from aas_http_client.wrapper.sdk_wrapper import create_wrapper_by_config, create_wrapper_by_url, SdkWrapper
|
|
17
19
|
|
|
18
20
|
check_for_update()
|
|
19
21
|
|
|
20
|
-
__all__ = ["create_client_by_config", "create_client_by_url", "AasHttpClient"]
|
|
22
|
+
__all__ = ["create_client_by_config", "create_client_by_url", "AasHttpClient", "model_builder", "create_wrapper_by_config", "create_wrapper_by_url", "SdkWrapper"]
|
aas_http_client/client.py
CHANGED
|
@@ -166,7 +166,7 @@ class AasHttpClient(BaseModel):
|
|
|
166
166
|
|
|
167
167
|
return True
|
|
168
168
|
|
|
169
|
-
def
|
|
169
|
+
def put_shells_submodels_by_id(self, aas_id: str, submodel_id: str, submodel_data: dict) -> bool:
|
|
170
170
|
"""Update a submodel by its ID for a specific Asset Administration Shell (AAS).
|
|
171
171
|
|
|
172
172
|
:param aas_id: ID of the AAS to update the submodel for
|
|
@@ -257,7 +257,7 @@ class AasHttpClient(BaseModel):
|
|
|
257
257
|
ref_dict_string = response.content.decode("utf-8")
|
|
258
258
|
return json.loads(ref_dict_string, cls=basyx.aas.adapter.json.AASFromJsonDecoder)
|
|
259
259
|
|
|
260
|
-
def
|
|
260
|
+
def get_shells_submodels_by_id(self, aas_id: str, submodel_id: str) -> Submodel | None:
|
|
261
261
|
"""Get a submodel by its ID for a specific Asset Administration Shell (AAS).
|
|
262
262
|
|
|
263
263
|
:param aas_id: ID of the AAS to retrieve the submodel from
|
|
@@ -268,6 +268,7 @@ class AasHttpClient(BaseModel):
|
|
|
268
268
|
decoded_submodel_id: str = decode_base_64(submodel_id)
|
|
269
269
|
|
|
270
270
|
url = f"{self.base_url}/shells/{decoded_aas_id}/submodels/{decoded_submodel_id}"
|
|
271
|
+
#/shells/{aasIdentifier}/submodels/{submodelIdentifier}
|
|
271
272
|
|
|
272
273
|
try:
|
|
273
274
|
response = self._session.get(url, headers=HEADERS, timeout=self.time_out)
|
|
@@ -307,7 +308,7 @@ class AasHttpClient(BaseModel):
|
|
|
307
308
|
|
|
308
309
|
return True
|
|
309
310
|
|
|
310
|
-
def post_submodels(self, submodel_data: dict) ->
|
|
311
|
+
def post_submodels(self, submodel_data: dict) -> dict:
|
|
311
312
|
"""Post a submodel to the REST API.
|
|
312
313
|
|
|
313
314
|
:param submodel_data: Json data of the Submodel to post
|
|
@@ -327,9 +328,10 @@ class AasHttpClient(BaseModel):
|
|
|
327
328
|
logger.error(f"Error call REST API: {e}")
|
|
328
329
|
return False
|
|
329
330
|
|
|
330
|
-
|
|
331
|
+
content = response.content.decode("utf-8")
|
|
332
|
+
return json.loads(content)
|
|
331
333
|
|
|
332
|
-
def
|
|
334
|
+
def put_submodels_by_id(self, identifier: str, submodel_data: dict) -> bool:
|
|
333
335
|
"""Update a submodel by its ID in the REST API.
|
|
334
336
|
|
|
335
337
|
:param identifier: Identifier of the submodel to update
|
|
@@ -353,30 +355,6 @@ class AasHttpClient(BaseModel):
|
|
|
353
355
|
|
|
354
356
|
return True
|
|
355
357
|
|
|
356
|
-
def get_submodel_by_id(self, submodel_id: str) -> dict | None:
|
|
357
|
-
"""Get a submodel by its ID from the REST API.
|
|
358
|
-
|
|
359
|
-
:param submodel_id: ID of the submodel to retrieve
|
|
360
|
-
:return: Submodel object or None if an error occurred
|
|
361
|
-
"""
|
|
362
|
-
decoded_submodel_id: str = decode_base_64(submodel_id)
|
|
363
|
-
url = f"{self.base_url}/submodels/{decoded_submodel_id}"
|
|
364
|
-
|
|
365
|
-
try:
|
|
366
|
-
response = self._session.get(url, headers=HEADERS, timeout=self.time_out)
|
|
367
|
-
logger.debug(f"Call REST API url '{response.url}'")
|
|
368
|
-
|
|
369
|
-
if response.status_code != STATUS_CODE_200:
|
|
370
|
-
log_response_errors(response)
|
|
371
|
-
return None
|
|
372
|
-
|
|
373
|
-
except requests.exceptions.RequestException as e:
|
|
374
|
-
logger.error(f"Error call REST API: {e}")
|
|
375
|
-
return None
|
|
376
|
-
|
|
377
|
-
content = response.content.decode("utf-8")
|
|
378
|
-
return json.loads(content)
|
|
379
|
-
|
|
380
358
|
def get_submodels(self) -> list[dict] | None:
|
|
381
359
|
"""Get all submodels from the REST API.
|
|
382
360
|
|
|
@@ -34,7 +34,10 @@ def create_base_submodel(id_short: str, namespace: str = "basyx_python_aas_serve
|
|
|
34
34
|
:param description: description of the Submodel, defaults to ""
|
|
35
35
|
:return: Submodel instance
|
|
36
36
|
"""
|
|
37
|
-
|
|
37
|
+
if namespace:
|
|
38
|
+
identifier = f"{namespace}/{id_short}"
|
|
39
|
+
else:
|
|
40
|
+
identifier = id_short
|
|
38
41
|
sm = Submodel(identifier)
|
|
39
42
|
sm.id_short = id_short
|
|
40
43
|
|
|
@@ -101,7 +104,10 @@ def create_base_asset_information(id_short: str, namespace: str = "basyx_python_
|
|
|
101
104
|
:param namespace: namespace of the AssetInformation, defaults to "basyx_python_aas_server"
|
|
102
105
|
:return: AssetInformation instance
|
|
103
106
|
"""
|
|
104
|
-
|
|
107
|
+
if namespace:
|
|
108
|
+
identifier = f"{namespace}/{id_short}"
|
|
109
|
+
else:
|
|
110
|
+
identifier = id_short
|
|
105
111
|
return AssetInformation(AssetKind.INSTANCE, identifier)
|
|
106
112
|
|
|
107
113
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aas-http-client
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
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: MIT License
|
|
@@ -32,20 +32,19 @@ Dynamic: license-file
|
|
|
32
32
|
|
|
33
33
|
<!-- TODO: Go through the readme and enter the information here -->
|
|
34
34
|
|
|
35
|
-
#
|
|
35
|
+
# AAS HTTP Client
|
|
36
36
|
|
|
37
37
|
<div align="center">
|
|
38
38
|
<!-- change this to your projects logo if you have on.
|
|
39
39
|
If you don't have one it might be worth trying chatgpt dall-e to create one for you...
|
|
40
40
|
-->
|
|
41
|
-
<img src="docs/assets/fluid_logo.svg" alt="
|
|
41
|
+
<img src="docs/assets/fluid_logo.svg" alt="aas_http_client" width=500 />
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
46
46
|
[](LICENSES/LicenseRef-em.txt)
|
|
47
47
|
[](https://github.com/engineering-methods/basyx_python_poc/actions)
|
|
48
|
-
[](https://codecov.io/gh/engineering-methods/basyx_python_poc)
|
|
49
48
|
|
|
50
49
|
Proof of concept for a AAS application using the BaSyx Python SDK and Python AAS Server.
|
|
51
50
|
|
|
@@ -58,3 +57,5 @@ Proof of concept for a AAS application using the BaSyx Python SDK and Python AAS
|
|
|
58
57
|
👨⚕️ [Troubleshooting](docs/troubleshooting.md)
|
|
59
58
|
|
|
60
59
|
🤖 [Releases](https://github.com/engineering-methods/basyx_python_poc/releases)
|
|
60
|
+
|
|
61
|
+
📦 [Pypi Packages](https://pypi.org/project/aas-http-client/)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
aas_http_client/__init__.py,sha256=
|
|
2
|
-
aas_http_client/client.py,sha256=
|
|
1
|
+
aas_http_client/__init__.py,sha256=cAr1mQzWp0G0LKtkAOYzc9t95OY3jM3Aj4bKnxx0Dso,901
|
|
2
|
+
aas_http_client/client.py,sha256=KppHWikO21T8Z_JP-bbc9DeyCsgFXQ6xTQoOfETJmcU,20672
|
|
3
3
|
aas_http_client/core/encoder.py,sha256=FS7P0FPakzFsGz70eRFDHQZFA_2nlKLlWIxavtnFrPg,660
|
|
4
4
|
aas_http_client/core/version_check.py,sha256=721Zs3xSRrJTYZtAxkaUWg9LLKtpU7oFM62DzQHZdE4,705
|
|
5
5
|
aas_http_client/demo/demo_process.py,sha256=-9-oQEi_B08W-POl2SVP4COodGPHN3mTw9rrPgLLpeY,2170
|
|
6
6
|
aas_http_client/demo/logging_handler.py,sha256=VJtZ4u3x_LhYZQtfNck7FuXhGFZm7gid0uDhvf9GjJ8,5596
|
|
7
7
|
aas_http_client/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
aas_http_client/utilities/model_builder.py,sha256=
|
|
8
|
+
aas_http_client/utilities/model_builder.py,sha256=jOFTvZPDG08VgrkkRgw0SZz1e_NjVi_Kx2Ty8lqp35I,3886
|
|
9
9
|
aas_http_client/wrapper/python_sdk_wrapper_tmp.py,sha256=J1ze7TXKMiOjA5dDVNrc-GRoxQ_9r7rU8qW8C0yErG0,24206
|
|
10
10
|
aas_http_client/wrapper/sdk_wrapper.py,sha256=sUfdawn9TWNbs7YELBTuMKBhiqd_eeQwk-AmzPWgLII,11117
|
|
11
|
-
aas_http_client-0.1.
|
|
12
|
-
aas_http_client-0.1.
|
|
13
|
-
aas_http_client-0.1.
|
|
14
|
-
aas_http_client-0.1.
|
|
15
|
-
aas_http_client-0.1.
|
|
11
|
+
aas_http_client-0.1.7.dist-info/licenses/LICENSE,sha256=simqYMD2P9Ikm0Kh9n7VGNpaVcm2TMVVQmECYZ_xVZ8,1065
|
|
12
|
+
aas_http_client-0.1.7.dist-info/METADATA,sha256=WwFnZPlDsH_T8MLPyYvaFPM2PpX8XSl5yUUscqiuMrI,2654
|
|
13
|
+
aas_http_client-0.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
aas_http_client-0.1.7.dist-info/top_level.txt,sha256=vzvoz2vjeTLwpuz-Y-eEfoQ7T3byoaKshVlFMFH5NaM,16
|
|
15
|
+
aas_http_client-0.1.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|