0

I have a working InfluxDb2 server and, on a Raspberry Pi, the Python client library. I've generated the the tokens in the server UI and copied an all-areas one into the Python. The test bucket is set up in the UI too. In the Python program I have this:

bucket = "test"
org = "test-org"

# 
token = "blabla=="
# Store the URL of your InfluxDB instance
url="http://10.0.1.1:8086/api/v2"

client = influxdb_client.InfluxDBClient(
   url=url,
   token=token,
   org=org
)

Followed later by:

p = influxdb_client.Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
write_api = client.write_api(write_options=SYNCHRONOUS)
write_api.write(bucket='test', org='test-org', record=p)

I've overcome the not-authorized but now, whatever I do, I end up with this:

influxdb_client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.2.0', 'X-Platform-Error-Code': 'not found', 'Date': 'Tue, 26 Apr 2022 14:35:50 GMT', 'Content-Length': '54'})
HTTP response body: {
    "code": "not found",
    "message": "path not found"
}

I've also gone back to Curl which gives me not authorized problem with the same parameters. Any help appreciated, beginning to regret trying to upgrade now.

1 Answer 1

1

You don't need the /api/v2 in your url parameter, just url="http://10.0.1.1:8086"

See https://github.com/influxdata/influxdb-client-python#getting-started

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, struggling with the rest but this bit works, at least!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.