Tools Guide
This guide focuses on the ’tools’ subcommand. Every command that isn’t specific to a CRUD operation falls under the tools command.
There are a few utility functions that have been introduced that might be useful to the user, or is geared at managing the configuration, switching contexts or Orgs for a given user and so on.
Authentication Management
This is mainly added as a convenience mechanism. It was needed to support some testing and exposing the feature is useful as a really simple CLI to create tokens / service Keys. You probably should be using other tooling for managing all your service files and tokens. Unlike most other entities, this is not a backup feature as much as utility.
There are two sub commands for auth, service-accounts and tokens (will be deprecated at some point).
Token Management
Token Listing
Example of creating a new token.
New Token
┌────┬────────┬─────────────────────────────────────────────────────────────┐ │ ID │ NAME │ TOKEN │ ├────┼────────┼─────────────────────────────────────────────────────────────┤ │ 2 │ foobar │ eyJrIjoiNzU2WVhiMEZpVWNlV3hWSUVZQTuIjoiZm9vYmFyIiwiaWQiOjF9 │ └────┴────────┴─────────────────────────────────────────────────────────────┘Service Accounts
New Service
┌────┬─────────────────┬───────┐ │ ID │ NAME │ ROLE │ ├────┼─────────────────┼───────┤ │ 4 │ AwesomeSauceSvc │ Admin │ └────┴─────────────────┴───────┘New Service
┌───────────┬──────────┬──────────────┬────────────────────────────────────────────────┐ │ SERVICEID │ TOKEN_ID │ NAME │ TOKEN │ ├───────────┼──────────┼──────────────┼────────────────────────────────────────────────┤ │ 4 │ 3 │ AwesomeToken │ glsa_a14JOaGExOkDuJHjDWScXbxjTBIXScsw_39df7bf5 │ └───────────┴──────────┴──────────────┴────────────────────────────────────────────────┘Service Listing
┌────┬─────────────────┬───────┬────────┬──────────┬──────────────┬───────────────┐ │ ID │ SERVICE NAME │ ROLE │ TOKENS │ TOKEN ID │ TOKEN NAME │ EXPIRATION │ ├────┼─────────────────┼───────┼────────┼──────────┼──────────────┼───────────────┤ │ 4 │ AwesomeSauceSvc │ Admin │ 1 │ │ │ │ │ │ │ │ │ 3 │ AwesomeToken │ No Expiration │ └────┴─────────────────┴───────┴────────┴──────────┴──────────────┴───────────────┘Dashboard Linter
Integrated the official grafana linter into GDG. Allows you to run the linter as part of gdg.
You can execute this on a single dashboard, or a folder. –autofix is available but should be considered a beta feature.
Devel
Some developer helper utilities
Organizations
Command can use organizations
or org
to set the organizations in the configuration file.
NOTE: this only manages top level of the orgs structure. Mainly used for a lazy man pattern.
Additionally addUser
, updateUserRole
, deleteUser
, listUsers
are all used to manage a user’s membership within a given organization.
Organizations Preferences
There are a few properties that can be set to change behavior. Keep in mind that all of these entity need to be owned by the Org, you cannot reference to a dashboard outside of a given org.
Organization Users CRUD
Users
CRUD is under the ‘backup’ command. The tools subcommand allows you to promote a given user to a grafana admin if you have the permission to do so.
NOTE: admin user is always ignored.