AAS HTTP Client Documentation
Loading...
Searching...
No Matches
shell_implementation.py
Go to the documentation of this file.
1"""Implementation of Asset Administration Shell related API calls."""
2
3import json
4import logging
5import mimetypes
6from pathlib import Path
7from typing import TYPE_CHECKING, Any
8
9import requests
10from pydantic import BaseModel
11
12if TYPE_CHECKING:
13 from aas_http_client.classes.client.aas_client import AasHttpClient
14
15from aas_http_client.utilities.constants import LogIntensity
16from aas_http_client.utilities.encoder import encode_base_64
18 STATUS_CODE_200,
19 STATUS_CODE_201,
20 STATUS_CODE_204,
21 STATUS_CODE_404,
22 log_response,
23)
24
25_logger = logging.getLogger(__name__)
26
27
28class ShellRepoImplementation(BaseModel):
29 """Implementation of Asset Administration Shell related API calls."""
30
31 def __init__(self, client: "AasHttpClient"):
32 """Initializes the ShellImplementation with the given parameters."""
33 self._client = client
34
35 session = client.get_session()
36 if session is None:
37 raise ValueError(
38 "HTTP session is not initialized in the client. Call 'initialize()' method of the client before creating ShellRepoImplementation instance."
39 )
40
41 self._session: requests.Session = session
42
43 # GET /shells/{aasIdentifier}
44 def get_asset_administration_shell_by_id(self, aas_identifier: str) -> dict | None:
45 """Returns a specific Asset Administration Shell.
46
47 :param aas_identifier: The Asset Administration Shells unique id
48 :return: Asset Administration Shells data or None if an error occurred
49 """
50 if not self._client.encoded_ids:
51 aas_identifier = encode_base_64(aas_identifier)
53 url = f"{self._client.base_url}/shells/{aas_identifier}"
54
55 self._client.set_token()
56
57 try:
58 response = self._session.get(url, timeout=self._client.time_out)
59 _logger.debug(f"Call REST API url '{response.url}'")
60
61 if response.status_code == STATUS_CODE_404:
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
67 return None
68
69 if response.status_code != STATUS_CODE_200:
70 log_response(response)
71 return None
72
73 except requests.exceptions.RequestException as e:
74 _logger.error(f"Error call REST API: {e}")
75 return None
76
77 content = response.content.decode("utf-8")
78 return json.loads(content)
79
80 # PUT /shells/{aasIdentifier}
81 def put_asset_administration_shell_by_id(self, aas_identifier: str, request_body: dict) -> bool:
82 """Creates or replaces an existing Asset Administration Shell.
83
84 :param aas_identifier: The Asset Administration Shells unique id
85 :param request_body: Json data of the Asset Administration Shell data to put
86 :return: True if the update was successful, False otherwise
87 """
88 if not self._client.encoded_ids:
89 aas_identifier = encode_base_64(aas_identifier)
91 url = f"{self._client.base_url}/shells/{aas_identifier}"
92
93 self._client.set_token()
94
95 try:
96 response = self._session.put(url, json=request_body, timeout=self._client.time_out)
97 _logger.debug(f"Call REST API url '{response.url}'")
98
99 if response.status_code == STATUS_CODE_404: #
100 if self._client.get_log_intensity() == LogIntensity.HIGH:
101 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
102 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
103 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
104
105 return False
106
107 if response.status_code != STATUS_CODE_204:
108 log_response(response)
109 return False
110
111 except requests.exceptions.RequestException as e:
112 _logger.error(f"Error call REST API: {e}")
113 return False
114
115 return True
116
117 # DELETE /shells/{aasIdentifier}
118 def delete_asset_administration_shell_by_id(self, aas_identifier: str) -> bool:
119 """Deletes an Asset Administration Shell.
120
121 :param aas_identifier: The Asset Administration Shells unique id
122 :return: True if the deletion was successful, False otherwise
123 """
124 if not self._client.encoded_ids:
125 aas_identifier = encode_base_64(aas_identifier)
127 url = f"{self._client.base_url}/shells/{aas_identifier}"
128
129 self._client.set_token()
130
131 try:
132 response = self._session.delete(url, timeout=self._client.time_out)
133 _logger.debug(f"Call REST API url '{response.url}'")
134
135 if response.status_code == STATUS_CODE_404:
136 if self._client.get_log_intensity() == LogIntensity.HIGH:
137 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
138 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
139 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
140
141 return False
142
143 if response.status_code != STATUS_CODE_204:
144 log_response(response)
145 return False
146
147 except requests.exceptions.RequestException as e:
148 _logger.error(f"Error call REST API: {e}")
149 return False
150
151 return True
152
153 # GET /shells/{aasIdentifier}/asset-information/thumbnail
154 def get_thumbnail_aas_repository(self, aas_identifier: str) -> bytes | None:
155 """Returns the thumbnail of the Asset Administration Shell.
156
157 :param aas_identifier: The Asset Administration Shells unique id
158 :return: Thumbnail file data as bytes (octet-stream) or None if an error occurred
159 """
160 if not self._client.encoded_ids:
161 aas_identifier = encode_base_64(aas_identifier)
163 url = f"{self._client.base_url}/shells/{aas_identifier}/asset-information/thumbnail"
164
165 self._client.set_token()
166
167 try:
168 response = self._session.get(url, timeout=self._client.time_out)
169 _logger.debug(f"Call REST API url '{response.url}'")
170
171 if response.status_code == STATUS_CODE_404:
172 if self._client.get_log_intensity() == LogIntensity.HIGH:
173 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or thumbnail file not found.")
174 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
175 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or thumbnail file not found.")
176
177 return None
178
179 if response.status_code != STATUS_CODE_200:
180 log_response(response)
181 return None
182
183 except requests.exceptions.RequestException as e:
184 _logger.error(f"Error call REST API: {e}")
185 return None
186
187 return response.content
188
189 def put_thumbnail_aas_repository(self, aas_identifier: str, file_name: str, file: Path) -> bool:
190 """Creates or updates the thumbnail of the Asset Administration Shell.
191
192 :param aas_identifier: The Asset Administration Shells unique id
193 :param file_name: The name of the thumbnail file
194 :param file: Path to the thumbnail file to upload as attachment
195 :return: True if the update was successful, False otherwise
196 """
197 if file.exists() is False or not file.is_file():
198 _logger.error(f"Attachment file '{file}' does not exist.")
199 return False
200
201 mime_type, _ = mimetypes.guess_type(file)
202
203 with file.open("rb") as f:
204 file_octet_stream = f.read()
205
206 return self.put_thumbnail_aas_repository_stream(aas_identifier, file_name, file_octet_stream, mime_type or "application/octet-stream")
207
208 # PUT /shells/{aasIdentifier}/asset-information/thumbnail
210 self, aas_identifier: str, file_name: str, file_octet_stream: Any, mime_type: str = "application/octet-stream"
211 ) -> bool:
212 """Creates or updates the thumbnail of the Asset Administration Shell.
213
214 :param aas_identifier: The Asset Administration Shells unique id
215 :param file_name: The name of the thumbnail file
216 :param file_octet_stream: The octet stream of the thumbnail file
217 :param mime_type: The MIME type of the thumbnail file (e.g., "image/png")
218 :return: True if the update was successful, False otherwise
219 """
220 if file_name is None or file_name == "" or file_octet_stream is None or mime_type is None or mime_type == "":
221 _logger.error(f"Attachment file '{file_name}' does not exist.")
222 return False
223
224 if not self._client.encoded_ids:
225 aas_identifier = encode_base_64(aas_identifier)
226
227 url = f"{self._client.base_url}/shells/{aas_identifier}/asset-information/thumbnail"
228
229 params = {"fileName": file_name}
230
231 self._client.set_token()
232
233 try:
234 files: dict[str, tuple[str, Any, str]] = {"file": (file_name, file_octet_stream, mime_type)}
235 response = self._session.put(url, files=files, params=params, timeout=self._client.time_out)
236
237 _logger.debug(f"Call REST API url '{response.url}'")
238
239 if response.status_code == STATUS_CODE_404:
240 if self._client.get_log_intensity() == LogIntensity.HIGH:
241 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
242 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
243 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
244
245 return False
246
247 # original dotnet server delivers 200 instead of 204
248 if response.status_code not in (STATUS_CODE_200, STATUS_CODE_204):
249 log_response(response)
250 return False
251
252 except requests.exceptions.RequestException as e:
253 _logger.error(f"Error call REST API: {e}")
254 return False
255
256 return True
257
258 # DELETE /shells/{aasIdentifier}/asset-information/thumbnail
259 def delete_thumbnail_aas_repository(self, aas_identifier: str) -> bool:
260 """Deletes the thumbnail of the Asset Administration Shell.
261
262 :param aas_identifier: The Asset Administration Shells unique id
263 :return: True if the deletion was successful, False otherwise
264 """
265 if not self._client.encoded_ids:
266 aas_identifier = encode_base_64(aas_identifier)
268 url = f"{self._client.base_url}/shells/{aas_identifier}/asset-information/thumbnail"
269
270 self._client.set_token()
271
272 try:
273 response = self._session.delete(url, timeout=self._client.time_out)
274 _logger.debug(f"Call REST API url '{response.url}'")
275
276 if response.status_code == STATUS_CODE_404:
277 if self._client.get_log_intensity() == LogIntensity.HIGH:
278 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or thumbnail file not found.")
279 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
280 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or thumbnail file not found.")
281
282 return False
283
284 if response.status_code not in (STATUS_CODE_200, STATUS_CODE_204):
285 log_response(response)
286 return False
287
288 except requests.exceptions.RequestException as e:
289 _logger.error(f"Error call REST API: {e}")
290 return False
291
292 return True
293
294 # GET /shells
296 self, asset_ids: list[dict] | None = None, id_short: str = "", limit: int = 100, cursor: str = ""
297 ) -> dict | None:
298 """Returns all Asset Administration Shells.
299
300 :param assetIds: A list of specific Asset identifiers (format: {"identifier": "string", "encodedIdentifier": "string"})
301 :param idShort: The Asset Administration Shells IdShort
302 :param limit: The maximum number of elements in the response array
303 :param cursor: A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
304 :return: List of paginated Asset Administration Shells data or None if an error occurred
305 """
306 url = f"{self._client.base_url}/shells"
307
308 # Build query parameters
309 if asset_ids is None:
310 asset_ids = []
311
312 params: dict[str, Any] = {}
313 if asset_ids is not None and len(asset_ids) > 0:
314 params["assetIds"] = asset_ids
315 if id_short:
316 params["idShort"] = id_short
317 if limit:
318 params["limit"] = str(limit)
319 if cursor:
320 params["cursor"] = cursor
321
322 self._client.set_token()
323
324 try:
325 response = self._session.get(url, timeout=self._client.time_out, params=params)
326 _logger.debug(f"Call REST API url '{response.url}'")
327
328 if response.status_code != STATUS_CODE_200:
329 log_response(response)
330 return None
331
332 except requests.exceptions.RequestException as e:
333 _logger.error(f"Error call REST API: {e}")
334 return None
335
336 content = response.content.decode("utf-8")
337 return json.loads(content)
338
339 # POST /shells
340 def post_asset_administration_shell(self, request_body: dict) -> dict | None:
341 """Creates a new Asset Administration Shell.
342
343 :param request_body: Json data of the Asset Administration Shell to post
344 :return: Response data as a dictionary or None if an error occurred
345 """
346 url = f"{self._client.base_url}/shells"
347
348 self._client.set_token()
349
350 try:
351 response = self._session.post(url, json=request_body, timeout=self._client.time_out)
352 _logger.debug(f"Call REST API url '{response.url}'")
353
354 if response.status_code != STATUS_CODE_201:
355 log_response(response)
356 return None
357
358 except requests.exceptions.RequestException as e:
359 _logger.error(f"Error call REST API: {e}")
360 return None
361
362 content = response.content.decode("utf-8")
363 return json.loads(content)
364
365 # GET /shells/{aasIdentifier}/submodel-refs
366 def get_all_submodel_references_aas_repository(self, aas_identifier: str, limit: int = 100, cursor: str = "") -> dict | None:
367 """Returns all submodel references.
368
369 :param aas_identifier: The Asset Administration Shells unique id
370 :param limit: The maximum number of elements in the response array
371 :param cursor: A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
372 :return: List of Submodel references or None if an error occurred
373 """
374 if not self._client.encoded_ids:
375 aas_identifier = encode_base_64(aas_identifier)
377 url = f"{self._client.base_url}/shells/{aas_identifier}/submodel-refs"
378
379 params: dict[str, str] = {}
380 if limit:
381 params["limit"] = str(limit)
382 if cursor:
383 params["cursor"] = cursor
384
385 self._client.set_token()
386
387 try:
388 response = self._session.get(url, timeout=self._client.time_out, params=params)
389 _logger.debug(f"Call REST API url '{response.url}'")
390
391 if response.status_code == STATUS_CODE_404:
392 if self._client.get_log_intensity() == LogIntensity.HIGH:
393 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
394 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
395 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
396
397 return None
398
399 if response.status_code != STATUS_CODE_200:
400 log_response(response)
401 return None
402
403 except requests.exceptions.RequestException as e:
404 _logger.error(f"Error call REST API: {e}")
405 return None
406
407 content = response.content.decode("utf-8")
408 return json.loads(content)
409
410 # POST /shells/{aasIdentifier}/submodel-refs
411 def post_submodel_reference_aas_repository(self, aas_identifier: str, request_body: dict) -> dict | None:
412 """Creates a submodel reference at the Asset Administration Shell.
413
414 :param aas_identifier: The Asset Administration Shells unique id
415 :param request_body: Reference to the Submodel
416 :return: Response data as a dictionary or None if an error occurred
417 """
418 if not self._client.encoded_ids:
419 aas_identifier = encode_base_64(aas_identifier)
421 url = f"{self._client.base_url}/shells/{aas_identifier}/submodel-refs"
422
423 self._client.set_token()
424
425 try:
426 response = self._session.post(url, json=request_body, timeout=self._client.time_out)
427 _logger.debug(f"Call REST API url '{response.url}'")
428
429 if response.status_code == STATUS_CODE_404:
430 if self._client.get_log_intensity() == LogIntensity.HIGH:
431 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
432 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
433 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
434
435 return None
436
437 if response.status_code != STATUS_CODE_201:
438 log_response(response)
439 return None
440
441 except requests.exceptions.RequestException as e:
442 _logger.error(f"Error call REST API: {e}")
443 return None
444
445 content = response.content.decode("utf-8")
446 return json.loads(content)
447
448 # DELETE /shells/{aasIdentifier}/submodel-refs/{submodelIdentifier}
449 def delete_submodel_reference_by_id_aas_repository(self, aas_identifier: str, submodel_identifier: str) -> bool:
450 """Deletes the submodel reference from the Asset Administration Shell. Does not delete the submodel itself.
451
452 :param aas_identifier: The Asset Administration Shells unique id
453 :param submodel_identifier: The Submodels unique id
454 :return: True if the deletion was successful, False otherwise
455 """
456 if not self._client.encoded_ids:
457 aas_identifier = encode_base_64(aas_identifier)
458 submodel_identifier = encode_base_64(submodel_identifier)
459
460 url = f"{self._client.base_url}/shells/{aas_identifier}/submodel-refs/{submodel_identifier}"
461
462 self._client.set_token()
463
464 try:
465 response = self._session.delete(url, timeout=self._client.time_out)
466 _logger.debug(f"Call REST API url '{response.url}'")
467
468 if response.status_code == STATUS_CODE_404:
469 if self._client.get_log_intensity() == LogIntensity.HIGH:
470 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
471 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
472 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
473
474 return False
475
476 if response.status_code not in (STATUS_CODE_204, STATUS_CODE_200):
477 log_response(response)
478 return False
479
480 except requests.exceptions.RequestException as e:
481 _logger.error(f"Error call REST API: {e}")
482 return False
483
484 return True
485
486 # not supported by Java Server
487
488 # PUT /shells/{aasIdentifier}/submodels/{submodelIdentifier}
489 def put_submodel_by_id_aas_repository(self, aas_identifier: str, submodel_identifier: str, request_body: dict) -> bool:
490 """Updates the Submodel.
491
492 :param aas_identifier: ID of the AAS to update the submodel for
493 :param submodel_identifier: ID of the submodel to update
494 :param request_body: Json data to the Submodel to put
495 :return: True if the update was successful, False otherwise
496 """
497 if not self._client.encoded_ids:
498 aas_identifier = encode_base_64(aas_identifier)
499 submodel_identifier = encode_base_64(submodel_identifier)
500
501 url = f"{self._client.base_url}/shells/{aas_identifier}/submodels/{submodel_identifier}"
502
503 self._client.set_token()
504
505 try:
506 response = self._session.put(url, json=request_body, timeout=self._client.time_out)
507 _logger.debug(f"Call REST API url '{response.url}'")
508
509 if response.status_code == STATUS_CODE_404:
510 if self._client.get_log_intensity() == LogIntensity.HIGH:
511 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
512 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
513 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
514
515 return False
516
517 if response.status_code != STATUS_CODE_204:
518 log_response(response)
519 return False
520
521 except requests.exceptions.RequestException as e:
522 _logger.error(f"Error call REST API: {e}")
523 return False
524
525 return True
526
527 # GET /shells/{aasIdentifier}/$reference
528 def get_asset_administration_shell_by_id_reference_aas_repository(self, aas_identifier: str) -> dict | None:
529 """Returns a specific Asset Administration Shell as a Reference.
530
531 :param aas_identifier: ID of the AAS reference to retrieve
532 :return: Asset Administration Shells reference data or None if an error occurred
533 """
534 if not self._client.encoded_ids:
535 aas_identifier = encode_base_64(aas_identifier)
537 url = f"{self._client.base_url}/shells/{aas_identifier}/$reference"
538
539 self._client.set_token()
540
541 try:
542 response = self._session.get(url, timeout=self._client.time_out)
543 _logger.debug(f"Call REST API url '{response.url}'")
544
545 if response.status_code == STATUS_CODE_404:
546 if self._client.get_log_intensity() == LogIntensity.HIGH:
547 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' not found.")
548 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
549 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' not found.")
550
551 return None
552
553 if response.status_code != STATUS_CODE_200:
554 log_response(response)
555 return None
556
557 except requests.exceptions.RequestException as e:
558 _logger.error(f"Error call REST API: {e}")
559 return None
560
561 ref_dict_string = response.content.decode("utf-8")
562 return json.loads(ref_dict_string)
563
564 # GET /shells/{aasIdentifier}/submodels/{submodelIdentifier}
565 def get_submodel_by_id_aas_repository(self, aas_identifier: str, submodel_identifier: str) -> dict | None:
566 """Returns the Submodel.
567
568 :param aas_identifier: ID of the AAS to retrieve the submodel from
569 :param submodel_identifier: ID of the submodel to retrieve
570 :return: Submodel object or None if an error occurred
571 """
572 if not self._client.encoded_ids:
573 aas_identifier = encode_base_64(aas_identifier)
574 submodel_identifier = encode_base_64(submodel_identifier)
575
576 url = f"{self._client.base_url}/shells/{aas_identifier}/submodels/{submodel_identifier}"
577
578 self._client.set_token()
579
580 try:
581 response = self._session.get(url, timeout=self._client.time_out)
582 _logger.debug(f"Call REST API url '{response.url}'")
583
584 if response.status_code == STATUS_CODE_404:
585 if self._client.get_log_intensity() == LogIntensity.HIGH:
586 _logger.warning(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
587 elif self._client.get_log_intensity() == LogIntensity.STANDARD:
588 _logger.debug(f"Asset Administration Shell with id '{aas_identifier}' or submodel with id '{submodel_identifier}' not found.")
589
590 return None
591
592 if response.status_code != STATUS_CODE_200:
593 log_response(response)
594 return None
595
596 except requests.exceptions.RequestException as e:
597 _logger.error(f"Error call REST API: {e}")
598 return None
599
600 content = response.content.decode("utf-8")
601 return json.loads(content)
Implementation of Asset Administration Shell related API calls.
bool delete_thumbnail_aas_repository(self, str aas_identifier)
Deletes the thumbnail of the Asset Administration Shell.
dict|None post_asset_administration_shell(self, dict request_body)
Creates a new Asset Administration Shell.
dict|None get_all_submodel_references_aas_repository(self, str aas_identifier, int limit=100, str cursor="")
Returns all submodel references.
dict|None get_asset_administration_shell_by_id(self, str aas_identifier)
Returns a specific Asset Administration Shell.
__init__(self, "AasHttpClient" client)
Initializes the ShellImplementation with the given parameters.
bytes|None get_thumbnail_aas_repository(self, str aas_identifier)
Returns the thumbnail of the Asset Administration Shell.
dict|None get_asset_administration_shell_by_id_reference_aas_repository(self, str aas_identifier)
Returns a specific Asset Administration Shell as a Reference.
dict|None get_all_asset_administration_shells(self, list[dict]|None asset_ids=None, str id_short="", int limit=100, str cursor="")
Returns all Asset Administration Shells.
bool put_submodel_by_id_aas_repository(self, str aas_identifier, str submodel_identifier, dict request_body)
Updates the Submodel.
bool delete_asset_administration_shell_by_id(self, str aas_identifier)
Deletes an Asset Administration Shell.
dict|None get_submodel_by_id_aas_repository(self, str aas_identifier, str submodel_identifier)
Returns the Submodel.
bool put_thumbnail_aas_repository_stream(self, str aas_identifier, str file_name, Any file_octet_stream, str mime_type="application/octet-stream")
Creates or updates the thumbnail of the Asset Administration Shell.
dict|None post_submodel_reference_aas_repository(self, str aas_identifier, dict request_body)
Creates a submodel reference at the Asset Administration Shell.
bool delete_submodel_reference_by_id_aas_repository(self, str aas_identifier, str submodel_identifier)
Deletes the submodel reference from the Asset Administration Shell.
bool put_asset_administration_shell_by_id(self, str aas_identifier, dict request_body)
Creates or replaces an existing Asset Administration Shell.
bool put_thumbnail_aas_repository(self, str aas_identifier, str file_name, Path file)
Creates or updates the thumbnail of the Asset Administration Shell.