grafana

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 6 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 {
	PublicReadAccess bool   `json:"publicReadAccess"`
	OAuth            *OAuth `json:"genericOauth,omitempty"`
}

type GetConfigResponse

type GetConfigResponse struct {
	Message          string `json:"message,omitempty"`
	PublicReadAccess bool   `json:"publicReadAccess,omitempty"`
	OAuth            *OAuth `json:"genericOauth,omitempty"`
}

type GrafanaService

type GrafanaService common.Service

GrafanaService is the service that handles CRUD functionality for Argus Grafana

func New

New returns a new handler for the service

func (*GrafanaService) GetConfig

func (svc *GrafanaService) GetConfig(ctx context.Context, projectID, instanceID string) (res GetConfigResponse, err error)

GetConfig returns argus grafana config See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#tag/grafana-configs

func (*GrafanaService) UpdateConfig

func (svc *GrafanaService) UpdateConfig(ctx context.Context, projectID, instanceID string, config Config) (res UpdateConfigResponse, err error)

UpdateConfig updates argus grafana config See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_grafana-configs_update

type OAuth

type OAuth struct {
	Enabled           bool   `json:"enabled,omitempty"`
	APIURL            string `json:"apiUrl,omitempty"`
	AuthURL           string `json:"authUrl,omitempty"`
	Scopes            string `json:"scopes,omitempty"`
	TokenURL          string `json:"tokenUrl,omitempty"`
	OauthClientID     string `json:"oauthClientId,omitempty"`
	OauthClientSecret string `json:"oauthClientSecret,omitempty"`

	// If therole_attribute_path property does not return a role, then the user is assigned the Viewer role by default.
	// You can disable the role assignment by setting role_attribute_strict = true.
	// It denies user access if no role or an invalid role is returned.
	RoleAttributeStrict bool `json:"roleAttributeStrict,omitempty"`

	// Grafana checks for the presence of a role using the JMESPath specified via the role_attribute_path
	// configuration option. The JMESPath is applied to the id_token first. If there is no match, then the UserInfo
	// endpoint specified via the api_url configuration option is tried next.
	// The result after evaluation of the role_attribute_path JMESPath expression should be a valid Grafana role,
	// for example, Viewer, Editor or Admin For example:
	// contains(roles[*], 'grafana-admin') && 'Admin' || contains(roles[*], 'grafana-editor') && 'Editor' || contains(roles[*], 'grafana-viewer') && 'Viewer'
	RoleAttributePath string `json:"roleAttributePath,omitempty"`
}

type UpdateConfigResponse

type UpdateConfigResponse struct {
	Message string `json:"message,omitempty"`
}

Jump to

Keyboard shortcuts

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