zone

package
v0.0.0-...-884d9dc Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ServerRaftSolo is the initial leader
	ServerRaftSolo ServerRaftState = 0

	// ServerRaftCandidate when the server is candidate to election
	ServerRaftCandidate = 1

	// ServerRaftFollower when the server is a follower
	ServerRaftFollower = 2

	// ServerRaftLeader when the server is the leader
	ServerRaftLeader = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	XMLName xml.Name `xml:"ZONE_POOL"`
	Zones   []Zone   `xml:"ZONE"`
}

Pool represents an OpenNebula Zone pool

type Server

type Server struct {
	ID       int    `xml:"ID"`
	Name     string `xml:"NAME"`
	Endpoint string `xml:"ENDPOINT"`
}

type ServerRaftState

type ServerRaftState int

ServerRaftState is the state of an OpenNebula server from a zone (See HA and Raft)

func (ServerRaftState) String

func (s ServerRaftState) String() string

type ServerRaftStatus

type ServerRaftStatus struct {
	ID          int `xml:"SERVER_ID"`
	StateRaw    int `xml:"STATE"`
	Term        int `xml:"TERM"`
	Votedfor    int `xml:"VOTEDFOR"`
	Commit      int `xml:"COMMIT"`
	LogIndex    int `xml:"LOG_INDEX"`
	FedlogIndex int `xml:"FEDLOG_INDEX"`
}

ServerRaftStatus contains the raft status datas of a server

func (*ServerRaftStatus) State

func (server *ServerRaftStatus) State() (ServerRaftState, error)

State looks up the state of the zone server and returns the ZoneServerRaftState

func (*ServerRaftStatus) StateString

func (server *ServerRaftStatus) StateString() (string, error)

StateString returns the state in string format

type Template

type Template struct {
	Endpoint string `xml:"ENDPOINT"`
}

type Zone

type Zone struct {
	XMLName    xml.Name `xml:"ZONE"`
	ID         int      `xml:"ID,omitempty"`
	Name       string   `xml:"NAME"`
	Template   Template `xml:"TEMPLATE"`
	ServerPool []Server `xml:"SERVER_POOL>SERVER,omitempty"`
}

Zone represents an OpenNebula Zone

Jump to

Keyboard shortcuts

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