Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a REST client interacting with the Grafana API.
This class is limited in scope that only deals with APIs useful for `grafsnap`.
func (*Client) ImportSnapshot ¶
ImportSnapshot imports the snapshot back into Grafana. Returns the URL to access the snapshot.
func (*Client) ImportSnapshotsFromFiles ¶
func (cli *Client) ImportSnapshotsFromFiles(ctx context.Context, files []string) ([]ImportSnapshotResult, error)
ImportSnapshotsFromFiles imports multiple snapshot files in parallel into Grafana. The files can be plain JSON files backed up from the local snapshot, or a zip file containing these JSON snapshots.
func (*Client) ListDashboards ¶
func (cli *Client) ListDashboards(ctx context.Context) ([]ListDashboardResult, error)
ListDashboards lists all dashboards.
type ImportSnapshotResult ¶
type ImportSnapshotResult struct { File string `json:"file"` URL string `json:"url,omitempty"` Content []ImportSnapshotResult `json:"content,omitempty"` }
ImportSnapshotResult is the result of importing a file into Grafana.
type ListDashboardResult ¶
type ListDashboardResult struct { // Title is the human-readable title of the dashboard. Title string `json:"title"` // UID is the unique identifier of the dashboard. UID string `json:"uid"` // URL is the URL to the dashboard. URL string `json:"url"` }
ListDashboardResult is the result of listing dashboards from Grafana.
Click to show internal directories.
Click to hide internal directories.