kustoutils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterNameFromURI

func ClusterNameFromURI(uri string) string

ClusterNameFromURI returns the cluster name from the given URI

func ConfigMapToFile

func ConfigMapToFile(data string) (string, error)

ConfigMapToFile stores the data given from the `ConfigMap` in a file TODO: rename?

func Difference

func Difference(a, b []string) []string

Difference returns the elements in `a` that aren't in `b`.

func RunDeltaKusto

func RunDeltaKusto(deltaCfgfile string) error

RunDeltaKusto runs delta-kusto on the provided job configuration file.

Types

type KustoCluster

type KustoCluster struct {
	URI       string
	Databases []string
	Client    *kusto.Client
	// contains filtered or unexported fields
}

KustoCluster represents a kusto cluster

func NewKustoCluster

func NewKustoCluster(uri string) *KustoCluster

NewKustoCluster returns a new KustoCluster object with a client initialized

func (*KustoCluster) AquireTargets

AquireTargets filters the DBs in the cluster and matchs them with the filter to return DBs to execute on.

func (*KustoCluster) CreateExecConfiguration

func (c *KustoCluster) CreateExecConfiguration(targets schemav1alpha1.ClusterTargets, cfgMap *v1.ConfigMap, failIfDataLoss bool) (schemav1alpha1.ExecutionConfiguration, error)

CreateExecConfiguration creates execution configuration for the given targets and `ConfigMap` configuration.

func (*KustoCluster) Execute

Execute runs the `ExecutionConfiguration` on the provided targets

func (*KustoCluster) ListDatabases

func (c *KustoCluster) ListDatabases(expression string) ([]string, error)

ListDatabases lists kusto databases matching the regexp expression.

type Query

type Query struct {
	Cluster string
	Label   string
}

Query holds the query parameters for the webhook

type Response

type Response struct {
	DBS []string `json:"dbs"`
}

Response is the expected Webhook response

type WebHookClient

type WebHookClient struct {
	HttpClient *http.Client
}

WebHookClient holds the http client for the webhook

func NewWebHookClient

func NewWebHookClient(httpClient *http.Client) *WebHookClient

NewWebHookClient creates a new `WebHookClient`

func (*WebHookClient) PerformQuery

func (c *WebHookClient) PerformQuery(url, server, label string) ([]string, error)

PerformQuery calls the webhook with the provided parameters

type Wrapper

type Wrapper struct {
	Executer string
}

Wrapper is a delta-kusto thin wrapper

func NewDeltaWrapper

func NewDeltaWrapper() *Wrapper

NewDeltaWrapper returns a `Wrapper` for delta-kusto

func (*Wrapper) CreateExecConfiguration

func (w *Wrapper) CreateExecConfiguration(uri string, dbs []string, kqlFile string, failIfDataLoss bool) (string, error)

CreateExecConfiguration returns a job configuration file for delta-kusto

Jump to

Keyboard shortcuts

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