daemonapi

package
v3.0.0-rc46 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 113 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClaimOverrun = errors.New("claim overrun")

ErrClaimOverrun is a configuration write taking the namespace over what it claimed of a cluster resource.

View Source
var ErrConfigChanged = xconfig.ErrConfigChanged

ErrConfigChanged is a configuration write refused because the file changed after the write was checked against it.

View Source
var ErrDenied = errors.New("denied")

ErrDenied heads every refusal the keyword policy makes, so a caller deep enough to have lost sight of why an update failed can still answer with the forbidden it is rather than an internal error.

View Source
var ErrInvalidConfig = errors.New("invalid configuration")

ErrInvalidConfig is what a configuration update the validation refuses is, so a caller answers with the bad request it is rather than an internal error. The message is the validation's, naming the keywords refused.

Functions

func AuthMiddleware

func AuthMiddleware(parent context.Context) echo.MiddlewareFunc

func GetClusterIPs

func GetClusterIPs() clusterip.L

func GetLogger

func GetLogger(c echo.Context) *plog.Logger

func JSONForbiddenMissingGrant

func JSONForbiddenMissingGrant(ctx echo.Context, missing ...rbac.Grant) error

func JSONForbiddenMissingRole

func JSONForbiddenMissingRole(ctx echo.Context, missing ...rbac.Role) error

func JSONForbiddenStrategy

func JSONForbiddenStrategy(ctx echo.Context, strategy string, expected ...string) error

func JSONFromSetInstanceMonitorError

func JSONFromSetInstanceMonitorError(eCtx echo.Context, value *instance.MonitorUpdate, err error) error

JSONFromSetInstanceMonitorError sends a JSON response where status code depends on SetMonitorUpdate error value.

  • StatusOK: expectation value accepted
  • StatusRequestTimeout: request context DeadlineExceeded or timeout reached
  • StatusConflict: expectation value refused

func JSONFromSetNodeMonitorError

func JSONFromSetNodeMonitorError(eCtx echo.Context, value *node.MonitorUpdate, err error) error

JSONFromSetNodeMonitorError sends a JSON response where status code depends on SetNodeMonitor error value.

  • StatusOK: expectation value accepted
  • StatusRequestTimeout: request context DeadlineExceeded or timeout reached
  • StatusConflict: expectation value refused

func JSONProblem

func JSONProblem(ctx echo.Context, code int, title, detail string) error

func JSONProblemf

func JSONProblemf(ctx echo.Context, code int, title, format string, a ...any) error

func LogHandler

func LogHandler(c echo.Context, name string) *plog.Logger

func LogMiddleware

func LogMiddleware(parent context.Context) echo.MiddlewareFunc

func LogRequestMiddleWare

func LogRequestMiddleWare(parent context.Context) echo.MiddlewareFunc

func LogUserMiddleware

func LogUserMiddleware(parent context.Context) echo.MiddlewareFunc

func RateLimiterWithConfig

func RateLimiterWithConfig(parent context.Context) echo.MiddlewareFunc

func SubQS

func SubQS(ctx context.Context) pubsub.QueueSizer

SubQS function returns api pubsub.QueueSizer from context

func UIMiddleware

func UIMiddleware(_ context.Context, prefix string, specURL string) echo.MiddlewareFunc

func WithSubQS

func WithSubQS(parent context.Context, subQS pubsub.QueueSizer) context.Context

WithSubQS function returns copy of parent with api pubsub.QueueSizer.

Types

type DaemonAPI

type DaemonAPI struct {
	AuditRegistry *auditstate.Registry
	Bus           pubsub.Buser
	Daemondata    *daemondata.T
	JWTcreator    JWTCreater

	LabelLocalhost pubsub.Label

	SubQS pubsub.QueueSizer
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context) *DaemonAPI

func (*DaemonAPI) CheckDataSize

func (a *DaemonAPI) CheckDataSize(ctx echo.Context) (bool, error)

func (*DaemonAPI) DeleteDaemonExecs

func (a *DaemonAPI) DeleteDaemonExecs(ctx echo.Context, nodename string, params api.DeleteDaemonExecsParams) error

func (*DaemonAPI) DeleteObjectDataKey

func (a *DaemonAPI) DeleteObjectDataKey(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.DeleteObjectDataKeyParams) error

func (*DaemonAPI) GetArray

func (a *DaemonAPI) GetArray(ctx echo.Context, params api.GetArrayParams) error

func (*DaemonAPI) GetAuthInfo

func (a *DaemonAPI) GetAuthInfo(ctx echo.Context) error

func (*DaemonAPI) GetAuthWhoAmI

func (a *DaemonAPI) GetAuthWhoAmI(ctx echo.Context) error

func (*DaemonAPI) GetClusterConfig

func (a *DaemonAPI) GetClusterConfig(ctx echo.Context, params api.GetClusterConfigParams) error

