Documentation
¶
Index ¶
- Constants
- Variables
- func CollectorResponseStatusCheck(resp *http.Response, method, path string, wanted []int) error
- func GetSecEncryptDecrypter() (encryptDecrypter, error)
- func InitData()
- func KeywordStoreWithDrivers(kind naming.Kind) keywords.Store
- func New(p naming.Path, opts ...funcopt.O) (any, error)
- func NewCfg(path naming.Path, opts ...funcopt.O) (*cfg, error)
- func NewList(paths naming.Paths, opts ...funcopt.O) ([]any, error)
- func NewNscfg(path naming.Path, opts ...funcopt.O) (*nscfg, error)
- func NewSec(path naming.Path, opts ...funcopt.O) (*sec, error)
- func NewSvc(path naming.Path, opts ...funcopt.O) (*svc, error)
- func NewT(p naming.Path) any
- func NewUsr(path naming.Path, opts ...funcopt.O) (*usr, error)
- func NewVol(path naming.Path, opts ...funcopt.O) (*vol, error)
- func PKCS(privateKeyBytes, certificateChainBytes, passwordBytes []byte) ([]byte, error)
- func RedactSecrets(b []byte, kind string) ([]byte, error)
- func SetClusterConfig() (cluster.Config, error)
- func WithClusterConfigFile(s string) funcopt.O
- func WithConfigData(b any) funcopt.O
- func WithConfigFile(s string) funcopt.O
- func WithLogger(s *plog.Logger) funcopt.O
- func WithVolatile(s bool) funcopt.O
- type Actor
- type ActorStatus
- type ArrayItem
- type ArrayPush
- type Ccfg
- func (t *Ccfg) App() string
- func (t *Ccfg) Cluster() (*Ccfg, error)
- func (t *Ccfg) Config() *xconfig.T
- func (t *Ccfg) ConfigData() any
- func (t *Ccfg) ConfigFile() string
- func (t *Ccfg) DRPNodes() ([]string, error)
- func (t *Ccfg) Delete(ctx context.Context) error
- func (t *Ccfg) DeleteSection(ctx context.Context, rids ...string) error
- func (t *Ccfg) Dereference(ref string) (string, error)
- func (t *Ccfg) DiscardAndEditConfig() error
- func (t *Ccfg) Domain() string
- func (t *Ccfg) EditConfig() error
- func (t *Ccfg) Env() string
- func (t *Ccfg) Eval(k key.T) (interface{}, error)
- func (t *Ccfg) EvalAs(k key.T, impersonate string) (interface{}, error)
- func (t *Ccfg) EvalConfig() (rawconfig.T, error)
- func (t *Ccfg) EvalConfigAs(nodename string) (rawconfig.T, error)
- func (t *Ccfg) FQDN() string
- func (t *Ccfg) FlexMax() (int, error)
- func (t *Ccfg) FlexMin() (int, error)
- func (t *Ccfg) FlexTarget() (int, error)
- func (t *Ccfg) FreshStatus(ctx context.Context) (instance.Status, error)
- func (t *Ccfg) Get(k key.T) (interface{}, error)
- func (t *Ccfg) ID() uuid.UUID
- func (t *Ccfg) IsVolatile() bool
- func (t *Ccfg) KeywordLookup(k key.T, sectionType string) *keywords.Keyword
- func (t *Ccfg) List() (string, error)
- func (t *Ccfg) Log() *plog.Logger
- func (t *Ccfg) LogDir() string
- func (t *Ccfg) MonitorStatus(ctx context.Context) (instance.Status, error)
- func (t *Ccfg) Name() string
- func (t *Ccfg) NewCompliance() (*compliance.T, error)
- func (t *Ccfg) Node() (*Node, error)
- func (t *Ccfg) Nodes() ([]string, error)
- func (t *Ccfg) Orchestrate() string
- func (t *Ccfg) PGClean(ctx context.Context)
- func (t *Ccfg) Path() naming.Path
- func (t *Ccfg) Peers() ([]string, error)
- func (t *Ccfg) Placement() placement.Policy
- func (t *Ccfg) PostCommit() error
- func (t *Ccfg) Priority() priority.T
- func (t *Ccfg) RawConfig() (rawconfig.T, error)
- func (t *Ccfg) RecoverAndEditConfig() error
- func (t *Ccfg) Set(ctx context.Context, kops ...keyop.T) error
- func (t *Ccfg) SetPostCommit(fn func() error)
- func (t *Ccfg) SetVolatile(v bool)
- func (t *Ccfg) Status(ctx context.Context) (instance.Status, error)
- func (t *Ccfg) String() string
- func (t *Ccfg) TmpDir() string
- func (t *Ccfg) Topology() topology.T
- func (t *Ccfg) Unset(ctx context.Context, kws ...key.T) error
- func (t *Ccfg) Update(ctx context.Context, deleteSections []string, unsetKeys []key.T, ...) (err error)
- func (t *Ccfg) ValidateConfig(ctx context.Context) (xconfig.Alerts, error)
- func (t *Ccfg) VarDir() string
- type Cfg
- type CollectorConfigRaw
- type CollectorProblem
- type Configurer
- type Core
- type Data
- type DataElement
- type DataStore
- type Dataer
- type Digest
- type FlexStatus
- type KVInstall
- type KVInstallAccessControl
- type KeyStore
- type Migration
- type Node
- func (t *Node) App() string
- func (t *Node) Array(name string) array.Driver
- func (t *Node) Arrays() []array.Driver
- func (t *Node) CNIConfig() (string, error)
- func (t *Node) CNIPlugins() (string, error)
- func (t Node) Checks(ctx context.Context) (check.ResultSet, error)
- func (t *Node) ClusterConfigFile() string
- func (t *Node) Collector3RestAPIURL() (*url.URL, error)
- func (t Node) CollectorComplianceClient() (*collector.Client, error)
- func (t *Node) CollectorFeedClient() (*collector.Client, error)
- func (t *Node) CollectorFeeder() (*httphelper.T, error)
- func (t Node) CollectorInitClient() (*collector.Client, error)
- func (t *Node) CollectorRawConfig() *CollectorConfigRaw
- func (t *Node) CollectorRestAPIClient() *http.Client
- func (t *Node) CollectorRestAPIURL() (*url.URL, error)
- func (t *Node) CollectorServer() (*httphelper.T, error)
- func (t *Node) CollectorServerWithAuth(auth string) (*httphelper.T, error)
- func (t *Node) CollectorServerWithoutAuth() (*httphelper.T, error)
- func (t *Node) Config() *xconfig.T
- func (t *Node) ConfigData() any
- func (t *Node) ConfigFile() string
- func (t *Node) DNSUDSDir() string
- func (t *Node) DRPNodes() ([]string, error)
- func (t Node) DeleteSection(s ...string) error
- func (t *Node) Dequeue() error
- func (t *Node) Dereference(ref string) (string, error)
- func (t Node) DiscardAndEditConfig() error
- func (t Node) Drivers() (interface{}, error)
- func (t Node) EditConfig() error
- func (t *Node) EncapNodes() ([]string, error)
- func (t *Node) Env() string
- func (t *Node) Eval(ctx context.Context, kw string) (interface{}, error)
- func (t *Node) EvalAs(ctx context.Context, kw string, impersonate string) (interface{}, error)
- func (t *Node) EvalConfig() (rawconfig.T, error)
- func (t *Node) EvalConfigAs(impersonate string) (rawconfig.T, error)
- func (t *Node) Exists() bool
- func (t Node) ForceSysreport() error
- func (t *Node) Freeze() error
- func (t *Node) Frozen() time.Time
- func (t *Node) Get(ctx context.Context, kw string) (interface{}, error)
- func (t *Node) ID() uuid.UUID
- func (t Node) IsVolatile() bool
- func (t Node) KeywordLookup(k key.T, sectionType string) *keywords.Keyword
- func (t *Node) ListArrays() []ArrayItem
- func (t *Node) ListPools() []string
- func (t Node) LoadDisks() (disks.Disks, error)
- func (t Node) LoadPkg() ([]packages.Pkg, error)
- func (t Node) LoadSystem() (asset.Data, error)
- func (t *Node) Log() *plog.Logger
- func (t *Node) LogDir() string
- func (t *Node) MergedConfig() *xconfig.T
- func (t *Node) Nameservers() ([]string, error)
- func (t Node) NewCompliance() (*compliance.T, error)
- func (t *Node) Nodes() ([]string, error)
- func (t Node) PRKey() (string, error)
- func (t *Node) Pools() []pool.Pooler
- func (t *Node) PostCommit() error
- func (t Node) PrintCapabilities() (capabilities.L, error)
- func (t Node) PushArrays(ctx context.Context, name string) ([]ArrayPush, error)
- func (t Node) PushAsset() (asset.Data, error)
- func (t Node) PushAssetDryRun() (asset.Data, error)
- func (t Node) PushDisks() (disks.Disks, error)
- func (t Node) PushDisksDryRun() (disks.Disks, error)
- func (t Node) PushPkg() ([]packages.Pkg, error)
- func (t Node) PushPkgDryRun() ([]packages.Pkg, error)
- func (t *Node) RawConfig() (rawconfig.T, error)
- func (t Node) RecoverAndEditConfig() error
- func (t Node) Register(ctx context.Context, user, password, app string) error
- func (t Node) ScanCapabilities(ctx context.Context) (capabilities.L, error)
- func (t Node) ScanSCSI(ctx context.Context, hba, target, lun string) error
- func (t *Node) Schedules() schedule.Table
- func (t *Node) Set(ctx context.Context, kops ...keyop.T) error
- func (t *Node) SetVolatile(v bool)
- func (t *Node) ShowPools(ctx context.Context) pool.StatusList
- func (t *Node) ShowPoolsByName(ctx context.Context, name string) pool.StatusList
- func (t *Node) Stonith(nodename string) error
- func (t Node) String() string
- func (t Node) Sysreport() error
- func (t *Node) TmpDir() string
- func (t *Node) Unfreeze() error
- func (t *Node) Unset(ctx context.Context, kws ...key.T) error
- func (t *Node) Update(ctx context.Context, deleteSections []string, unsetKeys []key.T, ...) (err error)
- func (t *Node) ValidateConfig() (xconfig.Alerts, error)
- func (t *Node) VarDir() string
- type Nscfg
- type QueuedAction
- type QueuedActionDone
- type QueuedActionRunning
- type QueuedActions
- type ResizeOptions
- type ResizePlan
- type ResizeStep
- type Sec
- type Status
- type Svc
- type Usr
- type UsrDB
- type Vol
- type VolStatus
Constants ¶
const (
DefaultNodeMaxParallel = 10
)
Variables ¶
var ( ErrInvalidNode = errors.New("invalid node") ErrDisabled = errors.New("object instance is disabled") ErrEncapAgentNotInstalled = errors.New("opensvc is not installed in the container") )
var ( ErrKeyExist = errors.New("key already exists") ErrKeyEmpty = errors.New("key name is empty") ErrKeyNotExist = errors.New("key does not exist") ErrValueTooBig = errors.New("key value exceeds the allowed size") )
var (
ErrKeyNotFound = errors.New("key not found")
)
var ErrWrongType = errors.New("wrong type provided for interface")
var NodeKeywordStore = keywords.Store(append(nodePrivateKeywords, nodeCommonKeywords...))
Functions ¶
func CollectorResponseStatusCheck ¶
CollectorResponseStatusCheck verifies if the HTTP response status code matches any of the expected codes in `wanted`. If it doesn't match, attempts to decode the response body as a `CollectorProblem` and includes its details in the error.
func GetSecEncryptDecrypter ¶
func GetSecEncryptDecrypter() (encryptDecrypter, error)
func KeywordStoreWithDrivers ¶
KeywordStoreWithDrivers return the keywords supported by a specific object kind, including all resource drivers keywords.
func RedactSecrets ¶
RedactSecrets returns b with the value of every keyword declared with RedactSecret, and of every key of a sec or usr data section, replaced by asterisks. kind is the object kind the configuration belongs to, empty for a node or cluster configuration.
Only those values change. The parser writes back verbatim the lines it was not asked to touch, so comments, blank lines, spacing, inline comments and multiline layout are all preserved, and the substitution is refused if it would not parse back to the redacted value.
An unparseable configuration is an error rather than a configuration returned unredacted.
func SetClusterConfig ¶
SetClusterConfig refreshes the config data cache and returns the new config data.
func WithClusterConfigFile ¶
WithConfigFile sets a non-standard configuration location.
func WithConfigData ¶
WithConfigData sets configuration file (string) or content ([]byte) overriding what is installed in the config file. Useful for testing volatile services.
func WithConfigFile ¶
WithConfigFile sets a non-standard configuration location.
func WithLogger ¶
WithLogger let the factory user decide what kind of logging he wants
func WithVolatile ¶
WithVolatile makes sure not data is ever written by the object.
Types ¶
type Actor ¶
type Actor interface {
Core
PG() *pg.Config
IsVolatile() bool
ResourceSets() resourceset.L
ResourceByID(rid string) resource.Driver
GetActionResDeps() *actionresdeps.Store
ConfigureResources()
IsDisabled() bool
Boot(context.Context) error
Restart(context.Context) error
Run(context.Context) error
Shutdown(context.Context) error
Start(context.Context) error
StartStandby(context.Context) error
Stop(context.Context) error
PRStart(context.Context) error
PRStop(context.Context) error
PGUpdate(context.Context) error
Provision(context.Context) error
Unprovision(context.Context) error
ResourceHandlingDevice(ctx context.Context, p device.T) (resource.Driver, error)
ResourceHandlingFile(ctx context.Context, filename string) (resource.Driver, error)
SetProvisioned(context.Context) error
SetUnprovisioned(context.Context) error
SyncFull(context.Context) error
SyncResync(context.Context) error
SyncSplit(context.Context) error
SyncUpdate(context.Context) error
SyncIngest(context.Context) error
Enter(context.Context, string) error
ContainerLogs(context.Context, string, bool, int) error
ContainerLogsStream(context.Context, string, bool, int) (<-chan []byte, error)
Schedules() schedule.Table
RefreshResInfo(context.Context) (resource.Infos, error)
HardAffinity() []string
HardAntiAffinity() []string
SoftAffinity() []string
SoftAntiAffinity() []string
// contains filtered or unexported methods
}
Actor is implemented by object kinds supporting start, stop, ...
type ActorStatus ¶
type ActorStatus struct {
Avail status.T `json:"avail"`
Frozen string `json:"frozen"`
Orchestrate string `json:"orchestrate"`
Overall status.T `json:"overall"`
PlacementPolicy placement.Policy `json:"placement_policy"`
PlacementState placement.State `json:"placement_state"`
Provisioned provisioned.T `json:"provisioned"`
Topology topology.T `json:"topology"`
UpInstancesCount int `json:"up_instances_count"`
Flex *FlexStatus `json:"flex,omitempty"`
}
func (*ActorStatus) DeepCopy ¶
func (s *ActorStatus) DeepCopy() *ActorStatus
type ArrayPush ¶
type ArrayPush struct {
Name string `json:"name"`
Type string `json:"type"`
Keys int `json:"keys"`
Error string `json:"error,omitempty"`
}
ArrayPush is what came of pushing one array to the collector.
type Ccfg ¶
type Ccfg struct {
// contains filtered or unexported fields
}
Ccfg is the clusterwide configuration store.
The content is the same as node.conf, and is overridden by the definition found in node.conf.
func (*Ccfg) Cluster ¶
Cluster returns a cached Ccfg struct pointer. If none is already cached, allocate a new Ccfg{} and cache it.
func (*Ccfg) ConfigData ¶
func (t *Ccfg) ConfigData() any
func (*Ccfg) ConfigFile ¶
func (t *Ccfg) ConfigFile() string
ConfigFile returns the absolute path of an opensvc object configuration file.
func (*Ccfg) DRPNodes ¶
DRPNodes implements DRPNodes() ([]string, error) to retrieve cluster drpnodes from config cluster.drpnodes This is required because embedded implementation from core is not valid for ccfg
func (*Ccfg) DeleteSection ¶
DeleteSection deletes a resource section from object.
TODO: Fix/verify following doc If no resource selector is set, remove all etc, var and log file belonging to the object.
If a resource selector is set, only delete the corresponding sections in the configuration file.
func (*Ccfg) Dereference ¶
func (*Ccfg) DiscardAndEditConfig ¶
func (t *Ccfg) DiscardAndEditConfig() error
func (*Ccfg) EditConfig ¶
func (t *Ccfg) EditConfig() error
func (*Ccfg) EvalConfig ¶
func (*Ccfg) FlexTarget ¶
func (*Ccfg) IsVolatile ¶
func (t *Ccfg) IsVolatile() bool
func (*Ccfg) KeywordLookup ¶
func (*Ccfg) MonitorStatus ¶
func (*Ccfg) NewCompliance ¶
func (t *Ccfg) NewCompliance() (*compliance.T, error)
func (*Ccfg) Node ¶
Node returns a cached Node struct pointer. If none is already cached, allocate a new Node{} and cache it.
func (*Ccfg) Nodes ¶
Nodes implements Nodes() ([]string, error) to retrieve cluster nodes from config cluster.nodes This is required because embedded implementation from core is not valid for ccfg
func (*Ccfg) Orchestrate ¶
func (t *Ccfg) Orchestrate() string
func (*Ccfg) PostCommit ¶
func (t *Ccfg) PostCommit() error
func (*Ccfg) RecoverAndEditConfig ¶
func (t *Ccfg) RecoverAndEditConfig() error
func (*Ccfg) SetPostCommit ¶
func (t *Ccfg) SetPostCommit(fn func() error)
func (*Ccfg) SetVolatile ¶
func (t *Ccfg) SetVolatile(v bool)
func (*Ccfg) Update ¶
func (t *Ccfg) Update(ctx context.Context, deleteSections []string, unsetKeys []key.T, keyOps []keyop.T) (err error)
Update updates applies configurations changes in the configuration file.
func (*Ccfg) ValidateConfig ¶
ValidateConfig validates the configuration
type Cfg ¶
type Cfg interface {
DataStore
}
Cfg is the cfg-kind object.
These objects are unencrypted key-value store. Values can be binary or text.
A Key can be installed as a file in a Vol, then exposed to apps and containers. A Key can be exposed as a environment variable for apps and containers. A Signal can be sent to consumer processes upon exposed key value changes.
type CollectorConfigRaw ¶
type CollectorConfigRaw struct {
// contains filtered or unexported fields
}
func (*CollectorConfigRaw) AsConfig ¶
func (t *CollectorConfigRaw) AsConfig() *collector.Config
func (*CollectorConfigRaw) FeederUrl ¶
func (t *CollectorConfigRaw) FeederUrl() string
func (*CollectorConfigRaw) HasServerV3 ¶
func (t *CollectorConfigRaw) HasServerV3() bool
func (*CollectorConfigRaw) ServerUrl ¶
func (t *CollectorConfigRaw) ServerUrl() string
type CollectorProblem ¶
type CollectorProblem struct {
// contains filtered or unexported fields
}
type Configurer ¶
type Configurer interface {
ConfigFile() string
Config() *xconfig.T
EditConfig() error
RecoverAndEditConfig() error
DiscardAndEditConfig() error
RawConfig() (rawconfig.T, error)
EvalConfig() (rawconfig.T, error)
EvalConfigAs(string) (rawconfig.T, error)
Eval(key.T) (interface{}, error)
EvalAs(key.T, string) (interface{}, error)
Get(key.T) (interface{}, error)
ValidateConfig(context.Context) (xconfig.Alerts, error)
DeleteSection(context.Context, ...string) error
Delete(context.Context) error
Set(context.Context, ...keyop.T) error
Update(context.Context, []string, []key.T, []keyop.T) error
Unset(context.Context, ...key.T) error
}
Configurer is implemented by object kinds supporting get, set, unset, eval, edit, ...
func NewConfigurer ¶
NewConfigurer returns a Configurer interface from an object path
type Core ¶
type Core interface {
Configurer
Nodes() ([]string, error)
Path() naming.Path
FQDN() string
FreshStatus(context.Context) (instance.Status, error)
MonitorStatus(context.Context) (instance.Status, error)
Status(context.Context) (instance.Status, error)
// contains filtered or unexported methods
}
Core is implemented by all object kinds.
type Data ¶
Data defines a shared holder for all objects Dataer
var ( // StatusData is the package data holder for all objects statuses StatusData *Data[Status] )
func (*Data[T]) GetAll ¶
func (c *Data[T]) GetAll() []DataElement[T]
type DataElement ¶
type DataStore ¶
type DataStore interface {
Core
AddKey(name string, b []byte) error
ChangeKey(name string, b []byte) error
DecodeKey(name string) ([]byte, error)
DecodeKeys(name ...string) ([][]byte, error)
EditKey(name string) error
InstallKey(name string) error
InstallKeyTo(KVInstall) error
RemoveKey(name string) error
RenameKey(name, to string) error
Allow(string) bool
HasKey(name string) bool
AllKeys() ([]string, error)
MatchingKeys(string) ([]string, error)
TransactionAddKey(name string, b []byte) error
TransactionChangeKey(name string, b []byte) error
TransactionChangeOrAddKey(name string, b []byte) error
TransactionRemoveKey(name string) error
TransactionRenameKey(name, to string) error
}
DataStore is the base interface of sec, cfg and usr objects
type Digest ¶
type Digest struct {
IsCompat bool `json:"is_compat"`
Instances instance.StatesList `json:"instances"`
Object Status `json:"object"`
Path naming.Path `json:"path"`
}
Digest is a composite extract of different parts of the cluster status.
func NewStatus ¶
func NewStatus() *Digest
NewStatus allocates and return a struct to host an object full state dataset.
func (Digest) LoadTreeNode ¶
LoadTreeNode add the tree nodes representing the type instance into another.
func (Digest) ObjectWarningsString ¶
ObjectWarningsString returns a string presenting notable information at the object, instances-aggregated, level.
type FlexStatus ¶
type FlexStatus struct {
Target int `json:"target,omitempty"`
Min int `json:"min,omitempty"`
Max int `json:"max,omitempty"`
}
func (*FlexStatus) DeepCopy ¶
func (s *FlexStatus) DeepCopy() *FlexStatus
type KVInstall ¶
type KVInstall struct {
Required bool
ToLog *plog.Logger
ToHead string
ToPath string
FromPattern string
FromStore naming.Path
Source string
IsTemplate bool
AccessControl KVInstallAccessControl
Signals *volsignal.T
}
func (KVInstall) RelativeToPath ¶
type KVInstallAccessControl ¶
type KeyStore ¶
type KeyStore interface {
GenCert() error
GenCertificateSigningRequest() ([]byte, error)
PKCS(password []byte) ([]byte, error)
}
KeyStore is implemented by encrypting KeyStore object kinds (usr, sec).
type Migration ¶
type Migration struct {
Sets []keyop.T
Unsets []key.T
// Notes is what changed, in the words of whoever has to read the
// configuration afterwards, one line per change.
Notes []string
// Refusals is what a rule recognized and could not write, with the
// reason. A configuration keeps what nothing can migrate for it.
Refusals []string
}
Migration is what a configuration has to become for om to run what it describes, as the keyword changes a configuration update takes.
It is expressed that way so that it lands through the path every other configuration write takes: the same validation, the same policy, the same claim on a pool.
func MigrateConfig ¶
MigrateConfig is what a configuration has to become for om to run what it describes.
A configuration written for om2 describes things om3 no longer reads that way. What it asked for is still possible, in another shape, and the shape is what this writes: the configuration says the same thing afterwards, in words om3 reads.
It changes nothing by itself. What it answers is what a configuration update would take, so that the caller can show it before writing it.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is the node struct.
func (*Node) Array ¶
Array returns the driver of the array named in the node or cluster configuration, or nil when no section names it or no driver serves its type.
The name is the one of the section, and the driver is chosen by the type that section declares: the two are not the same, and looking a driver up by the name of the array only ever worked for an array named after its own type.
func (*Node) CNIPlugins ¶
func (Node) Checks ¶
Checks finds and runs the check drivers. Results are aggregated and sent to the collector.
func (*Node) ClusterConfigFile ¶
func (Node) CollectorComplianceClient ¶
func (*Node) CollectorFeeder ¶
func (t *Node) CollectorFeeder() (*httphelper.T, error)
CollectorFeeder returns new collector feeder client from config
func (*Node) CollectorRawConfig ¶
func (t *Node) CollectorRawConfig() *CollectorConfigRaw
func (*Node) CollectorRestAPIClient ¶
func (*Node) CollectorServer ¶
func (t *Node) CollectorServer() (*httphelper.T, error)
CollectorServer returns new collector server client from config
func (*Node) CollectorServerWithAuth ¶
func (t *Node) CollectorServerWithAuth(auth string) (*httphelper.T, error)
CollectorServer returns new collector server client from config
func (*Node) CollectorServerWithoutAuth ¶
func (t *Node) CollectorServerWithoutAuth() (*httphelper.T, error)
CollectorServer returns new collector server client from config
func (*Node) ConfigData ¶
func (*Node) ConfigFile ¶
func (Node) DeleteSection ¶
DeleteSection removes sections from node config
func (Node) DiscardAndEditConfig ¶
func (Node) EditConfig ¶
func (*Node) EncapNodes ¶
func (*Node) EvalAs ¶
EvalAs returns a keyword evaluated value, as if the evaluator was another node
func (Node) ForceSysreport ¶
func (*Node) Freeze ¶
Freeze creates a persistent flag file that prevents orchestration of the object instance.
func (Node) IsVolatile ¶
func (Node) KeywordLookup ¶
func (*Node) ListArrays ¶
func (*Node) MergedConfig ¶
func (*Node) Nameservers ¶
func (Node) NewCompliance ¶
func (t Node) NewCompliance() (*compliance.T, error)
func (Node) PRKey ¶
PRKey returns the SCSI3-PR key stored as node.prkey in the node config. It sets a new key if not found.
func (*Node) PostCommit ¶
func (Node) PrintCapabilities ¶
func (t Node) PrintCapabilities() (capabilities.L, error)
PrintCapabilities load and return node capabilities
func (Node) PushArrays ¶
PushArrays reports the configuration of the arrays of the cluster to the collector.
The collector is fed through the jsonrpc method it exports for the type of each array, "update_freenas" for a freenas and so on, with the section names and their contents. That is the api v2 fed.
It is the jsonrpc api and not a rest one because oc3, which takes the roles of the old collector over one at a time, exposes no array feed yet: its feeder serves the node, the instance and the object, and nothing about an array. oc3 will drop the jsonrpc api when it has taken everything over, so this call is to be moved to the rest feed the day oc3 grows one, and a rest endpoint is to be preferred over jsonrpc wherever both exist.
One array failing does not stop the others: an array that is down or whose credentials have expired must not keep the ones that are reachable from being reported. What failed is in the result, and in the error.
func (Node) PushAsset ¶
PushAsset assembles the asset inventory data. Each entry value comes from: * overrides (in config) * probes * default (code)
func (Node) RecoverAndEditConfig ¶
func (Node) Register ¶
Register logs in to the collector using the provided user credentials.
If the node is not already known to the collector, a new node uuid is generated by the collector and stored by the agent in the node config as a node.uuid key.
If user credentials are given, the POST /register collector handler is used, and the app code is supported. If no user credentials are given, the "register_node" jsonrpc handler is used, and app code is ignored.
If app is not set, the node is added to any app under the user's responsibility.
func (Node) ScanCapabilities ¶
ScanCapabilities scan node capabilities and return new capabilities
func (*Node) SetVolatile ¶
func (*Node) ShowPoolsByName ¶
func (Node) Sysreport ¶
Sysreport sends an archive of modified files the agent is configured to track, and the list of files deleted since the last call.
The collector is in charge of versioning this information and of reporting on changes.
func (*Node) Unfreeze ¶
Unfreeze removes the persistent flag file that prevents orchestration of the object instance.
func (*Node) Update ¶
func (t *Node) Update(ctx context.Context, deleteSections []string, unsetKeys []key.T, keyOps []keyop.T) (err error)
Update updates applies configurations changes in the configuration file.
func (*Node) ValidateConfig ¶
ValidateConfig node configuration
type QueuedAction ¶
type QueuedAction struct {
Command string `json:"command"`
DequeuedAt time.Time `json:"dequeued_at"`
Id int `json:"id"`
Nodename string `json:"nodename"`
QueuedAt time.Time `json:"queued_at"`
Status string `json:"status"`
SvcId string `json:"svc_id"`
Svcname string `json:"svcname"`
}
QueuedAction defines the model for QueuedAction.
type QueuedActionDone ¶
type QueuedActionDone struct {
DequeuedAt time.Time `json:"dequeued_at"`
Id int `json:"id"`
Ret int `json:"ret"`
Stderr string `json:"stderr"`
Stdout string `json:"stdout"`
}
QueuedActionDone defines the action queued result processed by the node
type QueuedActionRunning ¶
type QueuedActionRunning struct {
// Ids list of queued action ids
Ids []int `json:"ids"`
}
QueuedActionRunning defines the model for QueuedActionRunning.
type QueuedActions ¶
type QueuedActions struct {
Actions []QueuedAction `json:"actions"`
}
QueuedActions defines the model for QueuedActions.
type ResizeOptions ¶
type ResizeOptions struct {
// SkipHeadStage leaves the last stage of the chain alone. It holds
// the head, which grows only where the object is up, so a node that
// does not hold it up asks for the stages below it and is told there
// is no stage of that number to run here when it reaches the last.
SkipHeadStage bool
// Force allows a resize that would grow one replica of a replicated
// object on its own. The orchestration passes it for the phase that
// runs once every node has grown what is under the replicated
// resource.
Force bool
}
ResizeOptions tunes a resize.
type ResizePlan ¶
type ResizePlan struct {
// Steps are ordered as they would be applied, which is up from the
// device to the filesystem: the space has to exist before anything
// is stretched onto it.
Steps []ResizeStep `json:"steps"`
// Stages is how many stages the chain is grown in, which is one more
// than the number of replicated resources it crosses. Every node has
// to finish a stage before any node starts the next one: a replicated
// resource offers only what its smallest replica holds.
Stages int `json:"stages"`
}
ResizePlan is what a resize would do, in the order it would do it.
func (ResizePlan) HasWork ¶
func (t ResizePlan) HasWork() bool
HasWork says the plan changes something. A plan of links that all hold enough already changes nothing.
func (ResizePlan) String ¶
func (t ResizePlan) String() string
type ResizeStep ¶
type ResizeStep struct {
// Path names the object the resource belongs to, and is empty for
// the object the resize was asked of. A chain can cross into another
// object: a volume resource stands for the head of its volume.
Path string `json:"path,omitempty"`
RID string `json:"rid"`
Driver string `json:"driver"`
From int64 `json:"from"`
To int64 `json:"to"`
Comment string `json:"comment,omitempty"`
// Skip says the link already holds what the link above it needs, so
// there is nothing to do to it. It is listed so a plan shows the
// whole chain.
Skip bool `json:"skip,omitempty"`
// Stage is the step of the chain this link is grown in. A chain
// crossing no replicated resource has one stage, numbered 0.
Stage int `json:"stage"`
// contains filtered or unexported fields
}
ResizeStep is one link of the chain a resize walks, and the size that link is asked to reach.
func (ResizeStep) String ¶
func (t ResizeStep) String() string
type Sec ¶
Sec is the sec-kind object.
These objects are encrypted key-value store. Values can be binary or text.
A Key can be installed as a file in a Vol, then exposed to apps and containers. A Key can be exposed as a environment variable for apps and containers. A Signal can be sent to consumer processes upon exposed key value changes.
type Status ¶
type Status struct {
Priority priority.T `json:"priority"`
Scope []string `json:"scope"`
UpdatedAt time.Time `json:"updated_at"`
*ActorStatus
*VolStatus
}
Status contains the object states obtained via aggregation of all instances states. It exists when an instance config exists somewhere
type Svc ¶
type Svc interface {
Actor
}
Svc is the svc-kind object.
These objects contain front facing resources like app and containers.
type Usr ¶
type Usr interface {
Sec
}
Usr is the usr-kind object.
These objects contain a opensvc api user grants and credentials. They are required for basic, session and x509 api access, but not for OpenID access (where grants are embedded in the trusted token)
type UsrDB ¶
type UsrDB struct{}
UsrDB implements UserGrants to authenticate user and get its grants
func (*UsrDB) GrantsFromUsername ¶
GrantsFromUsername returns grants for username if username existing usr object
type Vol ¶
type Vol interface {
Actor
Head() string
HeadRID(context.Context) (string, error)
ConfiguredSize() (int64, error)
PoolName() (string, error)
ExposedDevice(context.Context) *device.T
ExposedDevices(context.Context) device.L
SubDevice(context.Context) *device.T
SubDevices(context.Context) device.L
HoldersExcept(ctx context.Context, p naming.Path) (naming.Paths, error)
Access() (volaccess.T, error)
Children() (naming.Relations, error)
}
Vol is the vol-kind object.
These objects contain cluster-dependent fs, disk and sync resources.
They are created by feeding a volume resource configuration (cluster independent) to a pool.
Source Files
¶
- actor.go
- actor_boot.go
- actor_container_logs.go
- actor_edit_config.go
- actor_enter.go
- actor_freeze.go
- actor_pg_reset.go
- actor_pg_update.go
- actor_print_schedule.go
- actor_provision.go
- actor_prstart.go
- actor_prstop.go
- actor_resinfo.go
- actor_resize.go
- actor_restart.go
- actor_run.go
- actor_set.go
- actor_set_provisioned.go
- actor_set_unprovisioned.go
- actor_shutdown.go
- actor_signal.go
- actor_start.go
- actor_startstandby.go
- actor_status.go
- actor_stop.go
- actor_sync_full.go
- actor_sync_ingest.go
- actor_sync_resync.go
- actor_sync_split.go
- actor_sync_update.go
- actor_unprovision.go
- actor_unset.go
- ccfg.go
- cfg.go
- compliance.go
- config_migrate.go
- core.go
- core_action.go
- core_compliance.go
- core_config.go
- core_delete.go
- core_edit_config.go
- core_eval.go
- core_get.go
- core_keywords.go
- core_lock.go
- core_paths.go
- core_print_config.go
- core_print_devices.go
- core_purge.go
- core_set.go
- core_status.go
- core_unset.go
- core_update_config.go
- core_validate_config.go
- data.go
- datastore.go
- datastore_key_add.go
- datastore_key_decode.go
- datastore_key_edit.go
- datastore_key_install.go
- datastore_key_list.go
- datastore_key_remove.go
- datastore_key_rename.go
- factory.go
- interfaces.go
- node.go
- node_array.go
- node_capabilities.go
- node_checks.go
- node_collector.go
- node_compliance.go
- node_config.go
- node_delete_section.go
- node_deueue.go
- node_drivers.go
- node_edit_config.go
- node_freeze.go
- node_get.go
- node_keywords.go
- node_paths.go
- node_pool.go
- node_print_schedule.go
- node_prkey.go
- node_push_array.go
- node_push_asset.go
- node_push_disks.go
- node_push_pkg.go
- node_register.go
- node_set.go
- node_stonith.go
- node_sysreport.go
- node_unset.go
- node_update_config.go
- node_validate_config.go
- nscfg.go
- pg.go
- redact.go
- sec.go
- sec_gencert.go
- sec_pkcs.go
- svc.go
- svc_disable.go
- svc_enable.go
- type_status.go
- usr.go
- vol.go