app

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Overview

Package app provides the grafana migration logic

Index

Constants

This section is empty.

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
}

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

func (*App) Run

func (a *App) Run(srcCustomGrafanaClient CustomGrafanaClient) error

Run orchestrates the migration of grafana contents TODO: allow specifying what to migrate or all (dashboard, ...)

type CustomGrafanaClient

type CustomGrafanaClient struct {
	Client customAPI
}

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

type GrafanaHTTPClient

type GrafanaHTTPClient struct {
	Client *gapi.Client
	Key    aws.AMGApiKey
	Input  *GrafanaInput
}

GrafanaHTTPClient contains the grafana client and AWS API key

type GrafanaInput

type GrafanaInput struct {
	URL         string
	WorkspaceID string
	APIKey      string
	Region      string
	IsAMG       bool
	//TODO: remove
	IsGamma bool
}

GrafanaInput holds the infos about the grafana server from the CLI

func NewGrafanaInput

func NewGrafanaInput(wkspEndpoint, url, 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) DeleteAPIKeys

func (input *GrafanaInput) DeleteAPIKeys(awsgrafanacli *aws.AMG, apiKey aws.AMGApiKey) error

DeleteAPIKeys 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