Documentation ¶
Index ¶
- func NewHttpClient() (*http.Client, error)
- func NewSyntheticMonitoringClient() (*smapi.Client, error)
- func SpecToCheck(r *grizzly.Resource) (synthetic_monitoring.Check, error)
- type CTClient
- type CTService
- type Dashboard
- type DashboardHandler
- func (h *DashboardHandler) APIVersion() string
- func (h *DashboardHandler) Add(resource grizzly.Resource) error
- func (h *DashboardHandler) FindResourceFiles(dir string) ([]string, error)
- func (h *DashboardHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *DashboardHandler) GetExtension() string
- func (h *DashboardHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *DashboardHandler) GetUID(resource grizzly.Resource) (string, error)
- func (h *DashboardHandler) Kind() string
- func (h *DashboardHandler) ListRemote() ([]string, error)
- func (h *DashboardHandler) Parse(m manifest.Manifest) (grizzly.Resources, error)
- func (h *DashboardHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
- func (h *DashboardHandler) Preview(resource grizzly.Resource, opts *grizzly.PreviewOpts) error
- func (h *DashboardHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- 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 DashboardWrapper
- type DatasourceHandler
- func (h *DatasourceHandler) APIVersion() string
- func (h *DatasourceHandler) Add(resource grizzly.Resource) error
- func (h *DatasourceHandler) FindResourceFiles(dir string) ([]string, error)
- func (h *DatasourceHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *DatasourceHandler) GetExtension() string
- func (h *DatasourceHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *DatasourceHandler) GetUID(resource grizzly.Resource) (string, error)
- func (h *DatasourceHandler) Kind() string
- func (h *DatasourceHandler) ListRemote() ([]string, error)
- func (h *DatasourceHandler) Parse(m manifest.Manifest) (grizzly.Resources, 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 ErrNon200Response
- type ErrUidsMissing
- type Folder
- type FolderHandler
- func (h *FolderHandler) APIVersion() string
- func (h *FolderHandler) Add(resource grizzly.Resource) error
- func (h *FolderHandler) FindResourceFiles(dir string) ([]string, error)
- func (h *FolderHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *FolderHandler) GetExtension() string
- func (h *FolderHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *FolderHandler) GetUID(resource grizzly.Resource) (string, error)
- func (h *FolderHandler) Kind() string
- func (h *FolderHandler) ListRemote() ([]string, error)
- func (h *FolderHandler) Parse(m manifest.Manifest) (grizzly.Resources, error)
- func (h *FolderHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
- func (h *FolderHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *FolderHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
- func (h *FolderHandler) Update(existing, resource grizzly.Resource) error
- func (h *FolderHandler) Validate(resource grizzly.Resource) error
- type Probes
- type PrometheusRuleGroup
- type PrometheusRuleGrouping
- type Provider
- type RuleHandler
- func (h *RuleHandler) APIVersion() string
- func (h *RuleHandler) Add(resource grizzly.Resource) error
- func (h *RuleHandler) FindResourceFiles(dir string) ([]string, error)
- func (h *RuleHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *RuleHandler) GetExtension() string
- func (h *RuleHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *RuleHandler) GetUID(resource grizzly.Resource) (string, error)
- func (h *RuleHandler) Kind() string
- func (h *RuleHandler) ListRemote() ([]string, error)
- func (h *RuleHandler) Parse(m manifest.Manifest) (grizzly.Resources, error)
- func (h *RuleHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
- func (h *RuleHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *RuleHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
- func (h *RuleHandler) Update(existing, resource grizzly.Resource) error
- func (h *RuleHandler) Validate(resource grizzly.Resource) error
- type SnapshotResp
- type SyntheticMonitoringHandler
- func (h *SyntheticMonitoringHandler) APIVersion() string
- func (h *SyntheticMonitoringHandler) Add(resource grizzly.Resource) error
- func (h *SyntheticMonitoringHandler) FindResourceFiles(dir string) ([]string, error)
- func (h *SyntheticMonitoringHandler) GetByUID(UID string) (*grizzly.Resource, error)
- func (h *SyntheticMonitoringHandler) GetExtension() string
- func (h *SyntheticMonitoringHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
- func (h *SyntheticMonitoringHandler) GetUID(resource grizzly.Resource) (string, error)
- func (h *SyntheticMonitoringHandler) Kind() string
- func (h *SyntheticMonitoringHandler) ListRemote() ([]string, error)
- func (h *SyntheticMonitoringHandler) Parse(m manifest.Manifest) (grizzly.Resources, error)
- func (h *SyntheticMonitoringHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
- func (h *SyntheticMonitoringHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
- func (h *SyntheticMonitoringHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
- func (h *SyntheticMonitoringHandler) Update(existing, resource grizzly.Resource) error
- func (h *SyntheticMonitoringHandler) Validate(resource grizzly.Resource) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHttpClient ¶
func NewSyntheticMonitoringClient ¶
NewSyntheticMonitoringClient creates a new client for synthetic monitoring go client
func SpecToCheck ¶
func SpecToCheck(r *grizzly.Resource) (synthetic_monitoring.Check, error)
Types ¶
type DashboardHandler ¶
type DashboardHandler struct {
Provider Provider
}
DashboardHandler is a Grizzly Handler for Grafana dashboards
func NewDashboardHandler ¶
func NewDashboardHandler(provider Provider) *DashboardHandler
NewDashboardHandler returns configuration defining a new Grafana Dashboard Handler
func (*DashboardHandler) APIVersion ¶
func (h *DashboardHandler) APIVersion() string
APIVersion returns the group and version for the provider of which this handler is a part
func (*DashboardHandler) Add ¶
func (h *DashboardHandler) Add(resource grizzly.Resource) error
Add pushes a new dashboard to Grafana via the API
func (*DashboardHandler) FindResourceFiles ¶
func (h *DashboardHandler) FindResourceFiles(dir string) ([]string, error)
FindResourceFiles identifies files within a directory that this handler can process
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) GetExtension ¶
func (h *DashboardHandler) GetExtension() string
GetExtension returns the file name extension for a dashboard
func (*DashboardHandler) GetUID ¶
func (h *DashboardHandler) GetUID(resource grizzly.Resource) (string, error)
GetUID returns the UID for a resource
func (*DashboardHandler) Kind ¶
func (h *DashboardHandler) Kind() string
Kind returns the name for this handler
func (*DashboardHandler) ListRemote ¶
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) Preview ¶
func (h *DashboardHandler) Preview(resource grizzly.Resource, opts *grizzly.PreviewOpts) error
Preview renders Jsonnet then pushes them to the endpoint if previews are possible
func (*DashboardHandler) ResourceFilePath ¶
func (h *DashboardHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
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 DashboardWrapper ¶
type DashboardWrapper struct { Dashboard Dashboard `json:"dashboard"` FolderID int64 `json:"folderId"` Overwrite bool `json:"overwrite"` Meta struct { FolderID int64 `json:"folderId"` FolderTitle string `json:"folderTitle"` FolderUID string `json:"folderUid"` FolderURL string `json:"folderUrl"` } `json:"meta"` }
DashboardWrapper adds wrapper to a dashboard JSON. Caters both for Grafana's POST API as well as GET which require different JSON.
func (*DashboardWrapper) UID ¶
func (d *DashboardWrapper) UID() string
UID retrieves the UID from a dashboard wrapper
type DatasourceHandler ¶
type DatasourceHandler struct {
Provider Provider
}
DatasourceHandler is a Grizzly Handler for Grafana datasources
func NewDatasourceHandler ¶
func NewDatasourceHandler(provider Provider) *DatasourceHandler
NewDatasourceHandler returns a new Grizzly Handler for Grafana datasources
func (*DatasourceHandler) APIVersion ¶
func (h *DatasourceHandler) APIVersion() string
APIVersion returns group and version of the provider of this resource
func (*DatasourceHandler) Add ¶
func (h *DatasourceHandler) Add(resource grizzly.Resource) error
Add pushes a datasource to Grafana via the API
func (*DatasourceHandler) FindResourceFiles ¶
func (h *DatasourceHandler) FindResourceFiles(dir string) ([]string, error)
FindResourceFiles identifies files within a directory that this handler can process
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) GetExtension ¶
func (h *DatasourceHandler) GetExtension() string
GetExtension returns the file name extension for a datasource
func (*DatasourceHandler) GetUID ¶
func (h *DatasourceHandler) GetUID(resource grizzly.Resource) (string, error)
GetUID returns the UID for a resource
func (*DatasourceHandler) Kind ¶
func (h *DatasourceHandler) Kind() string
Kind returns the kind for this handler
func (*DatasourceHandler) ListRemote ¶
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 ¶
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 ErrNon200Response ¶
func NewErrNon200Response ¶
func NewErrNon200Response(typ, uid string, resp *http.Response) ErrNon200Response
func (ErrNon200Response) Error ¶
func (e ErrNon200Response) Error() string
type ErrUidsMissing ¶
type ErrUidsMissing []string
ErrUidsMissing reports UIDs are missing for Dashboards
func (ErrUidsMissing) Error ¶
func (e ErrUidsMissing) Error() string
type FolderHandler ¶
type FolderHandler struct {
Provider Provider
}
FolderHandler is a Grizzly Handler for Grafana dashboard folders
func NewFolderHandler ¶
func NewFolderHandler(provider Provider) *FolderHandler
NewFolderHandler returns configuration defining a new Grafana Folder Handler
func (*FolderHandler) APIVersion ¶
func (h *FolderHandler) APIVersion() string
APIVersion returns the group and version for the provider of which this handler is a part
func (*FolderHandler) Add ¶
func (h *FolderHandler) Add(resource grizzly.Resource) error
Add pushes a new folder to Grafana via the API
func (*FolderHandler) FindResourceFiles ¶
func (h *FolderHandler) FindResourceFiles(dir string) ([]string, error)
FindResourceFiles identifies files within a directory that this handler can process
func (*FolderHandler) GetByUID ¶
func (h *FolderHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*FolderHandler) GetExtension ¶
func (h *FolderHandler) GetExtension() string
GetExtension returns the file name extension for a dashboard
func (*FolderHandler) GetUID ¶
func (h *FolderHandler) GetUID(resource grizzly.Resource) (string, error)
GetUID returns the UID for a resource
func (*FolderHandler) Kind ¶
func (h *FolderHandler) Kind() string
Kind returns the name for this handler
func (*FolderHandler) ListRemote ¶
func (h *FolderHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*FolderHandler) Prepare ¶
func (h *FolderHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
Prepare gets a resource ready for dispatch to the remote endpoint
func (*FolderHandler) ResourceFilePath ¶
func (h *FolderHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
func (*FolderHandler) Unprepare ¶
func (h *FolderHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
Unprepare removes unnecessary elements from a remote resource ready for presentation/comparison
type Probes ¶
type Probes struct { ByID map[int64]synthetic_monitoring.Probe ByName map[string]synthetic_monitoring.Probe }
type PrometheusRuleGroup ¶
type PrometheusRuleGroup struct { Namespace string `yaml:"-"` Name string `yaml:"name"` Rules []map[string]interface{} `yaml:"rules"` }
PrometheusRuleGroup encapsulates a list of rules
type PrometheusRuleGrouping ¶
type PrometheusRuleGrouping struct { Namespace string `json:"namespace"` Groups []PrometheusRuleGroup `json:"groups"` }
PrometheusRuleGrouping encapsulates a set of named rule groups
type Provider ¶
type Provider struct{}
Provider defines a Grafana Provider
func (*Provider) APIVersion ¶
APIVersion returns the group and version of this provider
func (*Provider) GetHandlers ¶
GetHandlers identifies the handlers for the Grafana provider
type RuleHandler ¶
type RuleHandler struct {
Provider Provider
}
RuleHandler is a Grizzly Handler for Prometheus Rules
func NewRuleHandler ¶
func NewRuleHandler(provider Provider) *RuleHandler
NewRuleHandler returns a new Grizzly Handler for Prometheus Rules
func (*RuleHandler) APIVersion ¶
func (h *RuleHandler) APIVersion() string
APIVersion returns the group and version for the provider of which this handler is a part
func (*RuleHandler) Add ¶
func (h *RuleHandler) Add(resource grizzly.Resource) error
Add pushes a datasource to Grafana via the API
func (*RuleHandler) FindResourceFiles ¶
func (h *RuleHandler) FindResourceFiles(dir string) ([]string, error)
FindResourceFiles identifies files within a directory that this handler can process
func (*RuleHandler) GetByUID ¶
func (h *RuleHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*RuleHandler) GetExtension ¶
func (h *RuleHandler) GetExtension() string
GetExtension returns the file name extension for a rule grouping
func (*RuleHandler) GetUID ¶
func (h *RuleHandler) GetUID(resource grizzly.Resource) (string, error)
GetUID returns the UID for a resource
func (*RuleHandler) Kind ¶
func (h *RuleHandler) Kind() string
Kind returns the name for this handler
func (*RuleHandler) ListRemote ¶
func (h *RuleHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*RuleHandler) Prepare ¶
func (h *RuleHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
Prepare gets a resource ready for dispatch to the remote endpoint
func (*RuleHandler) ResourceFilePath ¶
func (h *RuleHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
func (*RuleHandler) Unprepare ¶
func (h *RuleHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
Unprepare removes unnecessary elements from a remote resource ready for presentation/comparison
type SnapshotResp ¶
type SnapshotResp struct { DeleteKey string `json:"deleteKey"` DeleteURL string `json:"deleteUrl"` Key string `json:"key"` URL string `json:"url"` }
SnapshotResp encapsulates the response to a snapshot request
type SyntheticMonitoringHandler ¶
type SyntheticMonitoringHandler struct {
Provider Provider
}
SyntheticMonitoringHandler is a Grizzly Handler for Grafana Synthetic Monitoring
func NewSyntheticMonitoringHandler ¶
func NewSyntheticMonitoringHandler(provider Provider) *SyntheticMonitoringHandler
NewSyntheticMonitoringHandler returns a Grizzly Handler for Grafana Synthetic Monitoring
func (*SyntheticMonitoringHandler) APIVersion ¶
func (h *SyntheticMonitoringHandler) APIVersion() string
APIVersion returns the group and version for the provider of which this handler is a part
func (*SyntheticMonitoringHandler) Add ¶
func (h *SyntheticMonitoringHandler) Add(resource grizzly.Resource) error
Add adds a new check to the SyntheticMonitoring endpoint
func (*SyntheticMonitoringHandler) FindResourceFiles ¶
func (h *SyntheticMonitoringHandler) FindResourceFiles(dir string) ([]string, error)
FindResourceFiles identifies files within a directory that this handler can process
func (*SyntheticMonitoringHandler) GetByUID ¶
func (h *SyntheticMonitoringHandler) GetByUID(UID string) (*grizzly.Resource, error)
GetByUID retrieves JSON for a resource from an endpoint, by UID
func (*SyntheticMonitoringHandler) GetExtension ¶
func (h *SyntheticMonitoringHandler) GetExtension() string
GetExtension returns the file name extension for a check
func (*SyntheticMonitoringHandler) GetRemote ¶
func (h *SyntheticMonitoringHandler) GetRemote(resource grizzly.Resource) (*grizzly.Resource, error)
GetRemote retrieves a datasource as a Resource
func (*SyntheticMonitoringHandler) GetUID ¶
func (h *SyntheticMonitoringHandler) GetUID(resource grizzly.Resource) (string, error)
GetUID returns the UID for a resource
func (*SyntheticMonitoringHandler) Kind ¶
func (h *SyntheticMonitoringHandler) Kind() string
Kind returns the name for this handler
func (*SyntheticMonitoringHandler) ListRemote ¶
func (h *SyntheticMonitoringHandler) ListRemote() ([]string, error)
ListRemote retrieves as list of UIDs of all remote resources
func (*SyntheticMonitoringHandler) Parse ¶
Parse parses a manifest object into a struct for this resource type
func (*SyntheticMonitoringHandler) Prepare ¶
func (h *SyntheticMonitoringHandler) Prepare(existing, resource grizzly.Resource) *grizzly.Resource
Prepare gets a resource ready for dispatch to the remote endpoint
func (*SyntheticMonitoringHandler) ResourceFilePath ¶
func (h *SyntheticMonitoringHandler) ResourceFilePath(resource grizzly.Resource, filetype string) string
ResourceFilePath returns the location on disk where a resource should be updated
func (*SyntheticMonitoringHandler) Unprepare ¶
func (h *SyntheticMonitoringHandler) Unprepare(resource grizzly.Resource) *grizzly.Resource
Unprepare removes unnecessary elements from a remote resource ready for presentation/comparison