app

package
v0.0.0-...-5732428 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2017 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SysconfigSaptuneDir = "/etc/sysconfig/saptune"
	TuneForSolutionsKey = "TUNE_FOR_SOLUTIONS"
	TuneForNotesKey     = "TUNE_FOR_NOTES"
)
View Source
const SaptuneStateDir = "/var/lib/saptune/saved_state"

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	SysconfigPrefix  string
	AllNotes         map[string]note.Note         // all notes
	AllSolutions     map[string]solution.Solution // all solutions
	TuneForSolutions []string                     // list of solution names to tune, must always be sorted in ascending order.
	TuneForNotes     []string                     // list of additional notes to tune, must always be sorted in ascending order.
	State            *State                       // examine and manage serialised notes.
}

Application configuration and serialised state information.

func InitialiseApp

func InitialiseApp(sysconfigPrefix, stateDirPrefix string, allNotes map[string]note.Note, allSolutions map[string]solution.Solution) (app *App)

Load application configuration. Panic on error.

func (*App) GetNoteByID

func (app *App) GetNoteByID(id string) (note.Note, error)

Return the note corresponding to the number, or an error if the note does not exist.

func (*App) GetSolutionByName

func (app *App) GetSolutionByName(name string) (solution.Solution, error)

Return the solution corresponding to the name, or an error if it does not exist.

func (*App) GetSortedSolutionEnabledNotes

func (app *App) GetSortedSolutionEnabledNotes() (allNoteIDs []string)

Return the number of all solution-enabled SAP notes, sorted.

func (*App) RevertAll

func (app *App) RevertAll(permanent bool) error

Revert all tuned parameters (both solutions and additional notes), and clear stored states.

func (*App) RevertNote

func (app *App) RevertNote(noteID string, permanent bool) error

Revert parameters tuned by the note and clear its stored states.

func (*App) RevertSolution

func (app *App) RevertSolution(solName string) error

Permanently revert notes tuned by the solution and clear their stored states.

func (*App) SaveConfig

func (app *App) SaveConfig() error

Save /etc/sysconfig/saptune.

func (*App) TuneAll

func (app *App) TuneAll() error

Tune for all currently enabled solutions and notes.

func (*App) TuneNote

func (app *App) TuneNote(noteID string) error

Apply tuning for a note. If the note is not yet covered by one of the enabled solutions, the note number will be added into the list of additional notes.

func (*App) TuneSolution

func (app *App) TuneSolution(solName string) (removedExplicitNotes []string, err error)

Apply tuning for a solution. If the solution is not yet enabled, the name will be added into the list of tuned solution names. If the solution covers any of the additional notes, those notes will be removed.

func (*App) VerifyAll

func (app *App) VerifyAll() (unsatisfiedNotes []string, comparisons map[string]map[string]note.NoteFieldComparison, err error)

Inspect the system and verify all parameters against all enabled notes/solutions. The note comparison results will always contain all fields from all notes.

func (*App) VerifyNote

func (app *App) VerifyNote(noteID string) (conforming bool, comparisons map[string]note.NoteFieldComparison, err error)

Inspect the system and verify that all parameters conform to the note's guidelines. The note comparison results will always contain all fields, no matter the note is currently conforming or not.

func (*App) VerifySolution

func (app *App) VerifySolution(solName string) (unsatisfiedNotes []string, comparisons map[string]map[string]note.NoteFieldComparison, err error)

Inspect the system and verify that all parameters conform to all of the notes associated to the solution. The note comparison results will always contain all fields from all notes.

type State

type State struct {
	StateDirPrefix string
}

Store and manage serialised note states.

func (*State) GetPathToNote

func (state *State) GetPathToNote(noteID string) string

Return path to the serialised note state file.

func (*State) List

func (state *State) List() (ret []string, err error)

List all stored note states. Return note numbers.

func (*State) Remove

func (state *State) Remove(noteID string) error

Remove a serialised state file.

func (*State) Retrieve

func (state *State) Retrieve(noteID string, dest interface{}) error

Deserialise an SAP note into the destination pointer. The destination must be a pointer.

func (*State) Store

func (state *State) Store(noteID string, obj note.Note, overwriteExisting bool) error

Create a file under state directory with the object serialised into JSON. Overwrite existing file if there is any.

Jump to

Keyboard shortcuts

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