direct

package
v0.89.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MPL-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package direct defines Direct object definitions.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidDirectType

func IsValidDirectType(directType v1alpha.DataSourceType) bool

Types

type AppDynamicsConfig

type AppDynamicsConfig struct {
	URL          string `json:"url"`
	ClientID     string `json:"clientID"`
	ClientName   string `json:"clientName"`
	AccountName  string `json:"accountName"`
	ClientSecret string `json:"clientSecret"`
}

AppDynamicsConfig represents content of AppDynamics Configuration typical for Direct Object.

type AzureMonitorConfig

type AzureMonitorConfig struct {
	TenantID     string `json:"tenantId"`
	ClientID     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
}

AzureMonitorConfig represents content of AzureMonitor Configuration typical for Direct Object.

type AzurePrometheusConfig added in v0.84.0

type AzurePrometheusConfig struct {
	URL          string `json:"url"`
	TenantID     string `json:"tenantId"`
	ClientID     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
}

AzurePrometheusConfig represents content of Azure Monitor managed service for Prometheus typical for Direct Object.

type BigQueryConfig

type BigQueryConfig struct {
	ServiceAccountKey string `json:"serviceAccountKey"`
}

BigQueryConfig represents content of BigQuery configuration typical for Direct Object.

type CloudWatchConfig

type CloudWatchConfig struct {
	// Deprecated: Access Keys are no longer supported. Switch to Cross Account IAM Roles.
	AccessKeyID string `json:"accessKeyID,omitempty"`
	// Deprecated: Access Keys are no longer supported. Switch to Cross Account IAM Roles.
	SecretAccessKey string `json:"secretAccessKey,omitempty"`
	RoleARN         string `json:"roleARN,omitempty"`
}

CloudWatchConfig represents content of CloudWatch Configuration typical for Direct Object.

type DatadogConfig

type DatadogConfig struct {
	Site           string `json:"site"`
	APIKey         string `json:"apiKey"`
	ApplicationKey string `json:"applicationKey"`
}

DatadogConfig represents content of Datadog Configuration typical for Direct Object.

type Direct

type Direct struct {
	APIVersion manifest.Version `json:"apiVersion"`
	Kind       manifest.Kind    `json:"kind"`
	Metadata   Metadata         `json:"metadata"`
	Spec       Spec             `json:"spec"`
	Status     *Status          `json:"status,omitempty"`

	Organization   string `json:"organization,omitempty"`
	ManifestSource string `json:"manifestSrc,omitempty"`
}

Direct struct which mapped one to one with kind: Direct yaml definition

Example
package main

import (
	"context"
	"log"

	"github.com/nobl9/nobl9-go/internal/examples"
	"github.com/nobl9/nobl9-go/manifest"
	"github.com/nobl9/nobl9-go/manifest/v1alpha/direct"
)

func main() {
	// Create the object:
	myDirect := direct.New(
		direct.Metadata{
			Name:        "my-direct",
			DisplayName: "My Direct",
			Project:     "default",
		},
		direct.Spec{
			Description: "Example Direct",
			Datadog: &direct.DatadogConfig{
				Site:           "eu",
				APIKey:         "secret",
				ApplicationKey: "secret",
			},
		},
	)
	// Verify the object:
	if err := myDirect.Validate(); err != nil {
		log.Fatalf("direct validation failed, err: %v", err)
	}
	// Apply the object:
	client := examples.GetOfflineEchoClient()
	if err := client.Objects().V1().Apply(context.Background(), []manifest.Object{myDirect}); err != nil {
		log.Fatalf("failed to apply direct, err: %v", err)
	}
}
Output:

apiVersion: n9/v1alpha
kind: Direct
metadata:
  name: my-direct
  displayName: My Direct
  project: default
spec:
  description: Example Direct
  datadog:
    site: eu
    apiKey: secret
    applicationKey: secret

func New

func New(metadata Metadata, spec Spec) Direct

func (Direct) GetKind

func (d Direct) GetKind() manifest.Kind

func (Direct) GetManifestSource

func (d Direct) GetManifestSource() string

func (Direct) GetName

func (d Direct) GetName() string

func (Direct) GetOrganization

func (d Direct) GetOrganization() string

func (Direct) GetProject

func (d Direct) GetProject() string

func (Direct) GetValidator added in v0.82.0

func (d Direct) GetValidator() govy.Validator[Direct]

func (Direct) GetVersion

func (d Direct) GetVersion() manifest.Version

func (Direct) SetManifestSource

func (d Direct) SetManifestSource(src string) manifest.Object

func (Direct) SetOrganization

func (d Direct) SetOrganization(org string) manifest.Object

func (Direct) SetProject

func (d Direct) SetProject(project string) manifest.Object

func (Direct) Validate

func (d Direct) Validate() error

type DynatraceConfig

type DynatraceConfig struct {
	URL            string `json:"url"`
	DynatraceToken string `json:"dynatraceToken"`
}

DynatraceConfig represents content of Dynatrace configuration typical for Direct Object.

type GCMConfig

type GCMConfig struct {
	ServiceAccountKey string `json:"serviceAccountKey"`
}

GCMConfig represents content of GCM configuration typical for Direct Object.

type HoneycombConfig

type HoneycombConfig struct {
	APIKey string `json:"apiKey"`
}

HoneycombConfig represents content of Honeycomb Configuration typical for Direct Object.

type InfluxDBConfig

type InfluxDBConfig struct {
	URL            string `json:"url"`
	APIToken       string `json:"apiToken"`
	OrganizationID string `json:"organizationID"`
}

InfluxDBConfig represents content of InfluxDB configuration typical for Direct Object.

type InstanaConfig

