Documentation ¶
Index ¶
- Constants
- type APIResponse
- type AlertContactPointHandler
- func (h *AlertContactPointHandler) Add(resource grizzly.Resource) error
- func (h *AlertContactPointHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *AlertContactPointHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *AlertContactPointHandler) GetSpecUID(resource grizzly.Resource) (string, error)
- func (h *AlertContactPointHandler) ListRemote() ([]string, error)
- func (h *AlertContactPointHandler) Parse(m map[string]any) (*grizzly.Resource, error)
- func (h *AlertContactPointHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *AlertContactPointHandler) Update(existing, resource grizzly.Resource) error
- func (h *AlertContactPointHandler) Validate(resource grizzly.Resource) error
- type AlertNotificationPolicyHandler
- func (h *AlertNotificationPolicyHandler) Add(resource grizzly.Resource) error
- func (h *AlertNotificationPolicyHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *AlertNotificationPolicyHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *AlertNotificationPolicyHandler) GetSpecUID(resource grizzly.Resource) (string, error)
- func (h *AlertNotificationPolicyHandler) ListRemote() ([]string, error)
- func (h *AlertNotificationPolicyHandler) Parse(m map[string]any) (*grizzly.Resource, error)
- func (h *AlertNotificationPolicyHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *AlertNotificationPolicyHandler) Update(existing, resource grizzly.Resource) error
- func (h *AlertNotificationPolicyHandler) Validate(resource grizzly.Resource) error
- type AlertRuleGroupHandler
- func (h *AlertRuleGroupHandler) Add(resource grizzly.Resource) error
- func (h *AlertRuleGroupHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *AlertRuleGroupHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *AlertRuleGroupHandler) GetSpecUID(resource grizzly.Resource) (string, error)
- func (h *AlertRuleGroupHandler) ListRemote() ([]string, error)
- func (h *AlertRuleGroupHandler) Parse(m map[string]any) (*grizzly.Resource, error)
- func (h *AlertRuleGroupHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *AlertRuleGroupHandler) Update(existing, resource grizzly.Resource) error
- func (h *AlertRuleGroupHandler) Validate(resource grizzly.Resource) error
- type ClientProvider
- type DashboardHandler
- func (h *DashboardHandler) Add(resource grizzly.Resource) error
- func (h *DashboardHandler) DashboardJSONGetHandler(p grizzly.Server) http.HandlerFunc
- func (h *DashboardHandler) DashboardJSONPostHandler(p grizzly.Server) http.HandlerFunc
- func (h *DashboardHandler) Detect(data map[string]any) bool
- func (h *DashboardHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *DashboardHandler) GetProxyEndpoints(p grizzly.Server) []grizzly.ProxyEndpoint
- func (h *DashboardHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *DashboardHandler) GetSpecUID(resource grizzly.Resource) (string, error)
- func (h *DashboardHandler) ListRemote() ([]string, error)
- func (h *DashboardHandler) Parse(m map[string]any) (*grizzly.Resource, error)
- func (h *DashboardHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
- func (h *DashboardHandler) ProxyURL(resource grizzly.Resource) (string, error)
- func (h *DashboardHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *DashboardHandler) RootDashboardPageHandler(p grizzly.Server) http.HandlerFunc
- func (h *DashboardHandler) Snapshot(resource grizzly.Resource, expiresSeconds int) error
- func (h *DashboardHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
- func (h *DashboardHandler) Update(existing, resource grizzly.Resource) error
- func (h *DashboardHandler) Validate(resource grizzly.Resource) error
- type DatasourceHandler
- func (h *DatasourceHandler) Add(resource grizzly.Resource) error
- func (h *DatasourceHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *DatasourceHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *DatasourceHandler) GetSpecUID(resource grizzly.Resource) (string, error)
- func (h *DatasourceHandler) ListRemote() ([]string, error)
- func (h *DatasourceHandler) Parse(m map[string]any) (*grizzly.Resource, error)
- func (h *DatasourceHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
- func (h *DatasourceHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *DatasourceHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
- func (h *DatasourceHandler) Update(existing, resource grizzly.Resource) error
- func (h *DatasourceHandler) Validate(resource grizzly.Resource) error
- type ErrUidsMissing
- type FolderHandler
- func (h *FolderHandler) Add(resource grizzly.Resource) error
- func (h *FolderHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *FolderHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *FolderHandler) GetSpecUID(resource grizzly.Resource) (string, error)
- func (h *FolderHandler) ListRemote() ([]string, error)
- func (h *FolderHandler) Parse(m map[string]any) (*grizzly.Resource, error)
- func (h *FolderHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *FolderHandler) Sort(resources grizzly.Resources) grizzly.Resources
- func (h *FolderHandler) Update(existing, resource grizzly.Resource) error
- func (h *FolderHandler) Validate(resource grizzly.Resource) error
- type LibraryElementHandler
- func (h *LibraryElementHandler) Add(resource grizzly.Resource) error
- func (h *LibraryElementHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *LibraryElementHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *LibraryElementHandler) GetSpecUID(resource grizzly.Resource) (string, error)
- func (h *LibraryElementHandler) ListRemote() ([]string, error)
- func (h *LibraryElementHandler) Parse(m map[string]any) (*grizzly.Resource, error)
- func (h *LibraryElementHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
- func (h *LibraryElementHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *LibraryElementHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
- func (h *LibraryElementHandler) Update(existing, resource grizzly.Resource) error
- func (h *LibraryElementHandler) Validate(resource grizzly.Resource) error
- type Provider
- func (p *Provider) APIVersion() string
- func (p *Provider) Client() (*gclient.GrafanaHTTPAPI, error)
- func (p *Provider) Config() *config.GrafanaConfig
- func (p *Provider) GetHandlers() []grizzly.Handler
- func (p *Provider) Group() string
- func (p *Provider) Name() string
- func (p *Provider) SetupProxy() (*httputil.ReverseProxy, error)
- func (p *Provider) Version() string
Constants ¶
const (
GlobalAlertNotificationPolicyName = "global"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶ added in v0.3.0
type AlertContactPointHandler ¶ added in v0.3.0
type AlertContactPointHandler struct {
grizzly.BaseHandler
}
AlertContactPointHandler is a Grizzly Handler for Grafana contactPoints
func NewAlertContactPointHandler ¶ added in v0.3.0
func NewAlertContactPointHandler(provider grizzly.Provider) *AlertContactPointHandler
NewAlertContactPointHandler returns a new Grizzly Handler for Grafana contactPoints
func (*AlertContactPointHandler) Add ¶ added in v0.3.0
func (h *AlertContactPointHandler) Add(resource grizzly.Resource) error
Add pushes a contactPoint to Grafana via the API
func (*AlertContactPointHandler) GetByUID ¶ added in v0.3.0
func (h *AlertContactPointHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*AlertContactPointHandler) GetRemote ¶ added in v0.3.0
GetRemote retrieves a contactPoint as a Resource
func (*AlertContactPointHandler) GetSpecUID ¶ added in v0.4.0
func (h *AlertContactPointHandler) GetSpecUID(resource grizzly.Resource) (string, error)
func (*AlertContactPointHandler) ListRemote ¶ added in v0.3.0
func (h *AlertContactPointHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*AlertContactPointHandler) Parse ¶ added in v0.3.0
Parse parses a manifest object into a struct for this resource type
func (*AlertContactPointHandler) ResourceFilePath ¶ added in v0.3.0
func (h *AlertContactPointHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
type AlertNotificationPolicyHandler ¶ added in v0.3.0
type AlertNotificationPolicyHandler struct {
grizzly.BaseHandler
}
AlertNotificationPolicyHandler is a Grizzly Handler for Grafana alertNotificationPolicies
func NewAlertNotificationPolicyHandler ¶ added in v0.3.0
func NewAlertNotificationPolicyHandler(provider grizzly.Provider) *AlertNotificationPolicyHandler
NewAlertNotificationPolicyHandler returns a new Grizzly Handler for Grafana alertNotificationPolicies
func (*AlertNotificationPolicyHandler) Add ¶ added in v0.3.0
func (h *AlertNotificationPolicyHandler) Add(resource grizzly.Resource) error
Add pushes a alertNotificationPolicy to Grafana via the API
func (*AlertNotificationPolicyHandler) GetByUID ¶ added in v0.3.0
func (h *AlertNotificationPolicyHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*AlertNotificationPolicyHandler) GetRemote ¶ added in v0.3.0
func (h *AlertNotificationPolicyHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
GetRemote retrieves a alertNotificationPolicy as a Resource
func (*AlertNotificationPolicyHandler) GetSpecUID ¶ added in v0.4.0
func (h *AlertNotificationPolicyHandler) GetSpecUID(resource grizzly.Resource) (string, error)
func (*AlertNotificationPolicyHandler) ListRemote ¶ added in v0.3.0
func (h *AlertNotificationPolicyHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*AlertNotificationPolicyHandler) Parse ¶ added in v0.3.0
Parse parses a manifest object into a struct for this resource type
func (*AlertNotificationPolicyHandler) ResourceFilePath ¶ added in v0.3.0
func (h *AlertNotificationPolicyHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
type AlertRuleGroupHandler ¶ added in v0.3.0
type AlertRuleGroupHandler struct {
grizzly.BaseHandler
}
AlertRuleGroupHandler is a Grizzly Handler for Grafana alertRuleGroups
func NewAlertRuleGroupHandler ¶ added in v0.3.0
func NewAlertRuleGroupHandler(provider grizzly.Provider) *AlertRuleGroupHandler
NewAlertRuleGroupHandler returns a new Grizzly Handler for Grafana alertRuleGroups
func (*AlertRuleGroupHandler) Add ¶ added in v0.3.0
func (h *AlertRuleGroupHandler) Add(resource grizzly.Resource) error
Add pushes a alertRuleGroup to Grafana via the API
func (*AlertRuleGroupHandler) GetByUID ¶ added in v0.3.0
func (h *AlertRuleGroupHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*AlertRuleGroupHandler) GetRemote ¶ added in v0.3.0
GetRemote retrieves a alertRuleGroup as a Resource
func (*AlertRuleGroupHandler) GetSpecUID ¶ added in v0.4.0
func (h *AlertRuleGroupHandler) GetSpecUID(resource grizzly.Resource) (string, error)
func (*AlertRuleGroupHandler) ListRemote ¶ added in v0.3.0
func (h *AlertRuleGroupHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*AlertRuleGroupHandler) Parse ¶ added in v0.3.0
Parse parses a manifest object into a struct for this resource type
func (*AlertRuleGroupHandler) ResourceFilePath ¶ added in v0.3.0
func (h *AlertRuleGroupHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
type ClientProvider ¶ added in v0.3.0
type ClientProvider interface { Client() (*gclient.GrafanaHTTPAPI, error) Config() *config.GrafanaConfig }
type DashboardHandler ¶
type DashboardHandler struct {
grizzly.BaseHandler
}
DashboardHandler is a Grizzly Handler for Grafana dashboards
func NewDashboardHandler ¶
func NewDashboardHandler(provider grizzly.Provider) *DashboardHandler
NewDashboardHandler returns configuration defining a new Grafana Dashboard Handler
func (*DashboardHandler) Add ¶
func (h *DashboardHandler) Add(resource grizzly.Resource) error
Add pushes a new dashboard to Grafana via the API
func (*DashboardHandler) DashboardJSONGetHandler ¶ added in v0.4.0
func (h *DashboardHandler) DashboardJSONGetHandler(p grizzly.Server) http.HandlerFunc
func (*DashboardHandler) DashboardJSONPostHandler ¶ added in v0.4.0
func (h *DashboardHandler) DashboardJSONPostHandler(p grizzly.Server) http.HandlerFunc
func (*DashboardHandler) Detect ¶ added in v0.4.0
func (h *DashboardHandler) Detect(data map[string]any) bool
func (*DashboardHandler) GetByUID ¶
func (h *DashboardHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*DashboardHandler) GetProxyEndpoints ¶ added in v0.4.0
func (h *DashboardHandler) GetProxyEndpoints(p grizzly.Server) []grizzly.ProxyEndpoint
func (*DashboardHandler) GetSpecUID ¶ added in v0.4.0
func (h *DashboardHandler) GetSpecUID(resource grizzly.Resource) (string, error)
func (*DashboardHandler) ListRemote ¶ added in v0.2.0
func (h *DashboardHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*DashboardHandler) Parse ¶
Parse parses a manifest object into a struct for this resource type
func (*DashboardHandler) Prepare ¶
func (h *DashboardHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
Prepare gets a resource ready for dispatch to the remote endpoint
func (*DashboardHandler) ProxyURL ¶ added in v0.4.0
func (h *DashboardHandler) ProxyURL(resource grizzly.Resource) (string, error)
func (*DashboardHandler) ResourceFilePath ¶ added in v0.2.0
func (h *DashboardHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
func (*DashboardHandler) RootDashboardPageHandler ¶ added in v0.4.0
func (h *DashboardHandler) RootDashboardPageHandler(p grizzly.Server) http.HandlerFunc
func (*DashboardHandler) Snapshot ¶ added in v0.4.1
func (h *DashboardHandler) Snapshot(resource grizzly.Resource, expiresSeconds int) error
Snapshot pushes dashboards as snapshots
func (*DashboardHandler) Unprepare ¶
func (h *DashboardHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
Unprepare removes unnecessary elements from a remote resource ready for presentation/comparison
type DatasourceHandler ¶
type DatasourceHandler struct {
grizzly.BaseHandler
}
DatasourceHandler is a Grizzly Handler for Grafana datasources
func NewDatasourceHandler ¶
func NewDatasourceHandler(provider grizzly.Provider) *DatasourceHandler
NewDatasourceHandler returns a new Grizzly Handler for Grafana datasources
func (*DatasourceHandler) Add ¶
func (h *DatasourceHandler) Add(resource grizzly.Resource) error
Add pushes a datasource to Grafana via the API
func (*DatasourceHandler) GetByUID ¶
func (h *DatasourceHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*DatasourceHandler) GetSpecUID ¶ added in v0.4.0
func (h *DatasourceHandler) GetSpecUID(resource grizzly.Resource) (string, error)
func (*DatasourceHandler) ListRemote ¶ added in v0.2.0
func (h *DatasourceHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*DatasourceHandler) Parse ¶
Parse parses a manifest object into a struct for this resource type
func (*DatasourceHandler) Prepare ¶
func (h *DatasourceHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
Prepare gets a resource ready for dispatch to the remote endpoint
func (*DatasourceHandler) ResourceFilePath ¶ added in v0.2.0
func (h *DatasourceHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
func (*DatasourceHandler) Unprepare ¶
func (h *DatasourceHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
Unprepare removes unnecessary elements from a remote resource ready for presentation/comparison
type ErrUidsMissing ¶
type ErrUidsMissing []string
ErrUidsMissing reports UIDs are missing for Dashboards
func (ErrUidsMissing) Error ¶
func (e ErrUidsMissing) Error() string
type FolderHandler ¶ added in v0.2.0
type FolderHandler struct {
grizzly.BaseHandler
}
FolderHandler is a Grizzly Handler for Grafana dashboard folders
func NewFolderHandler ¶ added in v0.2.0
func NewFolderHandler(provider grizzly.Provider) *FolderHandler
NewFolderHandler returns configuration defining a new Grafana Folder Handler
func (*FolderHandler) Add ¶ added in v0.2.0
func (h *FolderHandler) Add(resource grizzly.Resource) error
Add pushes a new folder to Grafana via the API
func (*FolderHandler) GetByUID ¶ added in v0.2.0
func (h *FolderHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*FolderHandler) GetSpecUID ¶ added in v0.4.0
func (h *FolderHandler) GetSpecUID(resource grizzly.Resource) (string, error)
func (*FolderHandler) ListRemote ¶ added in v0.2.0
func (h *FolderHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*FolderHandler) Parse ¶ added in v0.2.0
Parse parses a manifest object into a struct for this resource type
func (*FolderHandler) ResourceFilePath ¶ added in v0.2.0
func (h *FolderHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
func (*FolderHandler) Sort ¶ added in v0.4.0
func (h *FolderHandler) Sort(resources grizzly.Resources) grizzly.Resources
Sort sorts according to handler needs
type LibraryElementHandler ¶ added in v0.3.0
type LibraryElementHandler struct {
grizzly.BaseHandler
}
LibraryElementHandler is a Grizzly Handler for Grafana dashboard folders
func NewLibraryElementHandler ¶ added in v0.3.0
func NewLibraryElementHandler(provider grizzly.Provider) *LibraryElementHandler
NewLibraryElementHandler returns configuration defining a new Grafana Library Element Handler
func (*LibraryElementHandler) Add ¶ added in v0.3.0
func (h *LibraryElementHandler) Add(resource grizzly.Resource) error
Add pushes a new element to Grafana via the API
func (*LibraryElementHandler) GetByUID ¶ added in v0.3.0
func (h *LibraryElementHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*LibraryElementHandler) GetRemote ¶ added in v0.3.0
GetRemote retrieves an element as a resource
func (*LibraryElementHandler) GetSpecUID ¶ added in v0.4.0
func (h *LibraryElementHandler) GetSpecUID(resource grizzly.Resource) (string, error)
func (*LibraryElementHandler) ListRemote ¶ added in v0.3.0
func (h *LibraryElementHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*LibraryElementHandler) Parse ¶ added in v0.3.0
Parse parses a manifest object into a struct for this resource type
func (*LibraryElementHandler) Prepare ¶ added in v0.3.0
func (h *LibraryElementHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
Prepare gets a resource ready for dispatch to the remote endpoint
func (*LibraryElementHandler) ResourceFilePath ¶ added in v0.3.0
func (h *LibraryElementHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
func (*LibraryElementHandler) Unprepare ¶ added in v0.3.0
func (h *LibraryElementHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
Unprepare removes unnecessary elements from a remote resource ready for presentation/comparison
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a grizzly.Provider implementation for Grafana.
func NewProvider ¶ added in v0.3.0
func NewProvider(config *config.GrafanaConfig) (*Provider, error)
NewProvider instantiates a new Provider.
func (*Provider) APIVersion ¶
APIVersion returns the group and version of this provider
func (*Provider) Client ¶ added in v0.3.0
func (p *Provider) Client() (*gclient.GrafanaHTTPAPI, error)
func (*Provider) Config ¶ added in v0.4.0
func (p *Provider) Config() *config.GrafanaConfig
func (*Provider) GetHandlers ¶
GetHandlers identifies the handlers for the Grafana provider
func (*Provider) SetupProxy ¶ added in v0.4.0
func (p *Provider) SetupProxy() (*httputil.ReverseProxy, error)