v2

package
v0.0.0-test.20230316.4... Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IdParameter is special. it is not allowed to be set via the config,
	// but needs to work as normal parameter otherwise (e.g. it can be referenced).
	IdParameter = "id"

	// NameParameter is special in that it needs to exist for a config.
	NameParameter = "name"

	// ScopeParameter is special. It is the set scope as a parameter.
	// A user must not set it as a parameter in the config.
	// It is only a parameter iff the config is a settings-config.
	ScopeParameter = "scope"

	// SkipParameter is special in that config should be deployed or not
	SkipParameter = "skip"
)
View Source
const MaxFilenameLengthWithoutFileExtension = 254

Variables

DefaultParameterParsers map defining a set of default parsers which can be used to load configurations

ReservedParameterNames holds all parameter names that may not be specified by a user in a config.

Functions

func WriteConfigs

func WriteConfigs(context *WriterContext, configs []Config) []error

Types

type Config

type Config struct {
	// template used to render the request send to the dynatrace api
	Template template.Template
	// coordinates which specify the location of this configuration
	Coordinate coordinate.Coordinate
	// group this config belongs to
	Group string
	// name of the environment this configuration is for
	Environment string
	// Type holds information of the underlying config type (classic, settings, entities)
	Type Type
	// map of all parameters which will be resolved and are then available
	// in the template
	Parameters Parameters

	// Skip flag indicates if the deployment of this configuration should be skipped. It is resolved during project loading.
	Skip bool

	// SkipForConversion is only used for converting v1-configs to v2-configs.
	// It is required as the object itself does only store the resolved 'skip' value, not the actual parameter.
	SkipForConversion parameter.Parameter

	// OriginObjectId is the DT object ID of the object when it was downloaded from an environment
	OriginObjectId string
}

Config struct defining a configuration which can be deployed.

func LoadConfigs

func LoadConfigs(fs afero.Fs, context *LoaderContext) (result []Config, errors []error)

LoadConfigs will search a given path for configuration yamls and parses them. It will try to parse all configurations it finds and returns a list of parsed configs. If any error was encountered, the list of configs will be nil and only the error slice will be filled.

func (*Config) References

func (c *Config) References() []coordinate.Coordinate

func (*Config) Render

func (c *Config) Render(properties map[string]interface{}) (string, error)

type ConfigLoaderContext

type ConfigLoaderContext struct {
	*LoaderContext
	Folder string
	Path   string
}

type DefinitionParserError

type DefinitionParserError struct {
	Location coordinate.Coordinate
	Path     string
	Reason   string
}

func (DefinitionParserError) Coordinates

func (DefinitionParserError) Error

func (e DefinitionParserError) Error() string

type DetailedDefinitionParserError

type DetailedDefinitionParserError struct {
	DefinitionParserError
	EnvironmentDetails configErrors.EnvironmentDetails
}

func (DetailedDefinitionParserError) Environment

func (e DetailedDefinitionParserError) Environment() string

func (DetailedDefinitionParserError) LocationDetails

type LoaderContext

type LoaderContext struct {
	ProjectId       string
	Path            string
	Environments    []manifest.EnvironmentDefinition
	KnownApis       map[string]struct{}
	ParametersSerDe map[string]parameter.ParameterSerDe
}

type ParameterDefinitionParserError

type ParameterDefinitionParserError struct {
	DetailedDefinitionParserError
	ParameterName string
}

func (ParameterDefinitionParserError) Error

type Parameters

type Parameters map[string]parameter.Parameter

Parameters defines a map of name to parameter

type References

type References map[string]coordinate.Coordinate

References holds coordinate-string -> coordinate

type SingleConfigLoadContext

type SingleConfigLoadContext struct {
	*ConfigLoaderContext
	Type string
}

type Type

type Type struct {
	SchemaId,
	SchemaVersion,
	Api string
	EntitiesType string
}

func (Type) IsEntities

func (t Type) IsEntities() bool

func (Type) IsSettings

func (t Type) IsSettings() bool

IsSettings returns true if SchemaId is not empty

type WriterContext

type WriterContext struct {
	Fs              afero.Fs
	OutputFolder    string
	ProjectFolder   string
	ParametersSerde map[string]parameter.ParameterSerDe
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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