feat: setup DBRP mapping automatically for a v2 connection #5998
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes it possible to use pre-defined dashboards when setting up a new InfluxDB v2 connection. When a database is not available in a v2 connection (missing V1 DBRP mapping), the implementation tries to create a v1 DBRP mapping so that the existing InfluxQL dashboards (and dashboard suggestions) work properly.
When a V2 connection is specified (InfluxDB v2 Auth is selected)
and the user presses
Next
, the implementation then tries to suggest dashboards. Newly in this PR, if it detects that there is notelegraf
database, it attempts to create a v1 DBRP mapping for a v2 bucket of the same name as the database. If such a bucket exists and the DBRP mapping can be created, it creates a database and notifies a user with a message:The
suggested dashboards
functionality immediately works OOTB.The new functionality requires privileges that allow getting v2 buckets and creating v1 DBRP mapping, an admin (all-access) token for a v2 InfluxDB OSS is required.