aas-http-client 0.3.0__py3-none-any.whl → 0.3.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 aas-http-client might be problematic. Click here for more details.
- aas_http_client/client.py +26 -1
- aas_http_client/wrapper/sdk_wrapper.py +0 -1
- {aas_http_client-0.3.0.dist-info → aas_http_client-0.3.1.dist-info}/METADATA +1 -1
- {aas_http_client-0.3.0.dist-info → aas_http_client-0.3.1.dist-info}/RECORD +7 -7
- {aas_http_client-0.3.0.dist-info → aas_http_client-0.3.1.dist-info}/WHEEL +0 -0
- {aas_http_client-0.3.0.dist-info → aas_http_client-0.3.1.dist-info}/licenses/LICENSE +0 -0
- {aas_http_client-0.3.0.dist-info → aas_http_client-0.3.1.dist-info}/top_level.txt +0 -0
aas_http_client/client.py
CHANGED
|
@@ -109,7 +109,7 @@ class AasHttpClient(BaseModel):
|
|
|
109
109
|
url = f"{self.base_url}/shells"
|
|
110
110
|
|
|
111
111
|
try:
|
|
112
|
-
response = self._session.get(url, headers=HEADERS, timeout=
|
|
112
|
+
response = self._session.get(url, headers=HEADERS, timeout=10)
|
|
113
113
|
logger.debug(f"Call REST API url '{response.url}'")
|
|
114
114
|
|
|
115
115
|
if response.status_code != STATUS_CODE_200:
|
|
@@ -536,6 +536,31 @@ class AasHttpClient(BaseModel):
|
|
|
536
536
|
content = response.content.decode("utf-8")
|
|
537
537
|
return json.loads(content)
|
|
538
538
|
|
|
539
|
+
def delete_submodel_element_by_path_submodel_repo(self, submodel_id: str, submodel_element_path: str):
|
|
540
|
+
"""Deletes a submodel element at a specified path within the submodel elements hierarchy.
|
|
541
|
+
|
|
542
|
+
:param submodel_id: Encoded ID of the Submodel to delete submodel element from
|
|
543
|
+
:param submodel_element_path: Path of the Submodel element to delete
|
|
544
|
+
:return: True if the deletion was successful, False otherwise
|
|
545
|
+
"""
|
|
546
|
+
decoded_submodel_id: str = decode_base_64(submodel_id)
|
|
547
|
+
|
|
548
|
+
url = f"{self.base_url}/submodels/{decoded_submodel_id}/submodel-elements/{submodel_element_path}"
|
|
549
|
+
|
|
550
|
+
try:
|
|
551
|
+
response = self._session.delete(url, headers=HEADERS, timeout=self.time_out)
|
|
552
|
+
logger.debug(f"Call REST API url '{response.url}'")
|
|
553
|
+
|
|
554
|
+
if response.status_code != STATUS_CODE_204:
|
|
555
|
+
log_response_errors(response)
|
|
556
|
+
return False
|
|
557
|
+
|
|
558
|
+
except requests.exceptions.RequestException as e:
|
|
559
|
+
logger.error(f"Error call REST API: {e}")
|
|
560
|
+
return False
|
|
561
|
+
|
|
562
|
+
return True
|
|
563
|
+
|
|
539
564
|
|
|
540
565
|
# endregion
|
|
541
566
|
|
|
@@ -270,7 +270,6 @@ class SdkWrapper:
|
|
|
270
270
|
def _to_object(content: dict) -> Any | None:
|
|
271
271
|
try:
|
|
272
272
|
dict_string = json.dumps(content)
|
|
273
|
-
print(dict_string)
|
|
274
273
|
return json.loads(dict_string, cls=basyx.aas.adapter.json.AASFromJsonDecoder)
|
|
275
274
|
except Exception as e:
|
|
276
275
|
logger.error(f"Decoding error: {e}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aas-http-client
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Generic python HTTP client for communication 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
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
aas_http_client/__init__.py,sha256=cAr1mQzWp0G0LKtkAOYzc9t95OY3jM3Aj4bKnxx0Dso,901
|
|
2
|
-
aas_http_client/client.py,sha256=
|
|
2
|
+
aas_http_client/client.py,sha256=neuEMk1lyOHOgVv3OBzNeXDWEtkN4qfox-hMRjtDWHM,25350
|
|
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=6sN_N3QbA4iLUmzeg1Y_XOwVAuDNtwkR4grAg7EkjWM,3301
|
|
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
8
|
aas_http_client/utilities/model_builder.py,sha256=EUqVvKgXiyJNtyUeFrL6ronfF4hiF1KCipxSaLj6EiE,4465
|
|
9
|
-
aas_http_client/wrapper/sdk_wrapper.py,sha256=
|
|
10
|
-
aas_http_client-0.3.
|
|
11
|
-
aas_http_client-0.3.
|
|
12
|
-
aas_http_client-0.3.
|
|
13
|
-
aas_http_client-0.3.
|
|
14
|
-
aas_http_client-0.3.
|
|
9
|
+
aas_http_client/wrapper/sdk_wrapper.py,sha256=pphxkTwnaoG44hOqelwnqBWupGfDX2ExBDhAdZNFQuQ,13512
|
|
10
|
+
aas_http_client-0.3.1.dist-info/licenses/LICENSE,sha256=ayt4HY-Tjoe1Uvj47j6UdNq8mEufKcKFangurChIHxQ,5990
|
|
11
|
+
aas_http_client-0.3.1.dist-info/METADATA,sha256=LAC3u23U1X84glQ5zg77p3oPn-pl1mAOGHOgYaWsTdU,10467
|
|
12
|
+
aas_http_client-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
aas_http_client-0.3.1.dist-info/top_level.txt,sha256=vzvoz2vjeTLwpuz-Y-eEfoQ7T3byoaKshVlFMFH5NaM,16
|
|
14
|
+
aas_http_client-0.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|