app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package app provides the grafana migration logic

Index

Constants

View Source
const (
	AMG_V10 = "10.4"
	AMG_V9  = "9.4"
	AMG_V8  = "8.4"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// Grafana api clients for source and destination workspaces
	Src, Dst api
	// SrcInput GrafanaInput
	Verbose bool
}

App is the main application struct. Contains all the required clients

func (*App) Run

func (a *App) Run() error

Run orchestrates the migration of grafana contents

type CustomGrafanaClient

type CustomGrafanaClient struct {
	Client customAPI
}

CustomGrafanaClient is another grafana client in the repo for methods not implemented by gapi

type FoldersResponse added in v0.1.10

type FoldersResponse struct {
	SrcFolders      []gapi.Folder
	MigratedFolders []gapi.Folder
	AllDstFolders   []gapi.Folder
}

FoldersResponse holds both folders in the source and destination Grafana

type GrafanaHTTPClient

type GrafanaHTTPClient struct {
	Client *gapi.Client
	Auth   aws.GrafanaAuth
	Input  *GrafanaInput
}

GrafanaHTTPClient contains the grafana client and AWS API key

type GrafanaInput

type GrafanaInput struct {
	URL              string
	WorkspaceID      string
	APIKey           string
	Region           string
	ServiceAccountID string
	WorkspaceVersion string
	IsAMG            bool
	IsGamma          bool
}

GrafanaInput holds the infos about the grafana server from the CLI

func NewGrafanaInput

func NewGrafanaInput(wkspEndpoint, url, serviceAccountID, apiKey string) (GrafanaInput, error)

NewGrafanaInput validate input from command line to return a GrafanaInput object

func (*GrafanaInput) CreateGrafanaAPIClient

func (input *GrafanaInput) CreateGrafanaAPIClient(awsgrafanacli *aws.AMG) (*GrafanaHTTPClient, error)

CreateGrafanaAPIClient create a grafana HTTP API client from the input

func (*GrafanaInput) DeleteGrafanaAuth added in v0.2.0

func (input *GrafanaInput) DeleteGrafanaAuth(awsgrafanacli *aws.AMG, auth aws.GrafanaAuth) error

DeleteGrafanaAuth delete the temporary API key from the AWS grafana workspace

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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