migrate

package
v0.84.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func V3toV4

func V3toV4(pathConfiguration string, pathDefinition string, pathOutput string, overwrite bool) string

Types

type ConfigEntry

type ConfigEntry struct {
	InstanceName    string            `yaml:"name,omitempty" json:"name"`         // integration instance name
	CLIArgs         []string          `yaml:"cli_args,omitempty" json:"cli_args"` // optional when executable is deduced by "name" instead of "exec"
	Exec            ShlexOpt          `yaml:"exec,omitempty" json:"exec"`         // it may be a CLI string or a YAML array
	Env             map[string]string `yaml:"env,omitempty" json:"env"`           // User-defined environment variables
	Interval        string            `yaml:"interval,omitempty" json:"interval"` // User-defined interval string (duration notation)
	Timeout         *time.Duration    `yaml:"timeout,omitempty" json:"timeout"`
	User            string            `yaml:"integration_user,omitempty" json:"integration_user"`
	WorkDir         string            `yaml:"working_dir,omitempty" json:"working_dir"`
	Labels          map[string]string `yaml:"labels,omitempty" json:"labels"`
	When            EnableConditions  `yaml:"when,omitempty" json:"when"`
	InventorySource string            `yaml:"inventory_source,omitempty" json:"inventory_source"`
}

ConfigEntry holds an integrations YAML configuration entry. It may define multiple types of tasks

type EnableConditions

type EnableConditions struct {
	// Feature allows enabling/disabling the OHI via agent cfg "feature" or cmd-channel Feature Flag
	Feature string `yaml:"feature,omitempty"`
	// FileExists conditions the execution of the OHI only if the given file path exists
	FileExists string `yaml:"file_exists,omitempty"`
	// EnvExists conditions the execution of the OHI only if the given
	// environment variables exists and match the value.
	EnvExists map[string]string `yaml:"env_exists,omitempty"`
}

EnableConditions condition the execution of an integration to the trueness of ALL the conditions

type Plugin

type Plugin struct {
	Name            string                      `yaml:"name"`             // Name of the plugin (required)
	Description     string                      `yaml:"description"`      // A short plugin description (optional)
	Commands        map[string]*PluginV1Command `yaml:"commands"`         // Map of commands for v1 plugins
	OS              string                      `yaml:"os"`               // OS (or comma-separated list of OSes) supported for the plugin
	ProtocolVersion int                         `yaml:"protocol_version"` // Protocol version (0 == original version)
}

Plugin represents a single plugin, with all associated metadata

type PluginInstanceWrapper

type PluginInstanceWrapper struct {
	IntegrationName string              `yaml:"integration_name"`
	Instances       []*PluginV1Instance `yaml:"instances"`
}

type PluginV1Command

type PluginV1Command struct {
	Command  []string `yaml:"command"`  // Command to execute, run from the plugin's directory.
	Prefix   string   `yaml:"prefix"`   // "Plugin path" for inventory data produced by the plugin. Not applicable for event sources.
	Interval int      `yaml:"interval"` // Number of seconds to wait between invocations of the source.
}

type PluginV1Instance

type PluginV1Instance struct {
	Name            string            `yaml:"name"`
	Command         string            `yaml:"command"`
	Arguments       map[string]string `yaml:"arguments"`
	Labels          map[string]string `yaml:"labels"`
	IntegrationUser string            `yaml:"integration_user"`
}

type ShlexOpt

type ShlexOpt []string

ShlexOpt is a wrapper around []string so we can use go-shlex for shell tokenizing

type V3toV4Result

type V3toV4Result struct {
	V3toV4Result string `json:"migrateV3toV4Result"`
}

V3toV4Result represents the result of a migration

Jump to

Keyboard shortcuts

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