Skip to content

Implement GET/PUT/DELETE for /shells/asset-information/thumbnail - #618

Open
paul-gerber-svg wants to merge 3 commits into
eclipse-basyx:developfrom
rwth-iat:fix/missing-endpoint-493
Open

Implement GET/PUT/DELETE for /shells/asset-information/thumbnail#618
paul-gerber-svg wants to merge 3 commits into
eclipse-basyx:developfrom
rwth-iat:fix/missing-endpoint-493

Conversation

@paul-gerber-svg

Copy link
Copy Markdown
Contributor

Currently, the server endpoint /asset-information/thumbnail is not
implemented; all three methods (GET, PUT, DELETE) are mapped to
self.not_implemented.

According to the AAS Repository Service OpenAPI Specification, the
endpoint should return, replace or delete the thumbnail file of a
selected AAS.

This change implements GET, PUT and DELETE for
/shells/{aasIdentifier}/asset-information/thumbnail according to
the specification. GET returns the thumbnail file referenced by
AssetInformation.default_thumbnail. PUT accepts a
multipart/form-data upload (fileName and file), stores it via
the file store, and updates default_thumbnail accordingly, removing
the previous thumbnail file if the path changes. DELETE removes the
stored file and clears default_thumbnail. All three reject external
(non-local) thumbnail references, since the server cannot serve or
manage files it does not store itself.

Fixes #493

Currently, server endpoint `/asset-information/thumbnail`,
methods=["GET", "PUT", "DELETE"], endpoint=self.not_implemented is
not implemented.

According to the AAS Repository Service OpenAPI Specification, the
endpoint should return, replace or delete the thumbnail file of a
selected AAS.

This issue specifies eclipse-basyx#439.

This change implements `GET`, `PUT` and `DELETE` for
`/shells/{aasIdentifier}/asset-information/thumbnail` according to
the specification. `GET` returns the thumbnail file referenced by
`AssetInformation.default_thumbnail`. `PUT` accepts a
`multipart/form-data` upload (`fileName` and `file`), stores it via
the file store, and updates `default_thumbnail` accordingly, removing
the previous thumbnail file if the path changes. `DELETE` removes the
stored file and clears `default_thumbnail`. All three reject external
(non-local) thumbnail references, since the server cannot serve or
manage files it does not store itself.

Fixes eclipse-basyx#493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant