aas-http-client 1.2.3__tar.gz → 1.2.5__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.
Files changed (36) hide show
  1. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/PKG-INFO +1 -1
  2. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/client/implementations/experimental_implementation.py +118 -1
  3. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client.egg-info/PKG-INFO +1 -1
  4. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/pyproject.toml +1 -1
  5. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/LICENSE +0 -0
  6. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/README.md +0 -0
  7. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/__init__.py +0 -0
  8. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/Configuration/config_classes.py +0 -0
  9. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/client/aas_client.py +0 -0
  10. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/client/implementations/__init__.py +0 -0
  11. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/client/implementations/authentication.py +0 -0
  12. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/client/implementations/shell_implementation.py +0 -0
  13. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/client/implementations/shell_registry_implementation.py +0 -0
  14. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/client/implementations/sm_implementation.py +0 -0
  15. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/client/implementations/sm_registry_implementation.py +0 -0
  16. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/wrapper/attachment.py +0 -0
  17. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/wrapper/pagination.py +0 -0
  18. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/classes/wrapper/sdk_wrapper.py +0 -0
  19. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/demo/demo_process.py +0 -0
  20. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/demo/logging_handler.py +0 -0
  21. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/utilities/__init__.py +0 -0
  22. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/utilities/encoder.py +0 -0
  23. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/utilities/http_helper.py +0 -0
  24. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/utilities/model_builder.py +0 -0
  25. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/utilities/sdk_tools.py +0 -0
  26. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client/utilities/version_check.py +0 -0
  27. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client.egg-info/SOURCES.txt +0 -0
  28. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client.egg-info/dependency_links.txt +0 -0
  29. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client.egg-info/requires.txt +0 -0
  30. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/aas_http_client.egg-info/top_level.txt +0 -0
  31. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/setup.cfg +0 -0
  32. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/tests/test_client.py +0 -0
  33. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/tests/test_client_reg.py +0 -0
  34. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/tests/test_sdk_tools.py +0 -0
  35. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/tests/test_utils.py +0 -0
  36. {aas_http_client-1.2.3 → aas_http_client-1.2.5}/tests/test_wrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-http-client
3
- Version: 1.2.3
3
+ Version: 1.2.5
4
4
  Summary: Flexible Python HTTP client for communication with various types of AAS servers.
5
5
  Author-email: Daniel Klein <daniel.klein@em.ag>
6
6
  License: MIT License
@@ -14,6 +14,7 @@ from pydantic import BaseModel
14
14
  from aas_http_client.utilities.encoder import encode_base_64
15
15
  from aas_http_client.utilities.http_helper import (
16
16
  STATUS_CODE_200,
17
+ STATUS_CODE_201,
17
18
  STATUS_CODE_204,
18
19
  STATUS_CODE_404,
19
20
  log_response,
@@ -32,11 +33,127 @@ class ExperimentalImplementation(BaseModel):
32
33
  session = client.get_session()
33
34
  if session is None:
34
35
  raise ValueError(
35
- "HTTP session is not initialized in the client. Call 'initialize()' method of the client before creating SubmodelRegistryImplementation instance."
36
+ "HTTP session is not initialized in the client. Call 'initialize()' method of the client before creating ExperimentalImplementation instance."
36
37
  )
37
38
 
38
39
  self._session: requests.Session = session
39
40
 
41
+ # GET /concept-descriptions
42
+ def get_concept_descriptions(self):
43
+ """Retrieves concept descriptions. Experimental feature - may not be supported by all servers."""
44
+ url = f"{self._client.base_url}/concept-descriptions"
45
+
46
+ self._client.set_token() # ensures Authorization header is set
47
+
48
+ try:
49
+ response = self._session.get(url, timeout=self._client.time_out)
50
+ _logger.debug(f"Call REST API url '{response.url}'")
51
+
52
+ if response.status_code == STATUS_CODE_404:
53
+ _logger.warning("Concept descriptions not found.")
54
+ _logger.debug(response.text)
55
+ return None
56
+
57
+ if response.status_code != STATUS_CODE_200:
58
+ log_response(response)
59
+ return None
60
+
61
+ except requests.exceptions.RequestException as e:
62
+ _logger.error(f"Error calling REST API: {e}")
63
+ return None
64
+
65
+ return response.json()
66
+
67
+ # GET /concept-descriptions/{conceptDescriptionIdentifier}
68
+ def get_concept_description_by_id(self, concept_description_identifier: str):
69
+ """Retrieves a specific concept description by its identifier. Experimental feature - may not be supported by all servers.
70
+
71
+ :param concept_description_identifier: The unique identifier of the concept description
72
+ :return: Concept description data as a dictionary or None if not found
73
+ """
74
+ url = f"{self._client.base_url}/concept-descriptions/{concept_description_identifier}"
75
+
76
+ self._client.set_token() # ensures Authorization header is set
77
+
78
+ try:
79
+ response = self._session.get(url, timeout=self._client.time_out)
80
+ _logger.debug(f"Call REST API url '{response.url}'")
81
+
82
+ if response.status_code == STATUS_CODE_404:
83
+ _logger.warning(f"Concept description with id '{concept_description_identifier}' not found.")
84
+ _logger.debug(response.text)
85
+ return None
86
+
87
+ if response.status_code != STATUS_CODE_200:
88
+ log_response(response)
89
+ return None
90
+
91
+ except requests.exceptions.RequestException as e:
92
+ _logger.error(f"Error calling REST API: {e}")
93
+ return None
94
+
95
+ return response.json()
96
+
97
+ # POST /concept-descriptions
98
+ def post_concept_description(self, concept_description: dict) -> bool:
99
+ """Creates a new concept description. Experimental feature - may not be supported by all servers.
100
+
101
+ :param concept_description: Concept description data as a dictionary
102
+ :return: True if creation was successful, False otherwise
103
+ """
104
+ url = f"{self._client.base_url}/concept-descriptions"
105
+
106
+ self._client.set_token() # ensures Authorization header is set
107
+
108
+ try:
109
+ response = self._session.post(url, json=concept_description, timeout=self._client.time_out)
110
+ _logger.debug(f"Call REST API url '{response.url}'")
111
+
112
+ if response.status_code == STATUS_CODE_404:
113
+ _logger.warning("Concept descriptions endpoint not found.")
114
+ _logger.debug(response.text)
115
+ return False
116
+
117
+ if response.status_code != STATUS_CODE_201:
118
+ log_response(response)
119
+ return False
120
+
121
+ except requests.exceptions.RequestException as e:
122
+ _logger.error(f"Error calling REST API: {e}")
123
+ return False
124
+
125
+ return True
126
+
127
+ # DELETE /concept-descriptions/{conceptDescriptionIdentifier}
128
+ def delete_concept_description_by_id(self, concept_description_identifier: str) -> bool:
129
+ """Deletes a specific concept description by its identifier. Experimental feature - may not be supported by all servers.
130
+
131
+ :param concept_description_identifier: The unique identifier of the concept description
132
+ :return: True if deletion was successful, False otherwise
133
+ """
134
+ url = f"{self._client.base_url}/concept-descriptions/{concept_description_identifier}"
135
+
136
+ self._client.set_token() # ensures Authorization header is set
137
+
138
+ try:
139
+ response = self._session.delete(url, timeout=self._client.time_out)
140
+ _logger.debug(f"Call REST API url '{response.url}'")
141
+
142
+ if response.status_code == STATUS_CODE_404:
143
+ _logger.warning(f"Concept description with id '{concept_description_identifier}' not found.")
144
+ _logger.debug(response.text)
145
+ return False
146
+
147
+ if response.status_code != STATUS_CODE_204:
148
+ log_response(response)
149
+ return False
150
+
151
+ except requests.exceptions.RequestException as e:
152
+ _logger.error(f"Error calling REST API: {e}")
153
+ return False
154
+
155
+ return True
156
+
40
157
  # GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/attachment
41
158
  def get_file_by_path_submodel_repo(self, submodel_identifier: str, id_short_path: str) -> bytes | None:
42
159
  """Downloads file content from a specific submodel element from the Submodel at a specified path. Experimental feature - may not be supported by all servers.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-http-client
3
- Version: 1.2.3
3
+ Version: 1.2.5
4
4
  Summary: Flexible Python HTTP client for communication with various types of AAS servers.
5
5
  Author-email: Daniel Klein <daniel.klein@em.ag>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aas-http-client"
7
- version = "1.2.3"
7
+ version = "1.2.5"
8
8
  description = "Flexible Python HTTP client for communication with various types of AAS servers."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
File without changes