func (*DaemonAPI) GetClusterConfigFile

func (a *DaemonAPI) GetClusterConfigFile(ctx echo.Context, params api.GetClusterConfigFileParams) error

func (*DaemonAPI) GetClusterConfigKeywords

func (a *DaemonAPI) GetClusterConfigKeywords(ctx echo.Context, params api.GetClusterConfigKeywordsParams) error

func (*DaemonAPI) GetClusterStatus

func (a *DaemonAPI) GetClusterStatus(ctx echo.Context, params api.GetClusterStatusParams) error

GetDaemonStatus returns daemon data status

Serve 2s cached data.

func (*DaemonAPI) GetDaemonDNSDump

func (a *DaemonAPI) GetDaemonDNSDump(ctx echo.Context, nodename string) error

GetDaemonDNSDump returns the DNS zone content.

func (*DaemonAPI) GetDaemonEvents

func (a *DaemonAPI) GetDaemonEvents(ctx echo.Context, nodename string, params api.GetDaemonEventsParams) error

GetDaemonEvents feeds node daemon event publications in rss format.

func (*DaemonAPI) GetDaemonExec

func (a *DaemonAPI) GetDaemonExec(ctx echo.Context, nodename string, execID uuid.UUID, params api.GetDaemonExecParams) error

func (*DaemonAPI) GetDaemonExecs

func (a *DaemonAPI) GetDaemonExecs(ctx echo.Context, nodename string, params api.GetDaemonExecsParams) error

func (*DaemonAPI) GetDaemonLogControl

func (a *DaemonAPI) GetDaemonLogControl(ctx echo.Context, nodename api.InPathNodeName) error

GetDaemonLogControl reports the level the daemon logs are emitted at.

func (*DaemonAPI) GetDaemonOrchestration

func (a *DaemonAPI) GetDaemonOrchestration(ctx echo.Context, nodename string, orchestrationID string, params api.GetDaemonOrchestrationParams) error

func (*DaemonAPI) GetDaemonOrchestrations

func (a *DaemonAPI) GetDaemonOrchestrations(ctx echo.Context, nodename string, params api.GetDaemonOrchestrationsParams) error

func (*DaemonAPI) GetInstance

func (a *DaemonAPI) GetInstance(ctx echo.Context, nodename string, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) GetInstanceConfigFile

func (a *DaemonAPI) GetInstanceConfigFile(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) GetInstanceContainerLog

func (a *DaemonAPI) GetInstanceContainerLog(ctx echo.Context, nodename string, namespace string, kind naming.Kind, name string, params api.GetInstanceContainerLogParams) error

GetNodeInstanceContainerLog serves container logs

func (*DaemonAPI) GetInstanceLogs

func (a *DaemonAPI) GetInstanceLogs(ctx echo.Context, nodename string, namespace string, kind naming.Kind, name string, params api.GetInstanceLogsParams) error

func (*DaemonAPI) GetInstanceResourceFile

func (a *DaemonAPI) GetInstanceResourceFile(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.GetInstanceResourceFileParams) error

func (*DaemonAPI) GetInstanceResourceInfo

func (a *DaemonAPI) GetInstanceResourceInfo(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) GetInstanceSchedule

func (a *DaemonAPI) GetInstanceSchedule(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) GetInstances

func (a *DaemonAPI) GetInstances(ctx echo.Context, params api.GetInstancesParams) error

func (*DaemonAPI) GetNetworkIP

func (a *DaemonAPI) GetNetworkIP(ctx echo.Context, params api.GetNetworkIPParams) error

GetNetworkIP returns network status list.

func (*DaemonAPI) GetNetworks

func (a *DaemonAPI) GetNetworks(ctx echo.Context, params api.GetNetworksParams) error

GetNetworks returns network status list.

func (*DaemonAPI) GetNodeCapabilities

func (a *DaemonAPI) GetNodeCapabilities(ctx echo.Context, nodename string) error

func (*DaemonAPI) GetNodeConfig

func (a *DaemonAPI) GetNodeConfig(ctx echo.Context, nodename string, params api.GetNodeConfigParams) error

func (*DaemonAPI) GetNodeConfigFile

func (a *DaemonAPI) GetNodeConfigFile(ctx echo.Context, nodename string, params api.GetNodeConfigFileParams) error

func (*DaemonAPI) GetNodeConfigKeywords

func (a *DaemonAPI) GetNodeConfigKeywords(ctx echo.Context, nodename string, params api.GetNodeConfigKeywordsParams) error

func (*DaemonAPI) GetNodeDRBDAllocation

func (a *DaemonAPI) GetNodeDRBDAllocation(ctx echo.Context, nodename string) error

func (*DaemonAPI) GetNodeDRBDConfig

func (a *DaemonAPI) GetNodeDRBDConfig(ctx echo.Context, nodename string, params api.GetNodeDRBDConfigParams) error

