-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adapter.http: implement attachment routes #257
Closed
Frosty2500
wants to merge
157
commits into
eclipse-basyx:main
from
rwth-iat:http_api/implement_attachment_routes
Closed
adapter.http: implement attachment routes #257
Frosty2500
wants to merge
157
commits into
eclipse-basyx:main
from
rwth-iat:http_api/implement_attachment_routes
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list werkzeug as a dependency in the readme
adapter.http: add custom identifier converter for werkzeug adapter.http: restructure routing map, add first submodel route adapter.http: refine imports
adapter._generic: add identifier URI encode/decode functions adapter.http: make api routes return ResponseData instead of the Response directly adapter.http: add Result + Message types + factory function
adapter.http: add request body parsing adapter.http: implement all remaining aas routes
- use stripped object serialization/deserialization - change response format (new spec always returns a result object)
adapter.http: remove old routes, add a few new aas and submodel routes
using the werkzeug.routing.MapAdapter url builder
Requests to URIs with a trailing slash will now be redirected to the respective URI without trailing slash. e.g. GET /aas/$identifier/ -> GET /aas/$identifier A redirect will only be set if the respective URI without trailing slash exists and the current request method is valid for the new URI. Historically, the trailing slash was only present when the requested resource was a directory. In our case the resources don't work like directories, in the sense, that each resource doesn't even list possible subsequent resources. So because our resources don't behave like directories, they shouldn't have a trailing slash.
for better error messages
because that's default anyways
to stay consistent with the rest of this library
add IdShortPathConverter and helper functions
change type check from `not A is B` to `A is not B` for better readability
… attributes like statement, annotation and value
adapter.http: implement submodel repo routes
The route now uses the submodel identifier instead of the submodel reference.
adapter.http: change `base64url_encode()` function to return `str`
…s_routes adapter.http: update AAS submodel refs path and `DELETE` route
adapter.http: suffix slashes to all routes
The submodel routes of the AAS API `/shells/<aas_id>/submodels` are the same already implemented as the submodel API, so we return a redirect here, after checking that the AAS indeed has a reference to the requested submodel. `PUT` and `DELETE` are different, as we also have to update the AAS in this case, either by adding a new updated reference in case of a `PUT` request changes the submodel id, or by removing the submodel reference for `DELETE` requests.
adapter.http: implement AAS API submodel routes via redirects
…routes_to_submount adapter.http: move `asset-information` routes to a submount
adapter.http: fix qualifier routes
The `IdentifierConverter` is also used to decode values from URLs, that aren't necessarily Identifiers, e.g. Qualifier types. Thus, a name like `Base64URLConverter` suits its use better and is also more expressive. For the same reasons, the key `identifier`, which was used for the `IdentifierConverter`, is renamed to `base64url`.
adapter.http: rename `IdentifierConverter` to `Base64URLConverter`
Methods `_get_shell()` and `_get_shells()` are added similarly to `_get_submodel()` and `_get_submodels()`, which were previously added in ffb833b. Furthermore, when requesting multiple AAS/Submodels, we're now also updating these in `_get_all_obj_of_type()` before returning them. Finally, updating AAS/Submodel objects is also moved to `_get_obj_ts()`.
adapter.http: refactor AAS retrieval
adapter.http: remove outdated TODOs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.