aas-http-client 1.2.4__tar.gz → 1.2.6__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.
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/PKG-INFO +1 -1
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/client/aas_client.py +16 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/client/implementations/experimental_implementation.py +77 -10
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/client/implementations/shell_implementation.py +64 -15
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/wrapper/sdk_wrapper.py +8 -0
- aas_http_client-1.2.6/aas_http_client/utilities/constants.py +8 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client.egg-info/PKG-INFO +1 -1
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client.egg-info/SOURCES.txt +1 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/pyproject.toml +1 -1
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/LICENSE +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/README.md +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/__init__.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/Configuration/config_classes.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/client/implementations/__init__.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/client/implementations/authentication.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/client/implementations/shell_registry_implementation.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/client/implementations/sm_implementation.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/client/implementations/sm_registry_implementation.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/wrapper/attachment.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/wrapper/pagination.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/demo/demo_process.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/demo/logging_handler.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/utilities/__init__.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/utilities/encoder.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/utilities/http_helper.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/utilities/model_builder.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/utilities/sdk_tools.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/utilities/version_check.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client.egg-info/dependency_links.txt +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client.egg-info/requires.txt +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client.egg-info/top_level.txt +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/setup.cfg +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/tests/test_client.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/tests/test_client_reg.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/tests/test_sdk_tools.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/tests/test_utils.py +0 -0
- {aas_http_client-1.2.4 → aas_http_client-1.2.6}/tests/test_wrapper.py +0 -0
{aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/client/aas_client.py
RENAMED
|
@@ -22,6 +22,7 @@ from aas_http_client.classes.client.implementations import (
|
|
|
22
22
|
get_token,
|
|
23
23
|
)
|
|
24
24
|
from aas_http_client.classes.Configuration.config_classes import AuthenticationConfig
|
|
25
|
+
from aas_http_client.utilities.constants import LogIntensity
|
|
25
26
|
from aas_http_client.utilities.http_helper import (
|
|
26
27
|
STATUS_CODE_200,
|
|
27
28
|
STATUS_CODE_201,
|
|
@@ -75,6 +76,7 @@ class AasHttpClient(BaseModel):
|
|
|
75
76
|
experimental: ExperimentalImplementation | None = Field(default=None)
|
|
76
77
|
submodel_registry: SubmodelRegistryImplementation | None = Field(default=None)
|
|
77
78
|
_cached_token: TokenData | None = PrivateAttr(default=None)
|
|
79
|
+
_log_intensity: LogIntensity = PrivateAttr(default=LogIntensity.High)
|
|
78
80
|
|
|
79
81
|
def initialize(self):
|
|
80
82
|
"""Initialize the AasHttpClient with the given URL, username and password."""
|
|
@@ -107,6 +109,20 @@ class AasHttpClient(BaseModel):
|
|
|
107
109
|
self.submodel_registry = SubmodelRegistryImplementation(self)
|
|
108
110
|
self.experimental = ExperimentalImplementation(self)
|
|
109
111
|
|
|
112
|
+
def set_log_intensity(self, intensity: LogIntensity):
|
|
113
|
+
"""Set the log intensity level for the client.
|
|
114
|
+
|
|
115
|
+
:param intensity: LogIntensity level to set (Standard or High)
|
|
116
|
+
"""
|
|
117
|
+
self._log_intensity = intensity
|
|
118
|
+
|
|
119
|
+
def get_log_intensity(self) -> LogIntensity:
|
|
120
|
+
"""Get the log intensity level for the client.
|
|
121
|
+
|
|
122
|
+
:return: The current LogIntensity level (Standard or High)
|
|
123
|
+
"""
|
|
124
|
+
return self._log_intensity
|
|
125
|
+
|
|
110
126
|
def get_auth_method(self) -> AuthMethod:
|
|
111
127
|
"""Get the authentication method used by the client.
|
|
112
128
|
|
|
@@ -5,6 +5,8 @@ import mimetypes
|
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
from typing import TYPE_CHECKING
|
|
7
7
|
|
|
8
|
+
from aas_http_client.utilities.constants import LogIntensity
|
|
9
|
+
|
|
8
10
|
if TYPE_CHECKING:
|
|
9
11
|
from aas_http_client.classes.client.aas_client import AasHttpClient
|
|
10
12
|
|
|
@@ -14,6 +16,7 @@ from pydantic import BaseModel
|
|
|
14
16
|
from aas_http_client.utilities.encoder import encode_base_64
|
|
15
17
|
from aas_http_client.utilities.http_helper import (
|
|
16
18
|
STATUS_CODE_200,
|
|
19
|
+
STATUS_CODE_201,
|
|
17
20
|
STATUS_CODE_204,
|
|
18
21
|
STATUS_CODE_404,
|
|
19
22
|
log_response,
|
|
@@ -49,7 +52,11 @@ class ExperimentalImplementation(BaseModel):
|
|
|
49
52
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
50
53
|
|
|
51
54
|
if response.status_code == STATUS_CODE_404:
|
|
52
|
-
|
|
55
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
56
|
+
_logger.warning("Concept descriptions not found.")
|
|
57
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
58
|
+
_logger.debug("Concept descriptions not found.")
|
|
59
|
+
|
|
53
60
|
_logger.debug(response.text)
|
|
54
61
|
return None
|
|
55
62
|
|
|
@@ -79,7 +86,11 @@ class ExperimentalImplementation(BaseModel):
|
|
|
79
86
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
80
87
|
|
|
81
88
|
if response.status_code == STATUS_CODE_404:
|
|
82
|
-
|
|
89
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
90
|
+
_logger.warning(f"Concept description with id '{concept_description_identifier}' not found.")
|
|
91
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
92
|
+
_logger.debug(f"Concept description with id '{concept_description_identifier}' not found.")
|
|
93
|
+
|
|
83
94
|
_logger.debug(response.text)
|
|
84
95
|
return None
|
|
85
96
|
|
|
@@ -109,11 +120,49 @@ class ExperimentalImplementation(BaseModel):
|
|
|
109
120
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
110
121
|
|
|
111
122
|
if response.status_code == STATUS_CODE_404:
|
|
112
|
-
|
|
123
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
124
|
+
_logger.warning("Concept descriptions endpoint not found.")
|
|
125
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
126
|
+
_logger.debug("Concept descriptions endpoint not found.")
|
|
127
|
+
|
|
113
128
|
_logger.debug(response.text)
|
|
114
129
|
return False
|
|
115
130
|
|
|
116
|
-
if response.status_code !=
|
|
131
|
+
if response.status_code != STATUS_CODE_201:
|
|
132
|
+
log_response(response)
|
|
133
|
+
return False
|
|
134
|
+
|
|
135
|
+
except requests.exceptions.RequestException as e:
|
|
136
|
+
_logger.error(f"Error calling REST API: {e}")
|
|
137
|
+
return False
|
|
138
|
+
|
|
139
|
+
return True
|
|
140
|
+
|
|
141
|
+
# DELETE /concept-descriptions/{conceptDescriptionIdentifier}
|
|
142
|
+
def delete_concept_description_by_id(self, concept_description_identifier: str) -> bool:
|
|
143
|
+
"""Deletes a specific concept description by its identifier. Experimental feature - may not be supported by all servers.
|
|
144
|
+
|
|
145
|
+
:param concept_description_identifier: The unique identifier of the concept description
|
|
146
|
+
:return: True if deletion was successful, False otherwise
|
|
147
|
+
"""
|
|
148
|
+
url = f"{self._client.base_url}/concept-descriptions/{concept_description_identifier}"
|
|
149
|
+
|
|
150
|
+
self._client.set_token() # ensures Authorization header is set
|
|
151
|
+
|
|
152
|
+
try:
|
|
153
|
+
response = self._session.delete(url, timeout=self._client.time_out)
|
|
154
|
+
_logger.debug(f"Call REST API url '{response.url}'")
|
|
155
|
+
|
|
156
|
+
if response.status_code == STATUS_CODE_404:
|
|
157
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
158
|
+
_logger.warning(f"Concept description with id '{concept_description_identifier}' not found.")
|
|
159
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
160
|
+
_logger.debug(f"Concept description with id '{concept_description_identifier}' not found.")
|
|
161
|
+
|
|
162
|
+
_logger.debug(response.text)
|
|
163
|
+
return False
|
|
164
|
+
|
|
165
|
+
if response.status_code != STATUS_CODE_204:
|
|
117
166
|
log_response(response)
|
|
118
167
|
return False
|
|
119
168
|
|
|
@@ -143,9 +192,15 @@ class ExperimentalImplementation(BaseModel):
|
|
|
143
192
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
144
193
|
|
|
145
194
|
if response.status_code == STATUS_CODE_404:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
195
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
196
|
+
_logger.warning(
|
|
197
|
+
f"Submodel with id '{submodel_identifier}' or Submodel element with IDShort path '{id_short_path}' or file content not found."
|
|
198
|
+
)
|
|
199
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
200
|
+
_logger.debug(
|
|
201
|
+
f"Submodel with id '{submodel_identifier}' or Submodel element with IDShort path '{id_short_path}' or file content not found."
|
|
202
|
+
)
|
|
203
|
+
|
|
149
204
|
_logger.debug(response.text)
|
|
150
205
|
return None
|
|
151
206
|
|
|
@@ -189,7 +244,11 @@ class ExperimentalImplementation(BaseModel):
|
|
|
189
244
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
190
245
|
|
|
191
246
|
if response.status_code == STATUS_CODE_404:
|
|
192
|
-
|
|
247
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
248
|
+
_logger.warning(f"Submodel with id '{submodel_identifier}' or Submodel element with IDShort path '{id_short_path}' not found.")
|
|
249
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
250
|
+
_logger.debug(f"Submodel with id '{submodel_identifier}' or Submodel element with IDShort path '{id_short_path}' not found.")
|
|
251
|
+
|
|
193
252
|
_logger.debug(response.text)
|
|
194
253
|
return False
|
|
195
254
|
|
|
@@ -234,7 +293,11 @@ class ExperimentalImplementation(BaseModel):
|
|
|
234
293
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
235
294
|
|
|
236
295
|
if response.status_code == STATUS_CODE_404:
|
|
237
|
-
|
|
296
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
297
|
+
_logger.warning(f"Submodel with id '{submodel_identifier}' or Submodel element with IDShort path '{id_short_path}' not found.")
|
|
298
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
299
|
+
_logger.debug(f"Submodel with id '{submodel_identifier}' or Submodel element with IDShort path '{id_short_path}' not found.")
|
|
300
|
+
|
|
238
301
|
_logger.debug(response.text)
|
|
239
302
|
return False
|
|
240
303
|
|
|
@@ -269,7 +332,11 @@ class ExperimentalImplementation(BaseModel):
|
|
|
269
332
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
270
333
|
|
|
271
334
|
if response.status_code == 404:
|
|
272
|
-
|
|
335
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
336
|
+
_logger.warning(f"Submodel with id '{submodel_identifier}' or Submodel element with IDShort path '{id_short_path}' not found.")
|
|
337
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
338
|
+
_logger.debug(f"Submodel with id '{submodel_identifier}' or Submodel element with IDShort path '{id_short_path}' not found.")
|
|
339
|
+
|
|
273
340
|
return False
|
|
274
341
|
|
|
275
342
|
if response.status_code != STATUS_CODE_200:
|
|
@@ -12,6 +12,7 @@ from pydantic import BaseModel
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
13
13
|
from aas_http_client.classes.client.aas_client import AasHttpClient
|
|
14
14
|
|
|
15
|
+
from aas_http_client.utilities.constants import LogIntensity
|
|
15
16
|
from aas_http_client.utilities.encoder import encode_base_64
|
|
16
17
|
from aas_http_client.utilities.http_helper import (
|
|
17
18
|
STATUS_CODE_200,
|
|
@@ -34,7 +35,7 @@ class ShellRepoImplementation(BaseModel):
|
|
|
34
35
|
session = client.get_session()
|
|
35
36
|
if session is None:
|
|
36
37
|
raise ValueError(
|
|
37
|
-
"HTTP session is not initialized in the client. Call 'initialize()' method of the client before creating
|
|
38
|
+
"HTTP session is not initialized in the client. Call 'initialize()' method of the client before creating ShellRepoImplementation instance."
|
|
38
39
|
)
|
|
39
40
|
|
|
40
41
|
self._session: requests.Session = session
|
|
@@ -58,7 +59,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
58
59
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
59
60
|
|
|
60
61
|
if response.status_code == STATUS_CODE_404:
|
|
61
|
-
|
|
62
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
63
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
64
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
65
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
66
|
+
|
|
62
67
|
_logger.debug(response.text)
|
|
63
68
|
return None
|
|
64
69
|
|
|
@@ -92,12 +97,16 @@ class ShellRepoImplementation(BaseModel):
|
|
|
92
97
|
response = self._session.put(url, json=request_body, timeout=self._client.time_out)
|
|
93
98
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
94
99
|
|
|
95
|
-
if response.status_code == STATUS_CODE_404:
|
|
96
|
-
|
|
100
|
+
if response.status_code == STATUS_CODE_404: #
|
|
101
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
102
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
103
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
104
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
105
|
+
|
|
97
106
|
_logger.debug(response.text)
|
|
98
107
|
return False
|
|
99
108
|
|
|
100
|
-
if response.status_code
|
|
109
|
+
if response.status_code != STATUS_CODE_204:
|
|
101
110
|
log_response(response)
|
|
102
111
|
return False
|
|
103
112
|
|
|
@@ -126,7 +135,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
126
135
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
127
136
|
|
|
128
137
|
if response.status_code == STATUS_CODE_404:
|
|
129
|
-
|
|
138
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
139
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
140
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
141
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
142
|
+
|
|
130
143
|
_logger.debug(response.text)
|
|
131
144
|
return False
|
|
132
145
|
|
|
@@ -159,7 +172,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
159
172
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
160
173
|
|
|
161
174
|
if response.status_code == STATUS_CODE_404:
|
|
162
|
-
|
|
175
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
176
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or thumbnail file not found.")
|
|
177
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
178
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or thumbnail file not found.")
|
|
179
|
+
|
|
163
180
|
_logger.debug(response.text)
|
|
164
181
|
return None
|
|
165
182
|
|
|
@@ -224,7 +241,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
224
241
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
225
242
|
|
|
226
243
|
if response.status_code == STATUS_CODE_404:
|
|
227
|
-
|
|
244
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
245
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
246
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
247
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
248
|
+
|
|
228
249
|
_logger.debug(response.text)
|
|
229
250
|
return False
|
|
230
251
|
|
|
@@ -258,7 +279,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
258
279
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
259
280
|
|
|
260
281
|
if response.status_code == STATUS_CODE_404:
|
|
261
|
-
|
|
282
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
283
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or thumbnail file not found.")
|
|
284
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
285
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or thumbnail file not found.")
|
|
286
|
+
|
|
262
287
|
_logger.debug(response.text)
|
|
263
288
|
return False
|
|
264
289
|
|
|
@@ -370,7 +395,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
370
395
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
371
396
|
|
|
372
397
|
if response.status_code == STATUS_CODE_404:
|
|
373
|
-
|
|
398
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
399
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
400
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
401
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
402
|
+
|
|
374
403
|
_logger.debug(response.text)
|
|
375
404
|
return None
|
|
376
405
|
|
|
@@ -405,7 +434,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
405
434
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
406
435
|
|
|
407
436
|
if response.status_code == STATUS_CODE_404:
|
|
408
|
-
|
|
437
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
438
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
439
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
440
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
441
|
+
|
|
409
442
|
_logger.debug(response.text)
|
|
410
443
|
return None
|
|
411
444
|
|
|
@@ -441,7 +474,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
441
474
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
442
475
|
|
|
443
476
|
if response.status_code == STATUS_CODE_404:
|
|
444
|
-
|
|
477
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
478
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
|
|
479
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
480
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
|
|
481
|
+
|
|
445
482
|
_logger.debug(response.text)
|
|
446
483
|
return False
|
|
447
484
|
|
|
@@ -479,7 +516,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
479
516
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
480
517
|
|
|
481
518
|
if response.status_code == STATUS_CODE_404:
|
|
482
|
-
|
|
519
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
520
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
|
|
521
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
522
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
|
|
523
|
+
|
|
483
524
|
_logger.debug(response.text)
|
|
484
525
|
return False
|
|
485
526
|
|
|
@@ -512,7 +553,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
512
553
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
513
554
|
|
|
514
555
|
if response.status_code == STATUS_CODE_404:
|
|
515
|
-
|
|
556
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
557
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
558
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
559
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
|
|
560
|
+
|
|
516
561
|
_logger.debug(response.text)
|
|
517
562
|
return None
|
|
518
563
|
|
|
@@ -548,7 +593,11 @@ class ShellRepoImplementation(BaseModel):
|
|
|
548
593
|
_logger.debug(f"Call REST API url '{response.url}'")
|
|
549
594
|
|
|
550
595
|
if response.status_code == STATUS_CODE_404:
|
|
551
|
-
|
|
596
|
+
if self._client.get_log_intensity() == LogIntensity.High:
|
|
597
|
+
_logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
|
|
598
|
+
elif self._client.get_log_intensity() == LogIntensity.Standard:
|
|
599
|
+
_logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
|
|
600
|
+
|
|
552
601
|
_logger.debug(response.text)
|
|
553
602
|
return None
|
|
554
603
|
|
{aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/wrapper/sdk_wrapper.py
RENAMED
|
@@ -21,6 +21,7 @@ from aas_http_client.classes.wrapper.pagination import (
|
|
|
21
21
|
create_submodel_element_paging_data,
|
|
22
22
|
create_submodel_paging_data,
|
|
23
23
|
)
|
|
24
|
+
from aas_http_client.utilities.constants import LogIntensity
|
|
24
25
|
from aas_http_client.utilities.sdk_tools import convert_to_dict as _to_dict
|
|
25
26
|
from aas_http_client.utilities.sdk_tools import convert_to_object as _to_object
|
|
26
27
|
|
|
@@ -123,6 +124,13 @@ class SdkWrapper:
|
|
|
123
124
|
self._client = client
|
|
124
125
|
self.base_url = client.base_url
|
|
125
126
|
|
|
127
|
+
def set_log_intensity(self, intensity: LogIntensity):
|
|
128
|
+
"""Sets the log intensity level for the client.
|
|
129
|
+
|
|
130
|
+
:param intensity: LogIntensity level to set (Standard or High)
|
|
131
|
+
"""
|
|
132
|
+
self._client.set_log_intensity(intensity)
|
|
133
|
+
|
|
126
134
|
def set_encoded_ids(self, encoded_ids: IdEncoding):
|
|
127
135
|
"""Sets whether to use encoded IDs for API requests.
|
|
128
136
|
|
|
@@ -22,6 +22,7 @@ aas_http_client/classes/wrapper/sdk_wrapper.py
|
|
|
22
22
|
aas_http_client/demo/demo_process.py
|
|
23
23
|
aas_http_client/demo/logging_handler.py
|
|
24
24
|
aas_http_client/utilities/__init__.py
|
|
25
|
+
aas_http_client/utilities/constants.py
|
|
25
26
|
aas_http_client/utilities/encoder.py
|
|
26
27
|
aas_http_client/utilities/http_helper.py
|
|
27
28
|
aas_http_client/utilities/model_builder.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "aas-http-client"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.6"
|
|
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
|
|
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-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/wrapper/attachment.py
RENAMED
|
File without changes
|
{aas_http_client-1.2.4 → aas_http_client-1.2.6}/aas_http_client/classes/wrapper/pagination.py
RENAMED
|
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-1.2.4 → aas_http_client-1.2.6}/aas_http_client.egg-info/dependency_links.txt
RENAMED
|
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
|