snapshot

package
v0.0.0-...-ce299e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GrafanaAPIKey  string
	SnapshotAPIKey string
	GrafanaAddr    *url.URL
	SnapshotAddr   *url.URL
}

Config for configuring the snapshot pacakge with the addresses and API keys for the grafana host and snapshot host. API key for require Grafana require admin privelages; the API for the snapshot host require at least editor privelages.

type SnapClient

type SnapClient struct {
	// contains filtered or unexported fields
}

SnapClient is for taking multiple snapshots of a Grafana instance and posting them to a snapshot host

func NewSnapClient

func NewSnapClient(config *Config) (*SnapClient, error)

NewSnapClient takes a Config, validates it, and returns a SnapClient

func (*SnapClient) Take

func (sc *SnapClient) Take(config *TakeConfig) (*Snapshot, error)

Take is for taking a snapshot TODO: Should take context

type Snapshot

type Snapshot struct {
	URL       string `json:"url"`
	Key       string `json:"key"`
	DeleteURL string `json:"deleteUrl"`
	DeleteKey string `json:"deleteKey"`
}

Snapshot is returned on a successful Take call

type TakeConfig

type TakeConfig struct {
	DashUID      string
	DashSlug     string
	From         *time.Time
	To           *time.Time
	Vars         map[string]string
	Expires      time.Duration
	SnapshotName string
}

TakeConfig for defining exactly which dashboard and time-range to snapshot, and also the name and expiry duration of the snapshot.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL