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

New 'timeseries' resource #897

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7edc969
New timeseries resource: spec, crud/add, crud/retrieve
alebellu Apr 11, 2024
017df55
Insert and bulk insert actions on timeseries
alebellu Apr 16, 2024
ab6c799
Fix test
alebellu Apr 16, 2024
a70caa5
Update and delete timeseries
alebellu Apr 18, 2024
4245391
Fix test
alebellu Apr 18, 2024
0797119
Add queries key to timeseries spec
alebellu Apr 19, 2024
24a7ee0
crud/action timeseries/uuid data query
alebellu Apr 23, 2024
0aa6869
Fix mapping of ::custom-es-query
alebellu Apr 23, 2024
2617e74
Optional metrics can be omitted
alebellu Apr 23, 2024
229084d
Added check on dimension filters
alebellu Apr 23, 2024
3d72786
At least one metric and one dimension required
alebellu Apr 23, 2024
0233f15
Update timeseries write index mapping on timeseries update
alebellu Apr 23, 2024
d6e6b62
Remove unused bindings
alebellu Apr 23, 2024
8ff660b
Rollover indexes when mapping changes
alebellu Apr 25, 2024
a8d9e8c
Rollover indexes when mapping changes
alebellu Apr 25, 2024
792952e
Unit test updated mappings on timeseries update
alebellu Apr 26, 2024
3477f68
Unit test updated mappings on timeseries update
alebellu Apr 26, 2024
d5bd9b0
Defer timeseries creation to first data insertion. Refactor error han…
alebellu Apr 29, 2024
65116f7
Defer timeseries creation to first data insertion. Refactor error han…
alebellu Apr 29, 2024
97a9e65
crud/action timeseries/uuid data query should return 404 if datastrea…
alebellu Apr 29, 2024
9759b1c
Make /data endpoint accept query parameter
alebellu Apr 29, 2024
e709f88
Timestamp query csv export
alebellu May 2, 2024
1e26f8e
Sending data outside accepted temporal range should return 4xx error …
alebellu May 6, 2024
86755d8
Query raw data
alebellu May 6, 2024
0584481
Fix error code in case of conflict
alebellu May 6, 2024
705132e
Query with custom aggregations
alebellu May 8, 2024
17ee953
Add test to check returned status code on invalid custom queries
alebellu May 9, 2024
79cf9ec
sum and value_count aggregations. Test custom query csv export.
alebellu May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 48 additions & 29 deletions code/src/sixsq/nuvla/db/binding.clj
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,18 @@
error codes can also be thrown.")

(query-native
[this collection-id options]
"This function executes a native query, where the collection-id
corresponds to the name of a Collection.
[this index options]
"This function executes a native query against the given index.

On success, the function must return the response body.

On failure, the function must throw an ex-info containing the error
ring response. If the resource-id does not correspond to a Collection,
then a 400 (bad-request) response must be returned. Other appropriate
error codes can also be thrown.")

(add-metric
[this collection-id data options]
"This function adds the given metric to the database. The metric
must not already exist in the database.

On success, the function must return a 201 ring response with the
relative URL of the new metric as the Location.

On failure, the function must throw an ex-info containing the error
ring response. The error must be 409 (conflict) if the metric
exists already. Other appropriate error codes can also be thrown.")
ring response.")

(bulk-insert-metrics
[this collection-id data options]
"This function insert the given metrics in the database where the
collection-id corresponds to the name of a metrics Collection.
(bulk-delete
[this collection-id options]
"This function removes the given resources in the database where the
collection-id corresponds to the name of a Collection.

On success, the function must return the summary map of what was done
on the db.
Expand All @@ -130,9 +115,9 @@
then a 400 (bad-request) response must be returned. Other appropriate
error codes can also be thrown.")

(bulk-delete
(bulk-edit
[this collection-id options]
"This function removes the given resources in the database where the
"This function edits the given resources in the database where the
collection-id corresponds to the name of a Collection.

On success, the function must return the summary map of what was done
Expand All @@ -143,15 +128,49 @@
then a 400 (bad-request) response must be returned. Other appropriate
error codes can also be thrown.")

(bulk-edit
[this collection-id options]
"This function edits the given resources in the database where the
collection-id corresponds to the name of a Collection.
(create-timeseries
[this index options]
"This function creates a timeseries with the given index name in the database.")

(retrieve-timeseries
[this index]
"This function retrieves the identified timeseries from the database.

On success, this returns the clojure map representation of the
timeseries. The response must not be embedded in a ring response.

On failure, this function must throw an ex-info containing the error
ring response. If the resource doesn't exist, use a 404 status.")

(edit-timeseries
[this index options]
"This function updates (edits) the given timeseries in the database.
The timeseries must already exist in the database.")

(add-timeseries-datapoint
[this index data options]
"This function adds the given timeseries datapoint to the database.
The datapoint with the given timestamp and dimensions must not already exist in the database.

On success, the function must return a 201 ring response with the
relative URL of the new metric as the Location.

On failure, the function must throw an ex-info containing the error
ring response. The error must be 409 (conflict) if the metric
exists already. Other appropriate error codes can also be thrown.")

(bulk-insert-timeseries-datapoints
[this index data options]
"This function insert the given timeseries datapoints in the database.

On success, the function must return the summary map of what was done
on the db.

On failure, the function must throw an ex-info containing the error
ring response. If the resource-id does not correspond to a Collection,
then a 400 (bad-request) response must be returned. Other appropriate
error codes can also be thrown."))
error codes can also be thrown.")

(delete-timeseries
[this index options]
"This function deletes a timeseries with the given index name from the database."))
Loading
Loading