torequest

package
v7.0.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 23 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigFile

type ConfigFile struct {
	Name              string // file name
	Dir               string // install directory
	Path              string // full path
	Service           string // service assigned to
	CfgBackup         string // location to backup the config at 'Path'
	TropsBackup       string // location to backup the TrafficOps Version
	AuditComplete     bool   // audit is complete
	AuditFailed       bool   // audit failed
	ChangeApplied     bool   // a change has been applied
	ChangeNeeded      bool   // change required
	PreReqFailed      bool   // failed plugin prerequiste check
	RemapPluginConfig bool   // file is a remap plugin config file
	Body              []byte
	Perm              os.FileMode // default file permissions
	Uid               int         // owner uid, default is 0
	Gid               int         // owner gid, default is 0
	Warnings          []string
}

type FileRestartData

type FileRestartData struct {
	Name string
	RestartData
}

type Package

type Package struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type RestartData

type RestartData struct {
	TrafficCtlReload     bool // a traffic_ctl_reload is required
	SysCtlReload         bool // a reload of the sysctl.conf is required
	NtpdRestart          bool // ntpd needs restarting
	TeakdRestart         bool // a restart of teakd is required
	TrafficServerRestart bool // a trafficserver restart is required
	RemapConfigReload    bool // remap.config should be reloaded
}

type ServerAndConfigs

type ServerAndConfigs struct {
	ConfigData  json.RawMessage
	ConfigFiles json.RawMessage
}

type ShouldReloadRestart

type ShouldReloadRestart struct {
	ReloadRestart []FileRestartData
}

type TrafficOpsReq

type TrafficOpsReq struct {
	Cfg config.Cfg

	RestartData
	// contains filtered or unexported fields
}

func NewTrafficOpsReq

func NewTrafficOpsReq(cfg config.Cfg) *TrafficOpsReq

NewTrafficOpsReq returns a new TrafficOpsReq object.

func (*TrafficOpsReq) CheckReloadRestart

func (r *TrafficOpsReq) CheckReloadRestart(data []FileRestartData) RestartData

CheckReloadRestart determines the final reload/restart state after all config files are processed.

func (*TrafficOpsReq) CheckRevalidateState

func (r *TrafficOpsReq) CheckRevalidateState(sleepOverride bool) (UpdateStatus, error)

CheckRevalidateState retrieves and returns the revalidate status from Traffic Ops.

func (*TrafficOpsReq) CheckSyncDSState

func (r *TrafficOpsReq) CheckSyncDSState() (UpdateStatus, error)

CheckSYncDSState retrieves and returns the DS Update status from Traffic Ops.

func (*TrafficOpsReq) CheckSystemServices

func (r *TrafficOpsReq) CheckSystemServices() error

CheckSystemServices is used to verify that packages installed are enabled for startup.

func (*TrafficOpsReq) DumpConfigFiles

func (r *TrafficOpsReq) DumpConfigFiles()

DumpConfigFiles is used for debugging

func (*TrafficOpsReq) GetConfigFile

func (r *TrafficOpsReq) GetConfigFile(name string) (*ConfigFile, bool)

GetConfigFile fetchs a 'Configfile' by file name.

func (*TrafficOpsReq) GetConfigFileList

func (r *TrafficOpsReq) GetConfigFileList() error

GetConfigFileList fetches and parses the multipart config files for a cache from traffic ops and loads them into the configFiles map.

func (*TrafficOpsReq) IsPackageInstalled

func (r *TrafficOpsReq) IsPackageInstalled(name string) bool

IsPackageInstalled returns true/false if the named rpm package is installed. the prefix before the version is matched.

func (*TrafficOpsReq) PrintWarnings

func (r *TrafficOpsReq) PrintWarnings()

func (*TrafficOpsReq) ProcessConfigFiles

func (r *TrafficOpsReq) ProcessConfigFiles() (UpdateStatus, error)

ProcessConfigFiles processes all config files retrieved from Traffic Ops.

func (*TrafficOpsReq) ProcessPackages

func (r *TrafficOpsReq) ProcessPackages() error

ProcessPackages retrieves a list of required RPM's from Traffic Ops and determines which need to be installed or removed on the cache.

func (*TrafficOpsReq) RevalidateWhileSleeping

func (r *TrafficOpsReq) RevalidateWhileSleeping() (UpdateStatus, error)

func (*TrafficOpsReq) StartServices

func (r *TrafficOpsReq) StartServices(syncdsUpdate *UpdateStatus) error

StartServices reloads, restarts, or starts ATS as necessary, according to the changed config files and run mode. Returns nil on success or any error.

func (*TrafficOpsReq) UpdateTrafficOps

func (r *TrafficOpsReq) UpdateTrafficOps(syncdsUpdate *UpdateStatus) error

type UpdateStatus

type UpdateStatus int
const (
	UpdateTropsNotNeeded  UpdateStatus = 0
	UpdateTropsNeeded     UpdateStatus = 1
	UpdateTropsSuccessful UpdateStatus = 2
	UpdateTropsFailed     UpdateStatus = 3
)

func (UpdateStatus) String

func (u UpdateStatus) String() string

Jump to

Keyboard shortcuts

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