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

docs: documentation about delete endpoint #189

Merged
merged 2 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
1. [#183](https://github.com/influxdata/influxdb-client-python/pull/183): Fixes to DataFrame writing.
1. [#181](https://github.com/influxdata/influxdb-client-python/pull/181): Encode Point whole numbers without trailing `.0`

### Documentation
1. [#189](https://github.com/influxdata/influxdb-client-python/pull/189): Updated docs about `DeleteApi`.

## 1.13.0 [2020-12-04]

### Features
Expand Down
31 changes: 31 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ InfluxDB 2.0 client features
- `How to efficiently import large dataset`_
- `Efficiency write data from IOT sensor`_
- `How to use Jupyter + Pandas + InfluxDB 2`_
- Advanced Usage
- `Gzip support`_
- `Delete data`_

Installation
------------
Expand Down Expand Up @@ -898,6 +901,34 @@ Gzip support

.. marker-gzip-end

Delete data
^^^^^^^^^^^
.. marker-delete-start

The `delete_api.py <influxdb_client/client/delete_api.py>`_ supports deletes `points <https://v2.docs.influxdata.com/v2.0/reference/glossary/#point>`_ from an InfluxDB bucket.

.. code-block:: python

from influxdb_client import InfluxDBClient

client = InfluxDBClient(url="http://localhost:8086", token="my-token")

delete_api = client.delete_api()

"""
Delete Data
"""
start = "1970-01-01T00:00:00Z"
stop = "2021-02-01T00:00:00Z"
delete_api.delete(start, stop, '_measurement="my_measurement"', bucket='my-bucket', org='my-org')

"""
Close client
"""
client.__del__()

.. marker-delete-end

InfluxDB 1.8 API compatibility
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
5 changes: 4 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ TasksApi
:members:

DeleteApi
""""""""
"""""""""
.. autoclass:: influxdb_client.DeleteApi
:members:

.. autoclass:: influxdb_client.domain.DeletePredicateRequest
:members:
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def setup(app):


project = 'influxdb_client'
copyright = '2019, Bonitoo.io'
copyright = '2019 InfluxData, Inc'
author = 'Robert Hajek, Jakub Bednar'

autoclass_content = 'both'
Expand Down
6 changes: 6 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ Write
:start-after: marker-writes-start
:end-before: marker-writes-end

Delete data
^^^^^^^^^^^
.. include:: ../README.rst
:start-after: marker-delete-start
:end-before: marker-delete-end

Gzip support
^^^^^^^^^^^^
.. include:: ../README.rst
Expand Down
1 change: 1 addition & 0 deletions influxdb_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@

from influxdb_client.client.authorizations_api import AuthorizationsApi
from influxdb_client.client.bucket_api import BucketsApi
from influxdb_client.client.delete_api import DeleteApi
from influxdb_client.client.labels_api import LabelsApi
from influxdb_client.client.organizations_api import OrganizationsApi
from influxdb_client.client.query_api import QueryApi
Expand Down