Support Create Organisation (influxDB v2)
CoolZeroNL opened this issue · comments
Proposal:
Create (delete?, find ?) organisation the same way now buckets can be created.
Current behavior:
not supported
Desired behavior:
able to create a organisation if it not exist, the same way now buckets can be created it it does not exist yet.
offcource the API token needs to have the scope: --write-orgs | Grant permission to create and update organizations
API docs: https://docs.influxdata.com/influxdb/v2/api/#operation/PostOrgs
Scope docs: https://docs.influxdata.com/influxdb/cloud/reference/cli/influx/auth/create/
Alternatives considered:
setting up now my own http client to do the api call. it would be nice to use it out of the box with the client.
Use case:
I dont want manual create a new organisations. i want to to isolate the data by organsation (endusers can only see org level). So I want to set the org, bucket, token through the ESP, if the organisation and/or bucket doesnt exist it creates them.
In my case, then a cron script will keep track on the server side for each (new) organisation + buckers, it will map/created these also in grafana. This so the endusers are isolated from each other data.
I have added the org create, find and delete in my branch: https://github.com/CoolZeroNL/InfluxDB-Client-for-Arduino/tree/add_orgs
- https://github.com/CoolZeroNL/InfluxDB-Client-for-Arduino/blob/add_orgs/src/OrganisationsClient.cpp
- https://github.com/CoolZeroNL/InfluxDB-Client-for-Arduino/blob/add_orgs/src/OrganisationsClient.h
and a example file : https://github.com/CoolZeroNL/InfluxDB-Client-for-Arduino/blob/add_orgs/examples/Organisations/Organisations.cpp
this all is working fine.. however i could some help with implenenting this also in the Test files/scripts/Server Mockup.
You can create a PR and we can discuss details in it.