aas-http-client 0.3.0__tar.gz → 0.3.1__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.

Files changed (21) hide show
  1. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/PKG-INFO +1 -1
  2. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client/client.py +26 -1
  3. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client/wrapper/sdk_wrapper.py +0 -1
  4. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client.egg-info/PKG-INFO +1 -1
  5. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/pyproject.toml +1 -1
  6. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/LICENSE +0 -0
  7. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/README.md +0 -0
  8. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client/__init__.py +0 -0
  9. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client/core/encoder.py +0 -0
  10. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client/core/version_check.py +0 -0
  11. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client/demo/demo_process.py +0 -0
  12. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client/demo/logging_handler.py +0 -0
  13. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client/utilities/__init__.py +0 -0
  14. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client/utilities/model_builder.py +0 -0
  15. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client.egg-info/SOURCES.txt +0 -0
  16. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client.egg-info/dependency_links.txt +0 -0
  17. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client.egg-info/requires.txt +0 -0
  18. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/aas_http_client.egg-info/top_level.txt +0 -0
  19. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/setup.cfg +0 -0
  20. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/tests/test_client.py +0 -0
  21. {aas_http_client-0.3.0 → aas_http_client-0.3.1}/tests/test_wrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-http-client
3
- Version: 0.3.0
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
@@ -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=2)
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.0
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aas-http-client"
7
- version = "0.3.0"
7
+ version = "0.3.1"
8
8
  description = "Generic python HTTP client for communication with various types of AAS servers"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
File without changes