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

RS-418: Document new API for record removing #93

Merged
merged 12 commits into from
Sep 12, 2024
Merged

Conversation

atimin
Copy link
Member

@atimin atimin commented Sep 4, 2024

  • Refactored the Entry API section
  • Documented the new endpoints
  • Extended the Data Management guide with examples of how to remove data using SDKs and HTTP API.

@atimin atimin marked this pull request as draft September 4, 2024 09:44
Copy link

github-actions bot commented Sep 4, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

1 similar comment
Copy link

github-actions bot commented Sep 4, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

@atimin atimin assigned atimin and AnthonyCvn and unassigned atimin Sep 11, 2024
@atimin atimin marked this pull request as ready for review September 11, 2024 11:41
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

Copy link
Collaborator

@AnthonyCvn AnthonyCvn left a comment

Choose a reason for hiding this comment

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

Nice structure! I only found small typos and had some thoughts to check in the comments.

<>
The method removes a record from an entry or the entire entry.
If the `ts` query parameter is set, the record with the timestamp is removed.
Otherwise, the entire entry is removed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

By reading the statement, I realized that it could be risky (if someone set ts to None accidentally). InfluxDb makes the time range mandatory: https://docs.influxdata.com/influxdb/v2/write-data/delete-data/
Maybe something for another release.

Copy link
Collaborator

Choose a reason for hiding this comment

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

just realized that you have the "Remove records within a time range" endpoint. Maybe that endpoint can also remove a single record (for example if start = stop), and the /api/v1/b/:bucket_name/:entry_name removes the entire entry

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's dangerous if you use the HTTP API directly, but in the SDKs it's wrapped in methods. My intention was to keep the same structure of endpoints as for read and write operations, assuming that users would use SDKs or wrap the HTTP calls and test them.

docs/http-api/entry-api/delete_data.mdx Outdated Show resolved Hide resolved
description:
"A UNIX timestamp in microseconds. If not set, the query starts from the oldest record in the entry.",
dataType: "Integer",
isRequired: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not mandatory to set the time range?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, the idea is that you can use labels over the entire dataset. However, I can add a check to return an error when no parameter is set to prevent deleting the entire entry.

<>
The method removes a batch of records from an entry. The list of records to remove is sent in the headers of
the request.
See the Batch Protocol section for more details.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If possible adding link to "http-api/entry-api#batch-protocol"

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't find how =( This must be a versioned link and it works only for md links like [...](..). I can add the link in the introduction text of the section.

docs/http-api/entry-api/update_data.mdx Outdated Show resolved Hide resolved
docs/http-api/entry-api/update_data.mdx Outdated Show resolved Hide resolved
docs/guides/data-management.mdx Outdated Show resolved Hide resolved
@atimin atimin requested a review from AnthonyCvn September 12, 2024 11:38
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-bush-0fb136503-93.westeurope.5.azurestaticapps.net

Copy link
Collaborator

@AnthonyCvn AnthonyCvn left a comment

Choose a reason for hiding this comment

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

Perfect!

@atimin atimin merged commit 62a5521 into main Sep 12, 2024
5 of 24 checks passed
@atimin atimin deleted the RS-418-removeing-record branch September 12, 2024 11:59
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.

2 participants