sapsystem

package
v0.0.0-...-ba26d65 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SapDefaultProfile string = "DEFAULT.PFL"
)

Variables

This section is empty.

Functions

func FindInstances

func FindInstances(fs afero.Fs, sapPath string) ([][]string, error)

FindInstances returns the installed SAP instances in the /usr/sap/${SID} folder It returns a list with [instanceName, instanceNumber] combination

func FindProfiles

func FindProfiles(fs afero.Fs, sid string) ([]string, error)

FindProfiles returns the latest profile file names in the /sapmnt/${SID}/folder folder

func FindSystems

func FindSystems(fs afero.Fs) ([]string, error)

FindSystems returns the installed SAP systems in the /usr/sap folder It returns the list of found SAP system paths

func GetProfileData

func GetProfileData(fs afero.Fs, profilePath string) (map[string]string, error)

GetProfileData returns the SAP profile file content

func Md5sum

func Md5sum(data string) string

Types

type DatabaseData

type DatabaseData struct {
	Database  string
	Container string
	User      string
	Group     string
	UserID    string `json:"UserId"`
	GroupID   string `json:"GroupId"`
	Host      string
	SQLPort   string `json:"SqlPort"`
	Active    string
}

func GetDatabases

func GetDatabases(fs afero.Fs, sid string) ([]*DatabaseData, error)

The content type of the databases.lst looks like # DATABASE:CONTAINER:USER:GROUP:USERID:GROUPID:HOST:SQLPORT:ACTIVE PRD::::::hana02:30015:yes DEV::::::hana02:30044:yes

type HdbnsutilSRstate

type HdbnsutilSRstate map[string]interface{}

type HostConfiguration

type HostConfiguration map[string]interface{}

type SAPControl

type SAPControl struct {
	Processes  []*sapcontrol.OSProcess
	Instances  []*sapcontrol.SAPInstance
	Properties []*sapcontrol.InstanceProperty
}

func NewSAPControl

func NewSAPControl(ctx context.Context, w sapcontrol.WebService) (*SAPControl, error)

type SAPInstance

type SAPInstance struct {
	Name       string
	Type       SystemType
	Host       string
	SAPControl *SAPControl
	// Only for Database type
	SystemReplication SystemReplication
	HostConfiguration HostConfiguration
	HdbnsutilSRstate  HdbnsutilSRstate
}

func NewSAPInstance

func NewSAPInstance(
	ctx context.Context,
	w sapcontrolapi.WebService,
	executor utils.CommandExecutor,
) (*SAPInstance, error)

type SAPProfile

type SAPProfile map[string]string

type SAPSystem

type SAPSystem struct {
	ID        string `json:"Id"`
	SID       string
	Type      SystemType
	Profile   SAPProfile
	Instances []*SAPInstance
	// Only for Database type
	Databases []*DatabaseData
	// Only for Application type
	DBAddress string
}

A SAPSystem in this context is a SAP installation under one SID. It will have application or database type, mutually exclusive The Id parameter is not yet implemented

func NewSAPSystem

func NewSAPSystem(
	ctx context.Context,
	fs afero.Fs,
	executor utils.CommandExecutor,
	webService sapcontrolapi.WebServiceConnector,
	sysPath string,
) (*SAPSystem, error)

func (*SAPSystem) GetDBAddress

func (system *SAPSystem) GetDBAddress() (string, error)

type SAPSystemsList

type SAPSystemsList []*SAPSystem

func NewDefaultSAPSystemsList

func NewDefaultSAPSystemsList(ctx context.Context) (SAPSystemsList, error)

func NewSAPSystemsList

func NewSAPSystemsList(
	ctx context.Context,
	fs afero.Fs,
	executor utils.CommandExecutor,
	webService sapcontrolapi.WebServiceConnector,
) (SAPSystemsList, error)

func (SAPSystemsList) GetSIDsString

func (sl SAPSystemsList) GetSIDsString() string

type SAPSystemsMap

type SAPSystemsMap map[string]*SAPSystem

type SystemReplication

type SystemReplication map[string]interface{}

type SystemType

type SystemType int
const (
	Unknown SystemType = iota
	Database
	Application
	DiagnosticsAgent
)

Directories

Path Synopsis
generated nolint
generated nolint

Jump to

Keyboard shortcuts

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