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

[#1498] Provide historical API access functionality for things, policies, connections #1564

Merged
merged 4 commits into from
Feb 7, 2023

Conversation

thjaeckle
Copy link
Member

This PR enables "History API" support:

  • streaming of journal entries of a given entity (thing/policy) as DittoProtocol events (via Websocket/Connections/SSE)
  • accessing an entity (thing/policy/connection) "at" a specific revision or "at" a specific timestamp
  • added a configurable "history-retention-duration" config for things/policies/connections in order to delay the cleanup for at least that amount of time -> that way we can e.g. keep 30d of snapshots/events
  • made history API work via connectivity
  • added documentation for history capabilities

Resolves: #1498

There is a new FeatureToggle in ditto-devops.conf with key ditto.devops.feature.historical-apis-enabled in order to disable the historical API access.
Also, in order to be useful, the "cleanup" of entities has to be configured to have a history-retention-duration of greater than 0.
By default this is configured to 0d which means that events and snapshots may be deleted at any time of the cleanup strategy of Ditto decides so.

If for example "things" should keep a history of up to one week, the configuration inside things.conf can be adjusted to history-retention-duration = 7d.

The added documentation page basic-history.md describes the feature and its configuration in detail.

* streaming of journal entries of a given entity (thing/policy) as DittoProtocol events (via Websocket/Connections/SSE)
* accessing an entity (thing/policy/connection) "at" a specific revision or "at" a specific timestamp
* added a configurable "history-retention-duration" config for things/policies/connections in order to delay the cleanup for at least that amount of time -> that way we can e.g. keep 30d of snapshots/events
* made history API work via connectivity
* added documentation for history capabilities

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
…ing the status endpoint while still securing the devops endpoint

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
@thjaeckle thjaeckle added this to the 3.2.0 milestone Jan 13, 2023
…d" information

* and made those queryable with "fields" selector same as for things+policies
* made connection a full "Entity"

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
@thjaeckle thjaeckle force-pushed the feature/history-api branch 3 times, most recently from 6348304 to 63efb2b Compare February 6, 2023 10:04
Copy link
Contributor

@alstanchev alstanchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@thjaeckle thjaeckle merged commit 541091f into eclipse-ditto:master Feb 7, 2023
This pull request was closed.
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.

Provide API to stream/replay persisted events from the event journal
2 participants