type InstanaConfig struct {
	APIToken string `json:"apiToken"`
	URL      string `json:"url"`
}

InstanaConfig represents content of Instana configuration typical for Direct Object.

type LightstepConfig

type LightstepConfig struct {
	Organization string `json:"organization"`
	Project      string `json:"project"`
	AppToken     string `json:"appToken"`
	URL          string `json:"url"`
}

type LogicMonitorConfig added in v0.82.0

type LogicMonitorConfig struct {
	Account   string `json:"account"`
	AccessID  string `json:"accessId"`
	AccessKey string `json:"accessKey"`
}

LogicMonitorConfig represents content of LogicMonitor Configuration typical for Direct Object.

type Metadata

type Metadata struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName,omitempty"`
	Project     string `json:"project,omitempty"`
}

type NewRelicConfig

type NewRelicConfig struct {
	AccountID        int    `json:"accountId"`
	InsightsQueryKey string `json:"insightsQueryKey"`
}

NewRelicConfig represents content of NewRelic Configuration typical for Direct Object.

type PingdomConfig

type PingdomConfig struct {
	APIToken string `json:"apiToken"`
}

PingdomConfig represents content of Pingdom Configuration typical for Direct Object.

type RedshiftConfig

type RedshiftConfig struct {
	// Deprecated: Access Keys are no longer supported. Switch to Cross Account IAM Roles.
	AccessKeyID string `json:"accessKeyID,omitempty"`
	// Deprecated: Access Keys are no longer supported. Switch to Cross Account IAM Roles.
	SecretAccessKey string `json:"secretAccessKey,omitempty"`
	SecretARN       string `json:"secretARN"`
	RoleARN         string `json:"roleARN,omitempty"`
}

RedshiftConfig represents content of Redshift configuration typical for Direct Object.

type Spec

type Spec struct {
	Description             string                           `json:"description,omitempty"`
	ReleaseChannel          v1alpha.ReleaseChannel           `json:"releaseChannel,omitempty"`
	LogCollectionEnabled    *bool                            `json:"logCollectionEnabled,omitempty"`
	Datadog                 *DatadogConfig                   `json:"datadog,omitempty"`
	NewRelic                *NewRelicConfig                  `json:"newRelic,omitempty"`
	AppDynamics             *AppDynamicsConfig               `json:"appDynamics,omitempty"`
	SplunkObservability     *SplunkObservabilityConfig       `json:"splunkObservability,omitempty"`
	ThousandEyes            *ThousandEyesConfig              `json:"thousandEyes,omitempty"`
	BigQuery                *BigQueryConfig                  `json:"bigQuery,omitempty"`
	Splunk                  *SplunkConfig                    `json:"splunk,omitempty"`
	CloudWatch              *CloudWatchConfig                `json:"cloudWatch,omitempty"`
	Pingdom                 *PingdomConfig                   `json:"pingdom,omitempty"`
	Redshift                *RedshiftConfig                  `json:"redshift,omitempty"`
	SumoLogic               *SumoLogicConfig                 `json:"sumoLogic,omitempty"`
	Instana                 *InstanaConfig                   `json:"instana,omitempty"`
	InfluxDB                *InfluxDBConfig                  `json:"influxdb,omitempty"`
	GCM                     *GCMConfig                       `json:"gcm,omitempty"`
	Lightstep               *LightstepConfig                 `json:"lightstep,omitempty"`
	Dynatrace               *DynatraceConfig                 `json:"dynatrace,omitempty"`
	AzureMonitor            *AzureMonitorConfig              `json:"azureMonitor,omitempty"`
	Honeycomb               *HoneycombConfig                 `json:"honeycomb,omitempty"`
	LogicMonitor            *LogicMonitorConfig              `json:"logicMonitor,omitempty"`
	AzurePrometheus         *AzurePrometheusConfig           `json:"azurePrometheus,omitempty"`
	HistoricalDataRetrieval *v1alpha.HistoricalDataRetrieval `json:"historicalDataRetrieval,omitempty"`
	QueryDelay              *v1alpha.QueryDelay              `json:"queryDelay,omitempty"`
	// Interval, Timeout and Jitter are readonly and cannot be set via API
	Interval *v1alpha.Interval `json:"interval,omitempty"`
	Timeout  *v1alpha.Timeout  `json:"timeout,omitempty"`
	Jitter   *v1alpha.Jitter   `json:"jitter,omitempty"`
}

Spec represents content of Spec typical for Direct Object

func (Spec) GetType

func (spec Spec) GetType() (v1alpha.DataSourceType, error)

type SplunkConfig

type SplunkConfig struct {
	URL         string `json:"url"`
	AccessToken string `json:"accessToken"`
}

SplunkConfig represents content of Splunk Configuration typical for Direct Object.

type SplunkObservabilityConfig

type SplunkObservabilityConfig struct {
	Realm       string `json:"realm"`
	AccessToken string `json:"accessToken"`
}

SplunkObservabilityConfig represents content of SplunkObservability Configuration typical for Direct Object.

type Status

type Status struct {
	DirectType string `json:"directType"`
}

Status represents content of Status optional for Direct Object

type SumoLogicConfig

type SumoLogicConfig struct {
	AccessID  string `json:"accessID"`
	AccessKey string `json:"accessKey"`
	URL       string `json:"url"`
}

SumoLogicConfig represents content of SumoLogic configuration typical for Direct Object.

type ThousandEyesConfig

type ThousandEyesConfig struct {
	OauthBearerToken string `json:"oauthBearerToken"`
}

ThousandEyesConfig represents content of ThousandEyes Configuration typical for Direct Object.

Jump to

Keyboard shortcuts

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