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

Unable to use the buckets_api on Influx 1.8.10 #541

Closed
Pitastic opened this issue Dec 20, 2022 · 3 comments
Closed

Unable to use the buckets_api on Influx 1.8.10 #541

Pitastic opened this issue Dec 20, 2022 · 3 comments
Labels
invalid This doesn't seem right wontfix This will not be worked on
Milestone

Comments

@Pitastic
Copy link

Specifications

  • Client Version: 1.35.0
  • InfluxDB Version: 1.8.10
  • Platform: Linux (Ubuntu 20.04)

Reproduce:

  • Create a new database with the buckets method

On Influx 1.8 I am dealing with databases and not yet with buckets. The only problem is, that there is no client.create_database() anymore. Thanks to your migration guide and the examples in this repo it is clear that I should use the client.buckets_api() for that instead. These API Endpoints don't exist on 1.8 what makes sense to me.

But as this should be backwards compatible with 1.8 is there a workaround for this or am I missing something?

Code sample to reproduce problem

from influxdb_client import InfluxDBClient, BucketRetentionRules

org = ''

with InfluxDBClient(url='http://myserver:8086', token='user:password', org=org) as client:
    buckets_api = client.buckets_api()
    retention_rules = BucketRetentionRules(type="expire", every_seconds=3600)
    created_bucket = buckets_api.create_bucket(bucket_name="bucket-by-python",
                                               retention_rules=retention_rules,
                                               org=org)

Expected behavior

Create a "database" instead of a "bucket".

Actual behavior

Endpoint for API call is not found.

Additional info

influxdb_client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Content-Type': 'text/plain; charset=utf-8', 'X-Content-Type-Options': 'nosniff', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': '1.8.10', 'Date': 'Tue, 20 Dec 2022 21:42:34 GMT', 'Content-Length': '19'})
HTTP response body: 404 page not found
@Pitastic Pitastic added the bug Something isn't working label Dec 20, 2022
@Pitastic
Copy link
Author

Found this old Issue which suggests to use requests to call the API v1 directly. Do I really have to 😋 ?

@bednar
Copy link
Contributor

bednar commented Dec 21, 2022

Hi @Pitastic,

thanks for using our client.

But as this should be backwards compatible with 1.8 is there a workaround for this or am I missing something?

The client is not backwards compatible with 1.8. You can only use this client with InfluxDB 2.0 API compatibility endpoints.

Found this old Issue which suggests to use requests to call the API v1 directly. Do I really have to 😋 ?

Yes, you have to, but every Pull Request is welcome. If you want to add a helper for this into client code base ... feel free to create PR.

Regards

@bednar bednar closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2022
@bednar bednar added this to the 1.35.0 milestone Dec 21, 2022
@bednar bednar added invalid This doesn't seem right wontfix This will not be worked on and removed bug Something isn't working labels Dec 21, 2022
@Pitastic
Copy link
Author

Pitastic commented Dec 21, 2022

The client is not backwards compatible with 1.8

Ah ok. But just want to mention that this example in your repo is not valid then.

Thanks for your work. I will have a look if I am professional enough to help out here 😃 I would really like to...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants