Skip to content
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

Concept for filtering Shells based on timestamp #466

Open
tunacicek opened this issue Oct 1, 2024 · 1 comment
Open

Concept for filtering Shells based on timestamp #466

tunacicek opened this issue Oct 1, 2024 · 1 comment
Assignees

Comments

@tunacicek
Copy link
Contributor

tunacicek commented Oct 1, 2024

As a system administrator,
I want the history of shell updates to be stored, including details such as the last update timestamp and the user who performed the update,
so that I can track when and by whom shell updates were made and access this information via an API.

Notes

  • clarify how the data can be included in the shell response (check if IDTA is applicable).
  • Do we need to adjust the lookup API to make it searchable by timestamp?

Useful links
admin-shell-io/aas-specs-api#176

Outcome
concept-shell-timestamp-filter_0.0.1.md

@tunacicek tunacicek changed the title History of shell Concept for history of Shell Oct 2, 2024
@tunacicek tunacicek self-assigned this Oct 11, 2024
@tunacicek
Copy link
Contributor Author

tunacicek commented Oct 15, 2024

Filter Shell based on timestamp

Overview

Include 'createdAfter' as query parameter allows consumers to filter results based on the timestamp of a shell's creation.

Database tables

1. Shell table

 TABLE shell (
    ...,
    created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

API Design

Search by created after

A new query parameter createdAfter will be introduced to the shell API to allow for filtering by after 'created_date'.
The parameter will be optional and the format of the timestamp is 'RFC3339' and looks like YYYY-MM-DDTHH:MM:SSZ.

  • GET /shell-descriptors?lastUpdated=2021-01-01T00:00:00Z
  • GET /shell-descriptors/{aasIdentifier}/submodel-descriptors?lastUpdated=2021-01-01T00:00:00Z
  • GET /lookup/shells?lastUpdated=2021-01-01T00:00:00Z
  • POST /lookup/shellsByAssetLink?lastUpdated=2021-01-01T00:00:00Z

Extend Shell

A new parameter createdAt will be added to the shell object and will be returned.

{
  ...
  "id": "123",  
  "idShort": "model-b1",
  "specificAssetIds" : [],
  "createdAt": "2021-01-01T00:00:00Z",
  ...
}

Business logic

When consumer sends a request with the 'createdAfter' query parameter, the DTR handles the request by:

  • Parsing the timestamp.
  • Filtering the dataset to return only shells created after the specified timestamp.
  • Returning the filtered shells/shell_ids.

When the 'createdAfter' query parameter is not provided, the DTR returns all shells without filtering them by creation date.

@tunacicek tunacicek changed the title Concept for history of Shell Concept for filtering Shells based on timestamp Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

No branches or pull requests

1 participant