clusterstate

package
v0.0.0-...-1fd6aea Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

utilities to get and manipulate node states in a storage cluster

utilities to get and manipulate node states in a storage cluster

utilities to get and manipulate node states in a storage cluster

utilities to get and manipulate node states in a storage cluster

utilities to get and manipulate node states in a storage cluster

utilities to get and manipulate node states in a storage cluster

utilities to get and manipulate node states in a storage cluster

utilities to get and manipulate node states in a storage cluster

utilities to get and manipulate node states in a storage cluster

utilities to get and manipulate node states in a storage cluster

Index

Constants

View Source
const (
	OnlyLocalNode int = -2
	AllNodes      int = -1
)

Variables

This section is empty.

Functions

func NewGetClusterStateCmd

func NewGetClusterStateCmd() *cobra.Command

func NewGetNodeStateCmd

func NewGetNodeStateCmd() *cobra.Command

func NewSetNodeStateCmd

func NewSetNodeStateCmd() *cobra.Command

Types

type ClusterControllerSpec

type ClusterControllerSpec struct {
	// contains filtered or unexported fields
}

type ClusterState

type ClusterState struct {
	State struct {
		Generated StateAndReason `json:"generated"`
	} `json:"state"`
	Service map[string]struct {
		Node map[string]struct {
			Attributes struct {
				HierarchicalGroup string `json:"hierarchical-group"`
			} `json:"attributes"`
			State struct {
				Generated StateAndReason `json:"generated"`
				Unit      StateAndReason `json:"unit"`
				User      StateAndReason `json:"user"`
			} `json:"state"`
			Metrics struct {
				BucketCount             int `json:"bucket-count"`
				UniqueDocumentCount     int `json:"unique-document-count"`
				UniqueDocumentTotalSize int `json:"unique-document-total-size"`
			} `json:"metrics"`
		} `json:"node"`
	} `json:"service"`
	DistributionStates struct {
		Published struct {
			Baseline     string `json:"baseline"`
			BucketSpaces []struct {
				Name  string `json:"name"`
				State string `json:"state"`
			} `json:"bucket-spaces"`
		} `json:"published"`
	} `json:"distribution-states"`
}

cluster state as returned by the clustercontroller REST api:

func (*ClusterState) String

func (cs *ClusterState) String() string

type KnownState

type KnownState string
const (
	StateUp          KnownState = "up"
	StateDown        KnownState = "down"
	StateMaintenance KnownState = "maintenance"
	StateRetired     KnownState = "retired"
)

these are all the valid node states:

type Options

type Options struct {
	Verbose              int
	Silent               bool
	ShowHidden           showHiddenFlag
	Force                bool
	NoColors             bool
	SafeMode             bool
	NoWait               bool
	Cluster              string
	ConfigServerHost     string
	ConfigServerPort     int
	ConfigRequestTimeout int
	NodeType             string
	NodeIndex            int
	WantedState          string
}

func (*Options) String

func (v *Options) String() string

type SetNodeStateJson

type SetNodeStateJson struct {
	State struct {
		User StateAndReason `json:"user"`
	} `json:"state"`
	ResponseWait string `json:"response-wait,omitempty"`
	Condition    string `json:"condition,omitempty"`
}

type StateAndReason

type StateAndReason struct {
	State  string `json:"state"`
	Reason string `json:"reason"`
}

common struct used various places in the clustercontroller REST api:

type VespaModelConfig

type VespaModelConfig struct {
	VespaVersion string `json:"vespaVersion"`
	Hosts        []struct {
		Name     string `json:"name"`
		Services []struct {
			Name        string `json:"name"`
			Type        string `json:"type"`
			Configid    string `json:"configid"`
			Clustertype string `json:"clustertype"`
			Clustername string `json:"clustername"`
			Index       int    `json:"index"`
			Ports       []struct {
				Number int    `json:"number"`
				Tags   string `json:"tags"`
			} `json:"ports"`
		} `json:"services"`
	} `json:"hosts"`
}

func (*VespaModelConfig) String

func (m *VespaModelConfig) String() string

Jump to

Keyboard shortcuts

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