Documentation ¶
Overview ¶
Package download provides all functionality required to download configuration from a Dynatrace tenant as Monaco configuration files.
Basically, the download happens in 3 steps.
- Download all specified APIs (or all APIs if non are specified) from Dynatrace into our in-memory representation.
- Resolve dependencies between the components
- Write the in-memory representation to disk
Downloading ¶
Entry point: pkg/github.com/Dynatrace/Dynatrace-Config-Manager/one-topology/pkg/download/downloader.DownloadAllConfigs
Downloading happens in the downloader-subpackage.
Dependency resolution ¶
Entry point: ResolveDependencies
Our current approach for dependency resolution is very basic. We collect all ids off all the configs we downloaded, and search all templates for any occurances of those ids. In case of an occurrence, the occurrence is replaced by a generic variable, and added as a reference.
Persistence ¶
Entry point: WriteToDisk
When persisting, all configs that were downloaded are stored in a project folder inside either a specified outputFolder, or a default folder named 'download_{TIMESTAMP}'.
If any existing configs are located there, they are overwritten.
In addition to downloaded configurations, a manifest file is created which can be used to deploy the downloaded configs. If a manifest.yaml already exists in the outputFolder a timestamp is appended and a new manifest created to ensure a config 'update' does not destroy existing manifests.
The result of WriteToDisk will be a full configuration project and manifest with which that project can be deployed, written to the Filesystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProjectData ¶
func CreateProjectData(downloadedConfigs project.ConfigsPerType, projectName string) project.Project
func ResolveDependencies ¶
func ResolveDependencies(configs project.ConfigsPerType) project.ConfigsPerType
ResolveDependencies resolves all id-dependencies between downloaded configs.
We do this by collecting all ids of all configs, and then simply by searching for them in templates. If we find an occurrence, we replace it with a generic variable and reference the config.
func WriteToDisk ¶
func WriteToDisk(fs afero.Fs, writerContext WriterContext) error
WriteToDisk writes all projects to the disk
Types ¶
type WriterContext ¶
type WriterContext struct { EnvironmentUrl string ProjectToWrite project.Project Auth manifest.Auth EnvironmentType manifest.EnvironmentType OutputFolder string ForceOverwriteManifest bool // contains filtered or unexported fields }
func (WriterContext) GetOutputFolderFilePath ¶
func (c WriterContext) GetOutputFolderFilePath() string