Skip to content

Commit

Permalink
Base url refactor (#15)
Browse files Browse the repository at this point in the history
* added health ready endpoints, fix API base url

* fix API base url
  • Loading branch information
rhajek authored Sep 16, 2019
1 parent d10029c commit d65baf3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ from influxdb2.client.influxdb_client import InfluxDBClient
from influxdb2.client.write_api import WriteOptions
from influxdb2.client.write.point import Point

_client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token", org="my-org")
_client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
_write_client = _client.write_api(write_options=WriteOptions(batch_size=500,
flush_interval=10_000,
jitter_interval=2_000,
Expand Down Expand Up @@ -156,7 +156,7 @@ Data are writes in an asynchronous HTTP request.
from influxdb2.client.influxdb_client import InfluxDBClient
from influxdb2.client.write_api import ASYNCHRONOUS

client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token", org="my-org")
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
write_client = client.write_api(write_options=ASYNCHRONOUS)

...
Expand All @@ -172,7 +172,7 @@ Data are writes in a synchronous HTTP request.
from influxdb2.client.influxdb_client import InfluxDBClient
from influxdb2.client.write_api import SYNCHRONOUS

client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token", org="my-org")
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
write_client = client.write_api(write_options=SYNCHRONOUS)

...
Expand Down Expand Up @@ -237,7 +237,7 @@ data = rx \
.from_iterable(DictReader(open('vix-daily.csv', 'r'))) \
.pipe(ops.map(lambda row: parse_row(row)))

client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token", org="my-org", debug=True)
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=True)

"""
Create client that writes data in batches with 500 items.
Expand Down Expand Up @@ -344,7 +344,7 @@ data = rx\
ops.distinct_until_changed(),
ops.map(lambda temperature: line_protocol(temperature)))

_db_client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token", org="my-org", debug=True)
_db_client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=True)

"""
Create client that writes data into InfluxDB
Expand All @@ -369,5 +369,5 @@ input()
```python
from influxdb2.client.influxdb_client import InfluxDBClient

_db_client = InfluxDBClient(url="http://localhost:9999/api/v2", token="my-token", org="my-org", enable_gzip=True)
_db_client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", enable_gzip=True)
```

0 comments on commit d65baf3

Please sign in to comment.