From d65baf3a9a00743b9dd705081dd177387ad1736d Mon Sep 17 00:00:00 2001 From: Robert Hajek Date: Mon, 16 Sep 2019 14:43:44 +0200 Subject: [PATCH] Base url refactor (#15) * added health ready endpoints, fix API base url * fix API base url --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9b0272ba..5fac7b52 100644 --- a/README.md +++ b/README.md @@ -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, @@ -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) ... @@ -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) ... @@ -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. @@ -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 @@ -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) ```