cib

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	JoinDown    joinState = "down"
	JoinPending joinState = "pending"
	JoinMember  joinState = "member"
	JoinBanned  joinState = "banned"
)

Variables

View Source
var (
	ErrCibFailed = errors.New("Failed to read the CRM configuration. Maybe the cluster is not started on this node?")
)

Functions

func GetNvPairValue

func GetNvPairValue(elem *xmltree.Element, name string) (*xmltree.Attr, error)

Types

type CIB

type CIB struct {
	Doc *xmltree.Document
}

func (*CIB) CreateResource

func (c *CIB) CreateResource(xml string) error

func (*CIB) DissolveConstraints

func (c *CIB) DissolveConstraints(delItems []string)

Removes CRM constraints that refer to the specified delItems names from the CIB XML document tree

func (*CIB) FindLrmState

func (c *CIB) FindLrmState(id string) LrmRunState

func (*CIB) FindNodeState added in v0.1.1

func (c *CIB) FindNodeState(uname string) (NodeState, error)

func (*CIB) FindResource

func (c *CIB) FindResource(id string) *xmltree.Element

func (*CIB) ReadConfiguration

func (c *CIB) ReadConfiguration() error

ReadConfiguration calls the crm list command and parses the XML data it returns.

func (*CIB) SetStonithEnabled

func (c *CIB) SetStonithEnabled(value bool) error

func (*CIB) StartResource

func (c *CIB) StartResource(id string) error

func (*CIB) StopResource

func (c *CIB) StopResource(id string) error

func (*CIB) Update

func (c *CIB) Update() error

func (*CIB) WaitForResourcesStop

func (c *CIB) WaitForResourcesStop(idsToStop []string) (bool, error)

WaitForResourcesStop waits for CRM resources to stop

It returns a flag indicating whether resources are stopped (true) or not (false), and an error.

type ClusterProperty

type ClusterProperty string
const (
	StonithEnabled ClusterProperty = "cib-bootstrap-options-stonith-enabled"
)

type LrmRunState

type LrmRunState int

LrmRunState represents the state of a CRM resource.

const (
	// Unknown means that the resource's state could not be retrieved
	Unknown LrmRunState = iota
	// Running means that the resource is verified as running
	Running
	// Stopped means that the resource is verfied as stopped
	Stopped
)

func (LrmRunState) MarshalJSON

func (l LrmRunState) MarshalJSON() ([]byte, error)

func (LrmRunState) String

func (l LrmRunState) String() string

type NodeState added in v0.1.1

type NodeState struct {
	Ha           bool
	InCCM        bool
	Crmd         bool
	Join         joinState
	JoinExpected joinState
}

Jump to

Keyboard shortcuts

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