Command Line Interface¶
The Guance Command-Line Interface (CLI) is a cross-platform command-line tool used to connect to Guance and perform resource management operations on Guance. It is also suitable for importing content from various third-party ecosystems into the Guance platform for unified management.
In actual cloud service interaction scenarios, there are three ways to interact with a SaaS platform:
- Imperative APIs and tools: Use operational predicates to explain how to operate specific resources, such as RESTFul and command actions.
- Declarative APIs and tools: Only describe the desired resources. Specific operations are automatically calculated and executed by the platform or tool by analyzing the current state.
- Interactive tools: Aim to interact with users, guiding them step-by-step to achieve their goals. For example, API debuggers allow users to continuously adjust parameters and initiate requests until the desired result is achieved.
The CLI is a crucial developer tool for SaaS providers, replacing the GUI as another interface for user interaction. The CLI is often used to solve software automation problems, enabling automated imperative operations, such as automating the "last mile" of operations by writing scripts that call the CLI.
The Guance CLI currently supports the following three imperative operations:
- Resource import tools: Used to import content from third-party ecosystems into Guance for unified management (e.g., importing Grafana dashboards into Guance).
- Data upload tools: Used to report one-time data (e.g., single data files, continuous integration artifacts) to Guance (e.g., uploading test data).
- Installation tools: Used for one-click installation of various components in the Guance ecosystem.
Use Cases¶
Using CLI to Import Grafana Dashboards to Guance¶
Grafana is a popular open-source data visualization tool that can import data from various data sources and visualize it. It supports multiple chart types, such as line charts, bar charts, scatter plots, heatmaps, etc., helping users better understand data trends and distributions through intuitive chart presentations, and enabling data analysis and decision-making.
The Guance CLI supports exporting Grafana dashboards into a format supported by the Guance platform for import into Guance. It can also export Terraform files for large-scale project integration.
Usage¶
Usage Limitations¶
If the following usage limitations cause inconvenience, please refer to the link for feedback (https://github.com/GuanceCloud/guance-cli/issues)
Some Panel formats are not supported
Currently, 10 types of Panels are supported, including two deprecated types (for compatibility with old dashboards).
Some template variable syntax is not supported
PromQL queries from Grafana PromQL dashboards will be translated into Guance's DQL queries, but currently only non-nested expression functions like label_values
are supported. Other functions like query_result
will be converted to empty queries.
PromQL results do not support shorthand
PromQL series names are automatically generated based on the query and do not support shorthand (similar to the as
keyword in DQL).