func (*DaemonAPI) GetNodeDriver

func (a *DaemonAPI) GetNodeDriver(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeLogs

func (a *DaemonAPI) GetNodeLogs(ctx echo.Context, nodename string, params api.GetNodeLogsParams) error

GetNodeLogs feeds publications in rss format.

func (*DaemonAPI) GetNodeMetrics

func (a *DaemonAPI) GetNodeMetrics(ctx echo.Context, nodename api.InPathNodeName) error

GetNodeMetrics proxies to the node's /metrics endpoint and filters the metrics based on the requester's RBAC grants.

Access rules: - Guest role on the namespace or all namespaces or better is sufficient to access object metrics. - Root role is necessary to access daemon metrics.

func (*DaemonAPI) GetNodePing

func (a *DaemonAPI) GetNodePing(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeSSHHostkeys

func (a *DaemonAPI) GetNodeSSHHostkeys(ctx echo.Context, nodename string) error

func (*DaemonAPI) GetNodeSSHKey

func (a *DaemonAPI) GetNodeSSHKey(ctx echo.Context, nodename string) error

func (*DaemonAPI) GetNodeSchedule

func (a *DaemonAPI) GetNodeSchedule(ctx echo.Context, nodename string) error

func (*DaemonAPI) GetNodeSystemDisk

func (a *DaemonAPI) GetNodeSystemDisk(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeSystemGroup

func (a *DaemonAPI) GetNodeSystemGroup(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeSystemHardware

func (a *DaemonAPI) GetNodeSystemHardware(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeSystemIPAddress

func (a *DaemonAPI) GetNodeSystemIPAddress(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeSystemPackage

func (a *DaemonAPI) GetNodeSystemPackage(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeSystemProperty

func (a *DaemonAPI) GetNodeSystemProperty(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeSystemSANInitiator

func (a *DaemonAPI) GetNodeSystemSANInitiator(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeSystemSANPath

func (a *DaemonAPI) GetNodeSystemSANPath(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodeSystemUser

func (a *DaemonAPI) GetNodeSystemUser(ctx echo.Context, nodename api.InPathNodeName) error

func (*DaemonAPI) GetNodes

func (a *DaemonAPI) GetNodes(ctx echo.Context, params api.GetNodesParams) error

func (*DaemonAPI) GetNodesInfo

func (a *DaemonAPI) GetNodesInfo(ctx echo.Context) error

func (*DaemonAPI) GetObject

func (a *DaemonAPI) GetObject(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) GetObjectConfig

func (a *DaemonAPI) GetObjectConfig(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.GetObjectConfigParams) error

func (*DaemonAPI) GetObjectConfigFile

func (a *DaemonAPI) GetObjectConfigFile(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.GetObjectConfigFileParams) error

func (*DaemonAPI) GetObjectConfigKeywords

func (a *DaemonAPI) GetObjectConfigKeywords(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.GetObjectConfigKeywordsParams) error

func (*DaemonAPI) GetObjectData

func (a *DaemonAPI) GetObjectData(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.GetObjectDataParams) error

func (*DaemonAPI) GetObjectDataKey

func (a *DaemonAPI) GetObjectDataKey(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.GetObjectDataKeyParams) error

func (*DaemonAPI) GetObjectDataKeys

func (a *DaemonAPI) GetObjectDataKeys(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.GetObjectDataKeysParams) error

func (*DaemonAPI) GetObjectPaths

func (a *DaemonAPI) GetObjectPaths(ctx echo.Context, params api.GetObjectPathsParams) error

func (*DaemonAPI) GetObjectResourceInfo

func (a *DaemonAPI) GetObjectResourceInfo(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) GetObjectSchedule

func (a *DaemonAPI) GetObjectSchedule(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) GetObjects

func (a *DaemonAPI) GetObjects(ctx echo.Context, params api.GetObjectsParams) error

func (*DaemonAPI) GetPoolVolumes

func (a *DaemonAPI) GetPoolVolumes(ctx echo.Context, params api.GetPoolVolumesParams) error

func (*DaemonAPI) GetPools

func (a *DaemonAPI) GetPools(ctx echo.Context, params api.GetPoolsParams) error

func (*DaemonAPI) GetRelayMessage

func (a *DaemonAPI) GetRelayMessage(ctx echo.Context, params api.GetRelayMessageParams) error

func (*DaemonAPI) GetRelayStatus

func (a *DaemonAPI) GetRelayStatus(ctx echo.Context, params api.GetRelayStatusParams) error

func (*DaemonAPI) GetResources

func (a *DaemonAPI) GetResources(ctx echo.Context, params api.GetResourcesParams) error

func (*DaemonAPI) GetSwagger

func (a *DaemonAPI) GetSwagger(ctx echo.Context) error

func (*DaemonAPI) PatchClusterConfig

func (a *DaemonAPI) PatchClusterConfig(ctx echo.Context, params api.PatchClusterConfigParams) error

func (*DaemonAPI) PatchNodeConfig

func (a *DaemonAPI) PatchNodeConfig(ctx echo.Context, nodename string, params api.PatchNodeConfigParams) error

func (*DaemonAPI) PatchObjectConfig

func (a *DaemonAPI) PatchObjectConfig(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.PatchObjectConfigParams) error

func (*DaemonAPI) PatchObjectData

func (a *DaemonAPI) PatchObjectData(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostAuthRefresh

func (a *DaemonAPI) PostAuthRefresh(ctx echo.Context, params api.PostAuthRefreshParams) error

PostAuthRefresh create a new token for the refresh token user

func (*DaemonAPI) PostAuthToken

func (a *DaemonAPI) PostAuthToken(ctx echo.Context, params api.PostAuthTokenParams) error

PostAuthToken create a new token for a user

When role parameter exists a new user is created with grants from role and extra claims may be added to token

func (*DaemonAPI) PostClusterAction

func (a *DaemonAPI) PostClusterAction(eCtx echo.Context, globalExpect node.MonitorGlobalExpect) error

func (*DaemonAPI) PostClusterActionAbort

func (a *DaemonAPI) PostClusterActionAbort(ctx echo.Context) error

func (*DaemonAPI) PostClusterActionFreeze

func (a *DaemonAPI) PostClusterActionFreeze(ctx echo.Context) error

func (*DaemonAPI) PostClusterActionUnfreeze

func (a *DaemonAPI) PostClusterActionUnfreeze(ctx echo.Context) error

func (*DaemonAPI) PostClusterEnroll

func (a *DaemonAPI) PostClusterEnroll(ctx echo.Context) error

PostClusterEnroll orders a foreign node to leave its cluster and join ours.

The candidate node is only reachable with the credentials the requester provides: an access token with the join role, created on that node. Its ca claim is the trust anchor for its listener certificate, and only a token carrying that role holds the claim.

The candidate node must be a single node cluster. Enrolling a node that still has peers is refused: nothing in the join flow tells them to drop it from their cluster.nodes, so they would keep it forever.

func (*DaemonAPI) PostClusterEvict

func (a *DaemonAPI) PostClusterEvict(ctx echo.Context) error

PostClusterEvict removes a node from our cluster nodes.

The node to evict is ordered to leave: it is the one that asks a peer to drop it from the cluster nodes, then restarts alone. This handler is the entry point an operator uses from any other node of the cluster.

The node to evict must be drained. Nothing in the leave flow stops what it still runs, so evicting a node with live instances would leave them running on a node the cluster no longer knows about, free to start a second time elsewhere.

func (*DaemonAPI) PostClusterHeartbeatRotate

func (a *DaemonAPI) PostClusterHeartbeatRotate(ctx echo.Context) error

func (*DaemonAPI) PostClusterJoin

func (a *DaemonAPI) PostClusterJoin(ctx echo.Context, params api.PostClusterJoinParams) error

PostClusterJoin publishes msgbus.JoinRequest{Node: node} with label node=<apinode>. It requires non empty params.Node

func (*DaemonAPI) PostClusterLeave

func (a *DaemonAPI) PostClusterLeave(ctx echo.Context, params api.PostClusterLeaveParams) error

PostClusterLeave publishes msgbus.LeaveRequest{Node: node} with label node=<apinode>. It requires non empty params.Node

func (*DaemonAPI) PostClusterRegister

func (a *DaemonAPI) PostClusterRegister(ctx echo.Context) error

PostClusterRegister registers every cluster node on the collector, by forking a 'om cluster register' in the background.

The command posts to the register endpoint of every cluster node, so each node registers itself: the collector mints a registration id for a nodename, and a node cannot register on behalf of another.

The processing is asynchronous, as the registration of a node covers the initial asset, package and disk push it sends, and the command does that for every node in turn.

func (*DaemonAPI) PostComputeClaim

func (a *DaemonAPI) PostComputeClaim(ctx echo.Context) error

PostComputeClaim answers whether a namespace may have an object claim what it asks of the cpu and memory, and counts the answer until the configuration saying so is seen.

It is answered on the node speaking for the cluster, for the reason a pool claim is: what a namespace holds is read from the configurations the cluster shares, which a write reaches a moment after it is made, and claims answered from that reading alone all fit where together they do not.

What each object claims is read from the instance configurations this node holds of every node, so answering asks no peer anything.

func (*DaemonAPI) PostDaemonAudit

func (a *DaemonAPI) PostDaemonAudit(ctx echo.Context, nodename string, params api.PostDaemonAuditParams) error

func (*DaemonAPI) PostDaemonHeartbeatRestart

func (a *DaemonAPI) PostDaemonHeartbeatRestart(ctx echo.Context, nodename api.InPathNodeName, name api.InPathHeartbeatName) error

func (*DaemonAPI) PostDaemonHeartbeatSign

func (a *DaemonAPI) PostDaemonHeartbeatSign(ctx echo.Context, nodename api.InPathNodeName, name api.InPathHeartbeatName) error

func (*DaemonAPI) PostDaemonHeartbeatStart

func (a *DaemonAPI) PostDaemonHeartbeatStart(ctx echo.Context, nodename api.InPathNodeName, name api.InPathHeartbeatName) error

func (*DaemonAPI) PostDaemonHeartbeatStop

func (a *DaemonAPI) PostDaemonHeartbeatStop(ctx echo.Context, nodename api.InPathNodeName, name api.InPathHeartbeatName) error

func (*DaemonAPI) PostDaemonHeartbeatWipe

func (a *DaemonAPI) PostDaemonHeartbeatWipe(ctx echo.Context, nodename api.InPathNodeName, name api.InPathHeartbeatName, params api.PostDaemonHeartbeatWipeParams) error

func (*DaemonAPI) PostDaemonJoin

func (a *DaemonAPI) PostDaemonJoin(ctx echo.Context, nodename api.InPathNodeName) error

PostDaemonJoin orders the daemon to join the cluster of the node given in the body, and forks the join in the background.

The requester is granted the join role, like the one adding a node to our own cluster nodes: both are cluster membership operations, and the token carrying that role is the only one holding the ca claim a foreign cluster needs to reach us.

The join stops this daemon, moves its configuration aside and restarts it with the target cluster configuration, so it can not run in this handler: the response would never be written.

func (*DaemonAPI) PostDaemonLeave

func (a *DaemonAPI) PostDaemonLeave(ctx echo.Context, nodename api.InPathNodeName) error

PostDaemonLeave orders the daemon to leave its cluster, and forks the leave in the background.

The requester is granted the leave role, like the one dropping a node from our own cluster nodes: both are cluster membership operations.

The leave stops this daemon, moves its configuration aside and restarts it alone, so it cannot run in this handler: the response would never be written.

func (*DaemonAPI) PostDaemonListenerRestart

func (a *DaemonAPI) PostDaemonListenerRestart(ctx echo.Context, nodename api.InPathNodeName, name api.InPathListenerName) error

func (*DaemonAPI) PostDaemonListenerStart

func (a *DaemonAPI) PostDaemonListenerStart(ctx echo.Context, nodename api.InPathNodeName, name api.InPathListenerName) error

func (*DaemonAPI) PostDaemonListenerStop

func (a *DaemonAPI) PostDaemonListenerStop(ctx echo.Context, nodename api.InPathNodeName, name api.InPathListenerName) error

func (*DaemonAPI) PostDaemonLogControl

func (a *DaemonAPI) PostDaemonLogControl(ctx echo.Context, nodename string) error

func (*DaemonAPI) PostDaemonRestart

func (a *DaemonAPI) PostDaemonRestart(ctx echo.Context, nodename string) error

func (*DaemonAPI) PostDaemonShutdown

func (a *DaemonAPI) PostDaemonShutdown(ctx echo.Context, nodename string, params api.PostDaemonShutdownParams) error

func (*DaemonAPI) PostDaemonStop

func (a *DaemonAPI) PostDaemonStop(ctx echo.Context, nodename string) error

func (*DaemonAPI) PostInstanceActionBoot

func (a *DaemonAPI) PostInstanceActionBoot(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionBootParams) error

func (*DaemonAPI) PostInstanceActionDelete

func (a *DaemonAPI) PostInstanceActionDelete(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionDeleteParams) error

func (*DaemonAPI) PostInstanceActionFreeze

func (a *DaemonAPI) PostInstanceActionFreeze(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionFreezeParams) error

func (*DaemonAPI) PostInstanceActionFull

func (a *DaemonAPI) PostInstanceActionFull(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionFullParams) error

func (*DaemonAPI) PostInstanceActionInfo

func (a *DaemonAPI) PostInstanceActionInfo(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionInfoParams) error

func (*DaemonAPI) PostInstanceActionIngest

func (a *DaemonAPI) PostInstanceActionIngest(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionIngestParams) error

func (*DaemonAPI) PostInstanceActionInstall

func (a *DaemonAPI) PostInstanceActionInstall(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionInstallParams) error

func (*DaemonAPI) PostInstanceActionPGReset

func (a *DaemonAPI) PostInstanceActionPGReset(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionPGResetParams) error

func (*DaemonAPI) PostInstanceActionPGUpdate

func (a *DaemonAPI) PostInstanceActionPGUpdate(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionPGUpdateParams) error

func (*DaemonAPI) PostInstanceActionPRStart

func (a *DaemonAPI) PostInstanceActionPRStart(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionPRStartParams) error

func (*DaemonAPI) PostInstanceActionPRStop

func (a *DaemonAPI) PostInstanceActionPRStop(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionPRStopParams) error

func (*DaemonAPI) PostInstanceActionProvision

func (a *DaemonAPI) PostInstanceActionProvision(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionProvisionParams) error

func (*DaemonAPI) PostInstanceActionRestart

func (a *DaemonAPI) PostInstanceActionRestart(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionRestartParams) error

func (*DaemonAPI) PostInstanceActionResync

func (a *DaemonAPI) PostInstanceActionResync(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionResyncParams) error

func (*DaemonAPI) PostInstanceActionRun

func (a *DaemonAPI) PostInstanceActionRun(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionRunParams) error

func (*DaemonAPI) PostInstanceActionShutdown

func (a *DaemonAPI) PostInstanceActionShutdown(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionShutdownParams) error

func (*DaemonAPI) PostInstanceActionSplit

func (a *DaemonAPI) PostInstanceActionSplit(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionSplitParams) error

func (*DaemonAPI) PostInstanceActionStart

func (a *DaemonAPI) PostInstanceActionStart(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionStartParams) error

func (*DaemonAPI) PostInstanceActionStartStandby

func (a *DaemonAPI) PostInstanceActionStartStandby(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionStartStandbyParams) error

func (*DaemonAPI) PostInstanceActionStatus

func (a *DaemonAPI) PostInstanceActionStatus(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionStatusParams) error

func (*DaemonAPI) PostInstanceActionStop

func (a *DaemonAPI) PostInstanceActionStop(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionStopParams) error

func (*DaemonAPI) PostInstanceActionUnfreeze

func (a *DaemonAPI) PostInstanceActionUnfreeze(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionUnfreezeParams) error

func (*DaemonAPI) PostInstanceActionUnprovision

func (a *DaemonAPI) PostInstanceActionUnprovision(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionUnprovisionParams) error

func (*DaemonAPI) PostInstanceActionUpdate

func (a *DaemonAPI) PostInstanceActionUpdate(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceActionUpdateParams) error

func (*DaemonAPI) PostInstanceClear

func (a *DaemonAPI) PostInstanceClear(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostInstanceCollectorAction

func (a *DaemonAPI) PostInstanceCollectorAction(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string) error

PostInstanceCollectorAction is called by the local action process after it wrote the begin or the end of an instance action to report to the collector. It publishes the InstanceActionPending the collector speaker subscribes to.

The request names the pending file, it does not carry it: the file is read here, so the announce is the same as the one the collector goroutine repeats until the speaker acknowledges it.

func (*DaemonAPI) PostInstanceProgress

func (a *DaemonAPI) PostInstanceProgress(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostInstanceResourceConsole

func (a *DaemonAPI) PostInstanceResourceConsole(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string, params api.PostInstanceResourceConsoleParams) error

PostInstanceResourceConsole issues the ticket a console session of the resource is opened with.

The api decides who may open a console, and the session is not served through it: the ticket is presented to the console listener, which hands the session to a process of its own.

func (*DaemonAPI) PostInstanceResourceInfo

func (a *DaemonAPI) PostInstanceResourceInfo(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string) error

PostInstanceResourceInfo is called by the local `om <path> resource info -r` after it refreshed the resource info cache. It publishes the InstanceResourceInfoUpdated signal the collector speaker subscribes to.

The request has no body: the refreshed cache is read here to checksum it, so the signal stays small and the key-values are only fetched by the speaker, with GetInstanceResourceInfo, when it reports them.

func (*DaemonAPI) PostInstanceStateFile

func (a *DaemonAPI) PostInstanceStateFile(ctx echo.Context, nodename, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostInstanceStatus

func (a *DaemonAPI) PostInstanceStatus(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostNetworkClaim

func (a *DaemonAPI) PostNetworkClaim(ctx echo.Context) error

PostNetworkClaim answers whether a namespace may take one more address of a network, and counts the answer until the cluster reports the address.

Every claim of the cluster is answered here, on the node speaking for it, for the reason a pool claim is: what a namespace holds is read from what the objects publish, an object publishes its address after it has taken it, and claims answered from that reading alone all fit where together they do not.

func (*DaemonAPI) PostNodeActionClear

func (a *DaemonAPI) PostNodeActionClear(ctx echo.Context, nodename string) error

func (*DaemonAPI) PostNodeActionPushAsset

func (a *DaemonAPI) PostNodeActionPushAsset(ctx echo.Context, nodename string, params api.PostNodeActionPushAssetParams) error

func (*DaemonAPI) PostNodeActionPushDisk

func (a *DaemonAPI) PostNodeActionPushDisk(ctx echo.Context, nodename string, params api.PostNodeActionPushDiskParams) error

func (*DaemonAPI) PostNodeActionPushPkg

func (a *DaemonAPI) PostNodeActionPushPkg(ctx echo.Context, nodename string, params api.PostNodeActionPushPkgParams) error

func (*DaemonAPI) PostNodeActionRegister

func (a *DaemonAPI) PostNodeActionRegister(ctx echo.Context, nodename api.InPathNodeName, params api.PostNodeActionRegisterParams) error

PostNodeActionRegister registers the node named in the path on the collector.

The collector mints a registration id for a nodename, so a node cannot register on behalf of another: the credentials travel to the node, which registers itself, and a request for a peer is proxied to it.

func (*DaemonAPI) PostNodeActionSCSIScan

func (a *DaemonAPI) PostNodeActionSCSIScan(ctx echo.Context, nodename string, params api.PostNodeActionSCSIScanParams) error

func (*DaemonAPI) PostNodeActionScanCapabilities

func (a *DaemonAPI) PostNodeActionScanCapabilities(ctx echo.Context, nodename string, params api.PostNodeActionScanCapabilitiesParams) error

func (*DaemonAPI) PostNodeActionSysreport

func (a *DaemonAPI) PostNodeActionSysreport(ctx echo.Context, nodename string, params api.PostNodeActionSysreportParams) error

func (*DaemonAPI) PostNodeDRBDConfig

func (a *DaemonAPI) PostNodeDRBDConfig(ctx echo.Context, nodename string, params api.PostNodeDRBDConfigParams) error

func (*DaemonAPI) PostNodeDRBDConnect

func (a *DaemonAPI) PostNodeDRBDConnect(ctx echo.Context, nodename api.InPathNodeName, params api.PostNodeDRBDConnectParams) error

func (*DaemonAPI) PostNodeDRBDPrimary

func (a *DaemonAPI) PostNodeDRBDPrimary(ctx echo.Context, nodename api.InPathNodeName, params api.PostNodeDRBDPrimaryParams) error

func (*DaemonAPI) PostNodeDRBDSecondary

func (a *DaemonAPI) PostNodeDRBDSecondary(ctx echo.Context, nodename api.InPathNodeName, params api.PostNodeDRBDSecondaryParams) error

func (*DaemonAPI) PostObjectActionAbort

func (a *DaemonAPI) PostObjectActionAbort(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionCap

func (a *DaemonAPI) PostObjectActionCap(eCtx echo.Context, namespace string, kind naming.Kind, name string, params api.PostObjectActionCapParams) error

PostObjectActionCap sets the process group caps of an object and applies them to its running instances.

The caps are written as the pg_* keywords of the configuration, through the checks of a configuration update, so the rbac policy, the validation and the claim checks weigh them, and the caps hold through a start, a failover and a reboot. The orchestration is queued between the checks and the write, so a cap the orchestration refuses is not written. It applies the configuration written on every node running an instance, and names it, so a node holding an older one waits for it rather than applying the caps it replaces.

A request naming no cap applies the ones the configuration holds, which is how caps lifted or changed by hand are put back.

func (*DaemonAPI) PostObjectActionDelete

func (a *DaemonAPI) PostObjectActionDelete(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionFreeze

func (a *DaemonAPI) PostObjectActionFreeze(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionGiveback

func (a *DaemonAPI) PostObjectActionGiveback(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionProvision

func (a *DaemonAPI) PostObjectActionProvision(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionPurge

func (a *DaemonAPI) PostObjectActionPurge(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionResize

func (a *DaemonAPI) PostObjectActionResize(eCtx echo.Context, namespace string, kind naming.Kind, name string, params api.PostObjectActionResizeParams) error

PostObjectActionResize grows an object on every node holding an instance.

The size asked for is written to the object configuration, which is the size every node converges to, and only then is the orchestration queued. Both happen here rather than in the client: the configuration is on the cluster nodes, and writing it is what takes the namespace's claim on the pool, which is the cluster's to ration.

A request naming no size asks for the size already configured, which is how a resize that stopped part way is finished. It writes nothing, so it takes no more of the pool than the configuration already promised, and it names the configuration it read all the same: what it asks for is a size that configuration holds, and a node holding an older one has a different answer to give.

func (*DaemonAPI) PostObjectActionRestart

func (a *DaemonAPI) PostObjectActionRestart(eCtx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionStart

func (a *DaemonAPI) PostObjectActionStart(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionStop

func (a *DaemonAPI) PostObjectActionStop(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.PostObjectActionStopParams) error

func (*DaemonAPI) PostObjectActionSwitch

func (a *DaemonAPI) PostObjectActionSwitch(eCtx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionUnfreeze

func (a *DaemonAPI) PostObjectActionUnfreeze(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectActionUnprovision

func (a *DaemonAPI) PostObjectActionUnprovision(ctx echo.Context, namespace string, kind naming.Kind, name string) error

func (*DaemonAPI) PostObjectConfigFile

func (a *DaemonAPI) PostObjectConfigFile(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.PostObjectConfigFileParams) error

func (*DaemonAPI) PostObjectDataKey

func (a *DaemonAPI) PostObjectDataKey(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.PostObjectDataKeyParams) error

func (*DaemonAPI) PostPeerActionAbort

func (a *DaemonAPI) PostPeerActionAbort(ctx echo.Context, nodename string) error

func (*DaemonAPI) PostPeerActionDequeue

func (a *DaemonAPI) PostPeerActionDequeue(ctx echo.Context, nodename string, params api.PostPeerActionDequeueParams) error

func (*DaemonAPI) PostPeerActionDrain

func (a *DaemonAPI) PostPeerActionDrain(ctx echo.Context, nodename string) error

func (*DaemonAPI) PostPeerActionFreeze

func (a *DaemonAPI) PostPeerActionFreeze(ctx echo.Context, nodename string, params api.PostPeerActionFreezeParams) error

func (*DaemonAPI) PostPeerActionUnfreeze

func (a *DaemonAPI) PostPeerActionUnfreeze(ctx echo.Context, nodename string, params api.PostPeerActionUnfreezeParams) error

func (*DaemonAPI) PostPoolClaim

func (a *DaemonAPI) PostPoolClaim(ctx echo.Context) error

PostPoolClaim answers whether a namespace may have an object hold a size of a pool, and counts the answer until the configuration saying so is seen.

Every claim of the cluster is answered here, on one node, so that two of them asked at once are weighed against each other: what a namespace holds is read from the configurations the cluster shares, which a write reaches a moment after it is made, and claims answered from that reading alone all fit where together they do not.

The node answering is the one speaking for the cluster, the first alive node of the cluster nodes, which every node agrees on and which already speaks for the cluster elsewhere. A node that is not it hands the question over. When the cluster has no speaker, which is a node that has not yet found its peers, the question is answered here: a claim nobody can broker is one the node weighs alone, as it did before there was a broker.

func (*DaemonAPI) PostRelayMessage

func (a *DaemonAPI) PostRelayMessage(ctx echo.Context) error

func (*DaemonAPI) PostSvcDisable

func (a *DaemonAPI) PostSvcDisable(ctx echo.Context, namespace string, name string, params api.PostSvcDisableParams) error

func (*DaemonAPI) PostSvcEnable

func (a *DaemonAPI) PostSvcEnable(ctx echo.Context, namespace string, name string, params api.PostSvcEnableParams) error

func (*DaemonAPI) PutClusterConfigFile

func (a *DaemonAPI) PutClusterConfigFile(ctx echo.Context) error

func (*DaemonAPI) PutNodeConfigFile

func (a *DaemonAPI) PutNodeConfigFile(ctx echo.Context, nodename string) error

func (*DaemonAPI) PutNodeSSHTrust

func (a *DaemonAPI) PutNodeSSHTrust(ctx echo.Context, nodename string) error

func (*DaemonAPI) PutObjectConfigFile

func (a *DaemonAPI) PutObjectConfigFile(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.PutObjectConfigFileParams) error

func (*DaemonAPI) PutObjectDataKey

func (a *DaemonAPI) PutObjectDataKey(ctx echo.Context, namespace string, kind naming.Kind, name string, params api.PutObjectDataKeyParams) error

type DataFilter

type DataFilter struct {
	Key   string
	Value string
	Op    string
}

DataFilter represents a filtering data condition based on a key, value, and an operator.

type DataFilters

type DataFilters []DataFilter

DataFilters is a slice of DataFilter used to define a collection of filtering data conditions.

type Filter

type Filter struct {
	Kind   any
	Labels []pubsub.Label

	// DataFilters is a slice of DataFilter used to define filtering data conditions
	// based on key, value, and operator.
	DataFilters DataFilters
}

func (Filter) IsZero

func (f Filter) IsZero() bool

type JWTCreater

type JWTCreater interface {
	CreateToken(duration time.Duration, xClaims map[string]interface{}) (tk string, expiredAt time.Time, err error)
}

type Meta

type Meta struct {
	Context echo.Context
	Path    *string
	Node    *string
	// contains filtered or unexported fields
}

func (*Meta) Expand

func (m *Meta) Expand() error

func (*Meta) Grants

func (m *Meta) Grants() rbac.Grants

func (*Meta) HasNode

func (m *Meta) HasNode(s string) bool

func (*Meta) HasPath

func (m *Meta) HasPath(s string) bool

func (*Meta) Nodes

func (m *Meta) Nodes() []string

func (*Meta) Paths

func (m *Meta) Paths() naming.Paths

Source Files

Jump to

Keyboard shortcuts

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