Documentation ¶
Index ¶
- Constants
- type App
- func (app *App) GetNoteByID(id string) (note.Note, error)
- func (app *App) GetSolutionByName(name string) (solution.Solution, error)
- func (app *App) GetSortedSolutionEnabledNotes() (allNoteIDs []string)
- func (app *App) IsNoteApplied(noteID string) (string, bool)
- func (app *App) NoteSanityCheck() error
- func (app *App) PositionInNoteApplyOrder(noteID string) int
- func (app *App) PrintNoteApplyOrder(writer io.Writer)
- func (app *App) RevertAll(permanent bool) error
- func (app *App) RevertNote(noteID string, permanent bool) error
- func (app *App) RevertSolution(solName string) error
- func (app *App) SaveConfig() error
- func (app *App) TuneAll() error
- func (app *App) TuneNote(noteID string) error
- func (app *App) TuneSolution(solName string) (removedExplicitNotes []string, err error)
- func (app *App) VerifyAll() (unsatisfiedNotes []string, ...)
- func (app *App) VerifyNote(noteID string) (conforming bool, comparisons map[string]note.FieldComparison, ...)
- func (app *App) VerifySolution(solName string) (unsatisfiedNotes []string, ...)
- type State
- func (state *State) GetPathToNote(noteID string) string
- func (state *State) List() (ret []string, err error)
- func (state *State) Remove(noteID string) error
- func (state *State) Retrieve(noteID string, dest interface{}) error
- func (state *State) Store(noteID string, obj note.Note, overwriteExisting bool) error
Constants ¶
const ( SysconfigSaptuneFile = "/etc/sysconfig/saptune" TuneForSolutionsKey = "TUNE_FOR_SOLUTIONS" TuneForNotesKey = "TUNE_FOR_NOTES" NoteApplyOrderKey = "NOTE_APPLY_ORDER" )
define saptunes main configuration file and variables
const SaptuneStateDir = "/var/lib/saptune/saved_state"
SaptuneStateDir defines saptunes saved state directory
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. NoteApplyOrder []string // list of notes in applied order. Do NOT sort. State *State // examine and manage serialised notes. }
App defines the 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)
InitialiseApp load application configuration. Panic on error.
func (*App) GetNoteByID ¶
GetNoteByID return the note corresponding to the number, or an error if the note does not exist.
func (*App) GetSolutionByName ¶
GetSolutionByName return the solution corresponding to the name, or an error if it does not exist.
func (*App) GetSortedSolutionEnabledNotes ¶
GetSortedSolutionEnabledNotes returns the number of all solution-enabled SAP notes, sorted.
func (*App) IsNoteApplied ¶
IsNoteApplied checks, if a note is applied or not return true, if note is already applied return false, if not is NOT applied
func (*App) NoteSanityCheck ¶
NoteSanityCheck checks, if for all notes listed in NoteApplyOrder and TuneForNotes a note definition file exists. if not, remove the NoteID from the variables, save the new config and inform the user
func (*App) PositionInNoteApplyOrder ¶
PositionInNoteApplyOrder returns the position of the note within the slice. for a given noteID get the position in the slice NoteApplyOrder do not sort the slice
func (*App) PrintNoteApplyOrder ¶
PrintNoteApplyOrder prints out the order of the currently applied notes
func (*App) RevertAll ¶
RevertAll revert all tuned parameters (both solutions and additional notes), and clear stored states, but NOT NoteApplyOrder.
func (*App) RevertNote ¶
RevertNote revert parameters tuned by the note and clear its stored states.
func (*App) RevertSolution ¶
RevertSolution permanently revert notes tuned by the solution and clear their stored states.
func (*App) SaveConfig ¶
SaveConfig save configuration to file /etc/sysconfig/saptune.
func (*App) TuneNote ¶
TuneNote 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 ¶
TuneSolution 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.FieldComparison, err error)
VerifyAll 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.FieldComparison, valApplyList []string, err error)
VerifyNote 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.FieldComparison, err error)
VerifySolution 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
}
State stores and manages serialised note states.
func (*State) GetPathToNote ¶
GetPathToNote returns path to the serialised note state file.