InfluxDB 2.0, can't get anything to work so far

I’m trying to move some quick code I did for 1.7, in C# to 2.0

To get started:

the create bucket sample (https://github.com/influxdata/influxdb-client-csharp#features), doesn’t work because it lacks authorization.

When trying to create an organization… it turns out that the class is not usable because the API needs an organization id, the id field is private in the class and nothing is setting it.
So, essentially the Organization class and any API that takes it, can’t be use.

No problem, I’ll create an organization through the UI. So, I go through the docs, and find: https://v2.docs.influxdata.com/v2.0/organizations/create-org/

No luck here either, because the button mentioned in the documentation simply does not exist in the UI.

So far, no way to get the id of the organization I was forced to create when starting.

To make things more infuriating… I don’t need/care/want to define an organization but somehow it has become an essential thing in 2.0.

I’m sure I could find some workaround, but my real question is:

  • Since the get started samples don’t work.
  • Since the documentation doesn’t match the product.

Can you actually develop anything using 2.0? or is it at the ‘play with it to see what’s up’ stage?

@thomas, are you using InfluxDB 2.0 OSS or Cloud?

I can’t speak to the issues with the C# client, but the troubles you’re having with the UI make it sound like you’re using InfluxDB Cloud 2. If that’s true, you won’t be able to create a 2nd organization under your account. When you created an account, it created an org for you using the email address you provided. Your orgID can be extracted from the UI URL: https://v2.docs.influxdata.com/v2.0/organizations/view-orgs/#organization-id-in-the-ui.

Hi Scott,

I’m using the OSS version. The only way I could extract the organization Id was through the command line. The description of the UI in the link you sent doesn’t match what I see in the UI itself.

What OSS alpha version are you using?

the one at:
quay.io/influxdb/influxdb:2.0.0-alpha

(from the docs at https://v2.docs.influxdata.com/v2.0/get-started/)

Hi @thomas,

There is a snipped how to create an organization and also a bucket in C# client:

Client = InfluxDBClientFactory.Create(InfluxDbUrl, "my-token".ToCharArray()); 
            
var organization = await Client.GetOrganizationsApi().CreateOrganization("New Organization");

var retention = new BucketRetentionRules(everySeconds: 86_400);
var bucket = await Client.GetBucketsApi().CreateBucket("New Bucket", retention, organization);
            
Console.WriteLine($"Created bucket: {bucket} with retention {retention} in {organization}");

With best regards
Jakub

Great! thanks a lot!

1 Like