mirror of
https://github.com/tiqi-group/pydase_service_base.git
synced 2025-04-21 00:40:01 +02:00
fixes docs
This commit is contained in:
parent
00d730c71b
commit
dd8be147ba
@ -88,8 +88,8 @@ Interact with an InfluxDBv1 server using the `InfluxDBv1Session` class. **Note t
|
|||||||
from pydase_service_base.database import InfluxDBv1Session
|
from pydase_service_base.database import InfluxDBv1Session
|
||||||
|
|
||||||
with InfluxDBv1Session() as influx_client:
|
with InfluxDBv1Session() as influx_client:
|
||||||
# Writing data to a database
|
# Writing points to a database
|
||||||
data = [
|
points = [
|
||||||
{
|
{
|
||||||
"measurement": "your_measurement", # Replace with your measurement
|
"measurement": "your_measurement", # Replace with your measurement
|
||||||
"tags": {
|
"tags": {
|
||||||
@ -101,7 +101,7 @@ with InfluxDBv1Session() as influx_client:
|
|||||||
"time": "2023-06-05T00:00:00Z", # Replace with your timestamp
|
"time": "2023-06-05T00:00:00Z", # Replace with your timestamp
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
influx_client.write_points(data=data, database="other_database")
|
influx_client.write_points(points=points, database="other_database")
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note** that you have to set `ssl` and `verify_ssl` to `False` when you are using a local influxdb instance.
|
**Note** that you have to set `ssl` and `verify_ssl` to `False` when you are using a local influxdb instance.
|
||||||
|
@ -31,13 +31,8 @@ class InfluxDBv1Session:
|
|||||||
Example:
|
Example:
|
||||||
```python
|
```python
|
||||||
with InfluxDBv1Session() as influx_client:
|
with InfluxDBv1Session() as influx_client:
|
||||||
# Creating a database
|
|
||||||
influx_client.create_database(
|
|
||||||
dbname='my_new_database'
|
|
||||||
)
|
|
||||||
|
|
||||||
# Writing data to a database
|
# Writing data to a database
|
||||||
data = [
|
points = [
|
||||||
{
|
{
|
||||||
"measurement": "your_measurement", # Replace with your measurement
|
"measurement": "your_measurement", # Replace with your measurement
|
||||||
"tags": {
|
"tags": {
|
||||||
@ -49,10 +44,7 @@ class InfluxDBv1Session:
|
|||||||
"time": "2023-06-05T00:00:00Z", # Replace with your timestamp
|
"time": "2023-06-05T00:00:00Z", # Replace with your timestamp
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
influx_client.write_points(data=data, database="other_database")
|
influx_client.write_points(points=points, database="other_database")
|
||||||
|
|
||||||
# just write one point into the client's current database
|
|
||||||
influx_client.write(data=data[0])
|
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user