Documentation
¶
Overview ¶
Package commoncmd provides utilities and shared functionality to facilitate operations related to managing remotes objects, nodes, and logs for omcmd and oxcmd.
Index ¶
- Constants
- Variables
- func APIKeywordItemsToRaw(items api.KeywordItems) rawconfig.T
- func AddFlagsGlobal(flags *pflag.FlagSet, p *OptsGlobal)
- func AddFlagsGlobalWithColorOutput(flags *pflag.FlagSet, color, output *string)
- func AddFlagsGlobalWithSelector(flags *pflag.FlagSet, objectSelector *string, ignoreNotFound *bool)
- func AddFlagsNodeGlobal(flagSet *pflag.FlagSet, p *OptsNodeGlobal)
- func AnySingleNode(selector string, c *client.T) (string, error)
- func CheckPRKeyUniqueness() error
- func CmdOrchestrated(cmd *cobra.Command)
- func CmdWithArg(cmd *cobra.Command, arg string)
- func CmdWithPlainConsoleLog(cmd *cobra.Command)
- func CollectorCredential(filename string) (user, password string, err error)
- func CollectorTagCreate(name string, data, exclude *string) error
- func CollectorTagList(opts OptsGlobal) error
- func ColorizeINI(b []byte) []byte
- func CommandNames(cmd *cobra.Command) []string
- func ComplianceModulesetTreeFromAPI(r api.ComplianceModulesetTree) *compliance.ModulesetTree
- func ComplianceRulesetsFromAPI(r api.ComplianceRulesets) compliance.Rulesets
- func ComplianceRunFromAPI(r api.ComplianceRun) *compliance.Run
- func ConfigAlertErrors(items api.ConfigAlertItems) error
- func ConfigWaitClient(wait bool, duration time.Duration) (*client.T, context.Context, context.CancelFunc, error)
- func CreateClientTimeout(wait time.Duration) time.Duration
- func CreateObjectConfig(ctx context.Context, c *client.T, p naming.Path, b []byte, keywords []string, ...) error
- func CreateObjectConfigFromStore(ctx context.Context, c *client.T, p naming.Path, store, snapshot string, ...) error
- func CreatedConfigData(p naming.Path, b []byte, keywords []string, restore bool) (object.Configurer, error)
- func DataFromConfigFile(fpath string) ([]byte, error)
- func DataFromConfigHttp(u uri.T) ([]byte, error)
- func DataFromStdin() ([]byte, error)
- func DataFromTemplate(template string) ([]byte, error)
- func DeprecatedFlagDownTo(flags *pflag.FlagSet, p *string)
- func DeprecatedFlagSubsets(flags *pflag.FlagSet, p *string)
- func DeprecatedFlagTags(flags *pflag.FlagSet, p *string)
- func DeprecatedFlagUpTo(flags *pflag.FlagSet, p *string)
- func Doc(w io.Writer, items api.KeywordDefinitionItems, kind naming.Kind, ...) error
- func DryRunPatchObjectConfig(ctx context.Context, c *client.T, p naming.Path, ...) (*api.ConfigAlertList, error)
- func FlagAdopt(flags *pflag.FlagSet, p *bool)
- func FlagCPUProfile(flags *pflag.FlagSet, p *string)
- func FlagCollectorApp(flags *pflag.FlagSet, p *string)
- func FlagCollectorCredential(flags *pflag.FlagSet, p *string)
- func FlagCollectorPassword(flags *pflag.FlagSet, p *string)
- func FlagCollectorUser(flags *pflag.FlagSet, p *string)
- func FlagColor(flags *pflag.FlagSet, p *string)
- func FlagComplianceAttach(flags *pflag.FlagSet, p *bool)
- func FlagComplianceForce(flags *pflag.FlagSet, p *bool)
- func FlagConfigDryRun(flags *pflag.FlagSet, p *bool)
- func FlagConfigForce(flags *pflag.FlagSet, p *bool)
- func FlagConfigWait(flags *pflag.FlagSet, p *bool)
- func FlagConfirm(flags *pflag.FlagSet, p *bool)
- func FlagCreateConfig(flags *pflag.FlagSet, p *string)
- func FlagCreateEnv(flags *pflag.FlagSet, p *[]string)
- func FlagCreateForce(flags *pflag.FlagSet, p *bool)
- func FlagCreateNamespace(flags *pflag.FlagSet, p *string)
- func FlagCreateRestore(flags *pflag.FlagSet, p *bool)
- func FlagCredential(flags *pflag.FlagSet, p *string)
- func FlagCron(flags *pflag.FlagSet, p *bool)
- func FlagDaemonExecFilters(flags *pflag.FlagSet, options *CmdDaemonExecList)
- func FlagDaemonHeartbeatFilter(flags *pflag.FlagSet, p *string)
- func FlagDaemonLogLevel(flags *pflag.FlagSet, p *string)
- func FlagDepth(flags *pflag.FlagSet, p *int)
- func FlagDevRoles(flags *pflag.FlagSet, p *string)
- func FlagDisableRollback(flags *pflag.FlagSet, p *bool)
- func FlagDiscard(flags *pflag.FlagSet, p *bool)
- func FlagDraftConfig(flags *pflag.FlagSet, p *string)
- func FlagDriver(flags *pflag.FlagSet, p *string)
- func FlagDryRun(flags *pflag.FlagSet, p *bool)
- func FlagDuration(flags *pflag.FlagSet, p *time.Duration)
- func FlagEnv(flags *pflag.FlagSet, p *[]string)
- func FlagEval(flags *pflag.FlagSet, p *bool)
- func FlagEventFilters(flags *pflag.FlagSet, p *[]string)
- func FlagEventLimit(flags *pflag.FlagSet, p *uint64)
- func FlagEventOutput(flags *pflag.FlagSet, p *string)
- func FlagEventReplay(flags *pflag.FlagSet, p *bool)
- func FlagEventTemplate(flags *pflag.FlagSet, p *string)
- func FlagEventWait(flags *pflag.FlagSet, p *bool)
- func FlagFollow(flags *pflag.FlagSet, p *bool)
- func FlagForce(flags *pflag.FlagSet, p *bool)
- func FlagForceAffinity(flags *pflag.FlagSet, p *bool)
- func FlagForceAway(flags *pflag.FlagSet, p *bool)
- func FlagFrom(flags *pflag.FlagSet, p *string)
- func FlagIgnoreNoCollectorConfigured(flags *pflag.FlagSet, p *bool)
- func FlagIgnoreNotFound(flags *pflag.FlagSet, p *bool)
- func FlagImpersonate(flags *pflag.FlagSet, p *string)
- func FlagInterruptSyncs(flags *pflag.FlagSet, p *bool)
- func FlagKeepBackup(flags *pflag.FlagSet, p *bool)
- func FlagKey(flags *pflag.FlagSet, p *string)
- func FlagKeyName(flags *pflag.FlagSet, p *string)
- func FlagKeyNames(flags *pflag.FlagSet, p *[]string)
- func FlagKeyTo(flags *pflag.FlagSet, p *string)
- func FlagKeyValue(flags *pflag.FlagSet, p *string)
- func FlagKeys(flags *pflag.FlagSet, p *[]string)
- func FlagKeyword(flags *pflag.FlagSet, p *string)
- func FlagKeywordOps(flags *pflag.FlagSet, p *[]string)
- func FlagKeywordSelection(flags *pflag.FlagSet, p *[]string)
- func FlagKeywords(flags *pflag.FlagSet, p *[]string)
- func FlagLeader(flags *pflag.FlagSet, p *bool)
- func FlagLive(flags *pflag.FlagSet, p *bool)
- func FlagLocal(flags *pflag.FlagSet, p *bool)
- func FlagMaster(flags *pflag.FlagSet, p *bool)
- func FlagMatch(flags *pflag.FlagSet, p *string)
- func FlagModule(flags *pflag.FlagSet, p *string)
- func FlagModuleset(flags *pflag.FlagSet, p *string)
- func FlagMoveTo(flags *pflag.FlagSet, p *string)
- func FlagNetworkName(flags *pflag.FlagSet, p *[]string)
- func FlagNetworkStatusExtended(flags *pflag.FlagSet, p *bool)
- func FlagNetworkStatusName(flags *pflag.FlagSet, p *string)
- func FlagNoLock(flags *pflag.FlagSet, p *bool)
- func FlagNodeSelector(flags *pflag.FlagSet, p *string)
- func FlagNodeSelectorFilter(flags *pflag.FlagSet, p *string)
- func FlagNodeSelectorOrAll(flags *pflag.FlagSet, p *string)
- func FlagNodeSelectorOrLocalnode(flags *pflag.FlagSet, p *string)
- func FlagNodeSelectorWithDefault(flags *pflag.FlagSet, p *string, def string)
- func FlagObjectSelector(flags *pflag.FlagSet, p *string)
- func FlagOutput(flags *pflag.FlagSet, p *string)
- func FlagOutputSections(flags *pflag.FlagSet, p *string)
- func FlagPeerSelectorFilter(flags *pflag.FlagSet, p *string)
- func FlagPoolName(flags *pflag.FlagSet, p *string)
- func FlagPoolPhysical(flags *pflag.FlagSet, p *bool)
- func FlagPoolStatusExtended(flags *pflag.FlagSet, p *bool)
- func FlagPreflight(flags *pflag.FlagSet, p *bool)
- func FlagProvision(flags *pflag.FlagSet, p *bool)
- func FlagRID(flags *pflag.FlagSet, p *string)
- func FlagRIDWithCompletion(cmd *cobra.Command, p *string)
- func FlagRecover(flags *pflag.FlagSet, p *bool)
- func FlagRedactSecrets(flags *pflag.FlagSet, p *bool)
- func FlagRefresh(flags *pflag.FlagSet, p *bool)
- func FlagRefreshResInfo(flags *pflag.FlagSet, p *bool)
- func FlagRelay(flags *pflag.FlagSet, p *string)
- func FlagRelaySince(flags *pflag.FlagSet, p *string)
- func FlagRoles(flags *pflag.FlagSet, p *[]string)
- func FlagRuleset(flags *pflag.FlagSet, p *string)
- func FlagSCSIHBA(flags *pflag.FlagSet, p *string)
- func FlagSCSILUN(flags *pflag.FlagSet, p *string)
- func FlagSCSITarget(flags *pflag.FlagSet, p *string)
- func FlagSections(flags *pflag.FlagSet, p *[]string)
- func FlagSlave(flags *pflag.FlagSet, p *[]string)
- func FlagSlaves(flags *pflag.FlagSet, p *bool)
- func FlagSort(flags *pflag.FlagSet, p *string)
- func FlagStateOnly(flags *pflag.FlagSet, p *bool)
- func FlagSubset(flags *pflag.FlagSet, p *string)
- func FlagSwitchTo(flags *pflag.FlagSet, p *string)
- func FlagSyncTo(flags *pflag.FlagSet, p *[]string)
- func FlagTag(flags *pflag.FlagSet, p *string)
- func FlagTarget(flags *pflag.FlagSet, p *[]string)
- func FlagTime(flags *pflag.FlagSet, p *time.Duration)
- func FlagTo(flags *pflag.FlagSet, p *string)
- func FlagToken(flags *pflag.FlagSet, p *string)
- func FlagUpdateDelete(flags *pflag.FlagSet, p *[]string)
- func FlagUpdateSet(flags *pflag.FlagSet, p *[]string)
- func FlagUpdateUnset(flags *pflag.FlagSet, p *[]string)
- func FlagWait(flags *pflag.FlagSet, p *bool)
- func FlagWatch(flags *pflag.FlagSet, p *bool)
- func FlagsAsync(flags *pflag.FlagSet, p *OptsAsync)
- func FlagsCreateFromStore(flags *pflag.FlagSet, store, snapshot *string)
- func FlagsEncap(flags *pflag.FlagSet, p *OptsEncap)
- func FlagsLock(flags *pflag.FlagSet, p *OptsLock)
- func FlagsLogs(flags *pflag.FlagSet, p *OptsLogs)
- func FlagsResourceSelector(cmd *cobra.Command, p *OptsResourceSelector)
- func FlagsRestore(flags *pflag.FlagSet, p *OptsRestore)
- func FlagsRunMarks(flags *pflag.FlagSet, protect *bool, note *string)
- func FlagsTo(flags *pflag.FlagSet, p *OptTo)
- func ForProgram(s string) string
- func GroupCommands(cmd *cobra.Command, groupID string) []*cobra.Command
- func HasConfigAlertErrorsOf(items api.ConfigAlertItems, kind string) bool
- func HasGroup(cmd *cobra.Command, groupID string) bool
- func HeartbeatNames() []string
- func HeartbeatStreamNames() []string
- func HiddenFlagDisableRollback(flags *pflag.FlagSet, p *bool)
- func HiddenFlagForce(flags *pflag.FlagSet, p *bool)
- func HiddenFlagLeader(flags *pflag.FlagSet, p *bool)
- func HiddenFlagMaster(flags *pflag.FlagSet, p *bool)
- func HiddenFlagNoLock(flags *pflag.FlagSet, p *bool)
- func HiddenFlagNodeSelector(flags *pflag.FlagSet, p *string)
- func HiddenFlagObjectSelector(flags *pflag.FlagSet, p *string)
- func HiddenFlagRID(flags *pflag.FlagSet, p *string)
- func HiddenFlagRIDWithCompletion(cmd *cobra.Command, p *string)
- func HiddenFlagSlave(flags *pflag.FlagSet, p *[]string)
- func HiddenFlagSlaves(flags *pflag.FlagSet, p *bool)
- func HiddenFlagSubset(flags *pflag.FlagSet, p *string)
- func HiddenFlagTag(flags *pflag.FlagSet, p *string)
- func HiddenFlagTo(flags *pflag.FlagSet, p *string)
- func HiddenFlagsEncap(flags *pflag.FlagSet, p *OptsEncap)
- func HiddenFlagsLock(flags *pflag.FlagSet, p *OptsLock)
- func HiddenFlagsResourceSelectorWithCompletion(cmd *cobra.Command, p *OptsResourceSelector)
- func HiddenFlagsTo(flags *pflag.FlagSet, p *OptTo)
- func InstanceDeviceList(objectSelector, nodeSelector, roles string, opts OptsGlobal) error
- func InstanceSchedules(c *client.T, objectSelector, nodeSelector string) (api.ScheduleList, error)
- func InstanceStatusUpdatedWaiter(ctx context.Context, paths naming.Paths) (func(), error)
- func IsStillRunning(err error) bool
- func IsTabularOutput(out string) bool
- func KeysWarningsOf(p naming.Path, body io.Reader) error
- func KeywordStoreFromAPI(items api.KeywordDefinitionItems) (store keywords.Store)
- func ListingData(out string, answer any, views func() any) any
- func LocalStoreSnapshots(items []api.StoreSnapshot)
- func LocalSyncSnapshots(items api.SyncSnapshotItems)
- func MakeDataPatch(name string, value, from *string, action api.PatchDataKeyAction) (api.PatchDataKeys, error)
- func MergeSelector(selector string, subsysSelector string, kind string, defaultSelector string) string
- func NetworkSetup(ctx context.Context, c *client.T, nodenames, names []string, format string) error
- func NewCmdAny() *cobra.Command
- func NewCmdAnyConfigUpdate() *cobra.Command
- func NewCmdArrayList() *cobra.Command
- func NewCmdCcfg() *cobra.Command
- func NewCmdCfg() *cobra.Command
- func NewCmdClusterAbort() *cobra.Command
- func NewCmdClusterEnroll() *cobra.Command
- func NewCmdClusterEvict() *cobra.Command
- func NewCmdClusterFreeze() *cobra.Command
- func NewCmdClusterLock() *cobra.Command
- func NewCmdClusterLockList() *cobra.Command
- func NewCmdClusterLockRelease() *cobra.Command
- func NewCmdClusterLogs() *cobra.Command
- func NewCmdClusterRegister() *cobra.Command
- func NewCmdClusterSSHTrust() *cobra.Command
- func NewCmdClusterStatus() *cobra.Command
- func NewCmdClusterThaw() *cobra.Command
- func NewCmdClusterTombstone() *cobra.Command
- func NewCmdClusterTombstoneList() *cobra.Command
- func NewCmdClusterUnfreeze() *cobra.Command
- func NewCmdClusterUpdate() *cobra.Command
- func NewCmdClusterUpdatePkg() *cobra.Command
- func NewCmdDaemon() *cobra.Command
- func NewCmdDaemonAudit() *cobra.Command
- func NewCmdDaemonAuth() *cobra.Command
- func NewCmdDaemonDNS() *cobra.Command
- func NewCmdDaemonDNSDump() *cobra.Command
- func NewCmdDaemonEvents() *cobra.Command
- func NewCmdDaemonEventsDoc() *cobra.Command
- func NewCmdDaemonExec() *cobra.Command
- func NewCmdDaemonExecList(defaultNodeSelector string) *cobra.Command
- func NewCmdDaemonExecLogs() *cobra.Command
- func NewCmdDaemonExecWait(defaultNodeSelector string) *cobra.Command
- func NewCmdDaemonHeartbeat() *cobra.Command
- func NewCmdDaemonHeartbeatList(defaultNodeSelectorFilter string) *cobra.Command
- func NewCmdDaemonHeartbeatRestart() *cobra.Command
- func NewCmdDaemonHeartbeatRotate() *cobra.Command
- func NewCmdDaemonHeartbeatStart() *cobra.Command
- func NewCmdDaemonHeartbeatStatus(defaultNodeSelectorFilter string) *cobra.Command
- func NewCmdDaemonHeartbeatStop() *cobra.Command
- func NewCmdDaemonKill() *cobra.Command
- func NewCmdDaemonListener() *cobra.Command
- func NewCmdDaemonListenerRestart() *cobra.Command
- func NewCmdDaemonListenerStart() *cobra.Command
- func NewCmdDaemonListenerStop() *cobra.Command
- func NewCmdDaemonLog() *cobra.Command
- func NewCmdDaemonOrchestration() *cobra.Command
- func NewCmdDaemonOrchestrationLogs() *cobra.Command
- func NewCmdDaemonPs() *cobra.Command
- func NewCmdDaemonRelay() *cobra.Command
- func NewCmdDaemonRelayList() *cobra.Command
- func NewCmdDaemonRelayStatus() *cobra.Command
- func NewCmdDaemonRestart() *cobra.Command
- func NewCmdDaemonRun() *cobra.Command
- func NewCmdDaemonRunning() *cobra.Command
- func NewCmdDaemonSession() *cobra.Command
- func NewCmdDaemonSessionList() *cobra.Command
- func NewCmdDaemonSessionLogs() *cobra.Command
- func NewCmdDaemonSessionWait() *cobra.Command
- func NewCmdDaemonShutdown() *cobra.Command
- func NewCmdDaemonStart() *cobra.Command
- func NewCmdDaemonStatus() *cobra.Command
- func NewCmdDaemonStop() *cobra.Command
- func NewCmdHeartbeatSign() *cobra.Command
- func NewCmdHeartbeatWipe() *cobra.Command
- func NewCmdMonitor() *cobra.Command
- func NewCmdNetwork() *cobra.Command
- func NewCmdNetworkIP() *cobra.Command
- func NewCmdNetworkNode() *cobra.Command
- func NewCmdNetworkNodeList() *cobra.Command
- func NewCmdNetworkPeer() *cobra.Command
- func NewCmdNetworkPeerList() *cobra.Command
- func NewCmdNode() *cobra.Command
- func NewCmdNodeCapabilities() *cobra.Command
- func NewCmdNodeCollector() *cobra.Command
- func NewCmdNodeCollectorTag() *cobra.Command
- func NewCmdNodeCompliance() *cobra.Command
- func NewCmdNodeConfigDoc() *cobra.Command
- func NewCmdNodeMetrics() *cobra.Command
- func NewCmdNodeRelay() *cobra.Command
- func NewCmdNodeSCSI() *cobra.Command
- func NewCmdNodeSSH() *cobra.Command
- func NewCmdNscfg() *cobra.Command
- func NewCmdObjectApp(kind string) *cobra.Command
- func NewCmdObjectCap(kind string) *cobra.Command
- func NewCmdObjectClear(kind string) *cobra.Command
- func NewCmdObjectCollector(kind string) *cobra.Command
- func NewCmdObjectCompliance(kind string) *cobra.Command
- func NewCmdObjectConfig(kind string) *cobra.Command
- func NewCmdObjectConfigDoc(kind string) *cobra.Command
- func NewCmdObjectContainer(kind string) *cobra.Command
- func NewCmdObjectDisk(kind string) *cobra.Command
- func NewCmdObjectFS(kind string) *cobra.Command
- func NewCmdObjectGroupInfo(kind, group string) *cobra.Command
- func NewCmdObjectGroupList(kind, group string) *cobra.Command
- func NewCmdObjectGroupProvision(kind, group string) *cobra.Command
- func NewCmdObjectGroupResize(kind, group string) *cobra.Command
- func NewCmdObjectGroupRestart(kind, group string) *cobra.Command
- func NewCmdObjectGroupRun(kind, group string) *cobra.Command
- func NewCmdObjectGroupShutdown(kind, group string) *cobra.Command
- func NewCmdObjectGroupStart(kind, group string) *cobra.Command
- func NewCmdObjectGroupStartStandby(kind, group string) *cobra.Command
- func NewCmdObjectGroupStop(kind, group string) *cobra.Command
- func NewCmdObjectGroupUnprovision(kind, group string) *cobra.Command
- func NewCmdObjectIP(kind string) *cobra.Command
- func NewCmdObjectInstance(kind string) *cobra.Command
- func NewCmdObjectInstanceClear(kind, defaultNodeSelector string) *cobra.Command
- func NewCmdObjectInstanceDevice(kind string) *cobra.Command
- func NewCmdObjectInstancePG(kind string) *cobra.Command
- func NewCmdObjectInstanceUnstop() *cobra.Command
- func NewCmdObjectKey(kind string) *cobra.Command
- func NewCmdObjectKeyAdd(kind string) *cobra.Command
- func NewCmdObjectKeyChange(kind string) *cobra.Command
- func NewCmdObjectKeyDecode(kind string) *cobra.Command
- func NewCmdObjectKeyEdit(kind string) *cobra.Command
- func NewCmdObjectKeyInstall(kind string) *cobra.Command
- func NewCmdObjectKeyList(kind string) *cobra.Command
- func NewCmdObjectKeyRemove(kind string) *cobra.Command
- func NewCmdObjectKeyRename(kind string) *cobra.Command
- func NewCmdObjectMonitor(selector, kind string) *cobra.Command
- func NewCmdObjectPrint(kind string) *cobra.Command
- func NewCmdObjectResource(kind string) *cobra.Command
- func NewCmdObjectSSH(kind string) *cobra.Command
- func NewCmdObjectSchedule(kind string) *cobra.Command
- func NewCmdObjectShare(kind string) *cobra.Command
- func NewCmdObjectSync(kind string) *cobra.Command
- func NewCmdObjectSyncRestore(kind string) *cobra.Command
- func NewCmdObjectSyncSnapshot() *cobra.Command
- func NewCmdObjectSyncSnapshotList() *cobra.Command
- func NewCmdObjectTask(kind string) *cobra.Command
- func NewCmdObjectVolume(kind string) *cobra.Command
- func NewCmdPool() *cobra.Command
- func NewCmdPoolVolume() *cobra.Command
- func NewCmdSVC() *cobra.Command
- func NewCmdSec() *cobra.Command
- func NewCmdStore() *cobra.Command
- func NewCmdStoreList() *cobra.Command
- func NewCmdStoreSnapshot() *cobra.Command
- func NewCmdStoreSnapshotList() *cobra.Command
- func NewCmdStoreSnapshotRm() *cobra.Command
- func NewCmdTemplate() *cobra.Command
- func NewCmdUsr() *cobra.Command
- func NewCmdVol() *cobra.Command
- func NewGroupObjectKinds() *cobra.Group
- func NewGroupOrchestrated() *cobra.Group
- func NewGroupQuery() *cobra.Group
- func NewGroupReplication() *cobra.Group
- func NewGroupResources() *cobra.Group
- func NewGroupSubsystems() *cobra.Group
- func NodeChecks(selector string, opts OptsGlobal) error
- func NodeCollectorTagAttachRemote(name string, attachData *string) func(context.Context, string) (any, error)
- func NodeCollectorTagDetachRemote(name string) func(context.Context, string) (any, error)
- func NodeCollectorTagShowRemote(verbose bool) func(context.Context, string) (any, error)
- func NodeComplianceEnvRemote(modulesets, modules string) func(context.Context, string) (any, error)
- func NodeComplianceModulesRemote() func(context.Context, string) (any, error)
- func NodeComplianceModulesetAttachmentRemote(moduleset string, attach bool) func(context.Context, string) (any, error)
- func NodeComplianceModulesetTreeRemote(modulesets string) func(context.Context, string) (any, error)
- func NodeComplianceModulesetsRemote(filter string) func(context.Context, string) (any, error)
- func NodeComplianceRulesRemote() func(context.Context, string) (any, error)
- func NodeComplianceRulesetAttachmentRemote(ruleset string, attach bool) func(context.Context, string) (any, error)
- func NodeComplianceRulesetsRemote(filter string) func(context.Context, string) (any, error)
- func NodeComplianceRunRemote(action compliance.Action, opts ComplianceRunOptions, runs *ComplianceRuns) func(context.Context, string) (any, error)
- func NodeConfigMigrateLong() string
- func NodeConfigValidate(selector string, opts OptsGlobal) error
- func NodeDoc(w io.Writer, items api.KeywordDefinitionItems, kind naming.Kind, ...) error
- func NodePRKeys(selector string, opts OptsGlobal) error
- func NodesFromPaths(c *client.T, selector string) ([]string, error)
- func ObjectComplianceEnvRemote(modulesets, modules string) func(context.Context, naming.Path, string) (any, error)
- func ObjectComplianceRulesRemote() func(context.Context, naming.Path, string) (any, error)
- func ObjectComplianceRunRemote(action compliance.Action, opts ComplianceRunOptions, runs *ComplianceRuns) func(context.Context, naming.Path, string) (any, error)
- func ObjectConfigMigrateLong(kind string) string
- func ObjectInstanceDeleteRemoteFunc(ctx context.Context, p naming.Path, nodename string) (interface{}, error)
- func ObjectKeyInstallRemote(name string) func(context.Context, naming.Path, string) (any, error)
- func ObjectResourceInfoList(objectSelector, nodeSelector, rid string, opts OptsGlobal) error
- func ObjectResourceInfoRefreshRemote(rid string) func(context.Context, naming.Path, string) (any, error)
- func ObjectsAPIDo(objectSelector string, opts OptsGlobal, fn ObjectAPIFunc) error
- func PatchObjectConfig(ctx context.Context, c *client.T, p naming.Path, ...) (bool, []string, error)
- func PatchObjectData(ctx context.Context, c *client.T, p naming.Path, data api.PatchDataKeys, ...) error
- func PostDaemonRestart(ctx context.Context, cli *client.T, nodename string) error
- func PostDaemonStop(ctx context.Context, cli *client.T, nodename string) error
- func PostInstanceActionUnstop(ctx context.Context, c *client.T, p naming.Path, nodename string, ...) (interface{}, error)
- func PrintConfigAlerts(items api.ConfigAlertItems, out, sort, color string) error
- func PrintKeysWarnings(p naming.Path, warnings *[]string)
- func PrintLocalKeysWarnings(p naming.Path, err error) error
- func RawStringSliceVar(flags *pflag.FlagSet, p *[]string, name string, value []string, usage string)
- func RawStringSliceVarP(flags *pflag.FlagSet, p *[]string, name, shorthand string, value []string, ...)
- func ReadKeysFrom(from string) (map[string][]byte, error)
- func ReadPasswordFromStdinOrPrompt(prompt string) ([]byte, error)
- func RefreshInstanceStatusFromClusterStatus(ctx context.Context, clusterStatus clusterdump.Data) error
- func RenderDuration(startedAt time.Time, endedAt *time.Time, now time.Time) string
- func RenderRelayList(data api.RelayStatusList, out, sort, color string) error
- func ResolveExecID(nodeSelector, s string) (string, error)
- func ResolveOrchestrationID(nodeSelector, s string) (string, error)
- func ResolveSessionID(nodeSelector, s string) (string, error)
- func RunObjectDataPatch(selector string, data api.PatchDataKeys, wait bool, duration time.Duration) error
- func SecretFromFileOrEnv(filename, envVar string) (string, error)
- func SectionBody(cmd *cobra.Command, title string) (string, bool)
- func Sections(b []byte, sections []string) []byte
- func SelectorFromStdin() string
- func SetCustomUsageTemplate(cmd *cobra.Command)
- func SetKeywordsFromArgs(keywords *[]string, args []string)
- func SetRIDFromArgs(rid *string, args []string, group, defaultRID string)
- func SetSectionsFromArgs(sections *[]string, args []string)
- func SetWait(cmd *cobra.Command, wait *time.Duration, unbounded *bool) error
- func UsageFlagEventFilter() string
- func UsageFlagEventTemplate() string
- func ValidateArgs(root *cobra.Command, args []string) error
- func ValidateDraftConfig(ctx context.Context, selector, src, out, sort, color string) error
- func WaitAllInstanceMonitor(ctx context.Context, c *client.T, p naming.Path, timeout time.Duration, ...) error
- func WaitInstanceMonitor(ctx context.Context, c *client.T, p naming.Path, timeout time.Duration, ...) error
- func WaitInstanceStatusUpdated(ctx context.Context, c *client.T, nodename string, p naming.Path, ...) error
- func WaitObjectKnown(ctx context.Context, c *client.T, p naming.Path, timeout time.Duration, ...) error
- func WalkCommands(cmd *cobra.Command, f func(*cobra.Command))
- type CmdClusterAbort
- type CmdClusterConfigDoc
- type CmdClusterEnroll
- type CmdClusterEvict
- type CmdClusterFreeze
- type CmdClusterLockList
- type CmdClusterLockRelease
- type CmdClusterLogs
- type CmdClusterRegister
- type CmdClusterSSHTrust
- type CmdClusterTombstoneList
- type CmdClusterUnfreeze
- type CmdClusterUpdatePkg
- type CmdDaemonAudit
- type CmdDaemonAuth
- type CmdDaemonDNSDump
- type CmdDaemonEvents
- type CmdDaemonEventsDoc
- type CmdDaemonExecList
- type CmdDaemonHeartbeatList
- type CmdDaemonHeartbeatRestart
- type CmdDaemonHeartbeatRotate
- type CmdDaemonHeartbeatSign
- type CmdDaemonHeartbeatStart
- type CmdDaemonHeartbeatStop
- type CmdDaemonHeartbeatWipe
- type CmdDaemonIDLogs
- type CmdDaemonKill
- type CmdDaemonListenerRestart
- type CmdDaemonListenerStart
- type CmdDaemonListenerStop
- type CmdDaemonLog
- type CmdDaemonRelayList
- type CmdDaemonSessionList
- type CmdDaemonSubAction
- type CmdNetworkNodeList
- type CmdNetworkPeerList
- type CmdNodeConfigDoc
- type CmdNodeConfigMigrate
- type CmdNodeDequeue
- type CmdNodeLogs
- type CmdNodeMetrics
- type CmdObjectCap
- type CmdObjectConfigDoc
- type CmdObjectConfigMigrate
- type CmdObjectInstanceClear
- type CmdObjectLogs
- type CmdObjectMonitor
- type CmdPoolList
- type ComplianceRunOptions
- type ComplianceRuns
- type DryRun
- type ExecView
- type InstanceDeviceLine
- type List
- type NodeCheckLine
- type ObjectAPIFunc
- func ObjectCollectorTagAttach(name string, attachData *string) ObjectAPIFunc
- func ObjectCollectorTagDetach(name string) ObjectAPIFunc
- func ObjectCollectorTagShow(verbose bool) ObjectAPIFunc
- func ObjectComplianceModules() ObjectAPIFunc
- func ObjectComplianceModulesetAttachment(moduleset string, attach bool) ObjectAPIFunc
- func ObjectComplianceModulesetTree(modulesets string) ObjectAPIFunc
- func ObjectComplianceModulesets(filter string) ObjectAPIFunc
- func ObjectComplianceRulesetAttachment(ruleset string, attach bool) ObjectAPIFunc
- func ObjectComplianceRulesets(filter string) ObjectAPIFunc
- type OptTo
- type OptsAsync
- type OptsEncap
- type OptsGlobal
- type OptsLock
- type OptsLogs
- type OptsNodeGlobal
- type OptsResourceSelector
- type OptsRestore
- type PoolLine
- type PoolVolumeLine
- type RelayView
- type SessionView
Constants ¶
const ArgAnnotationKey = "args"
ArgAnnotationKey is the key used for the args annotation on cobra commands
const CmdTemplateLong = `` /* 5214-byte string literal not displayed */
CmdTemplateLong documents ox template.
const ConfigAlertsOutput = "tab=LEVEL:level,PATH:path,NODE:node,DRIVER:driver,KEY:key,KIND:kind,COMMENT:comment"
ConfigAlertsOutput is how the alerts of the validation of an object configuration print by default.
const ConsoleLogAnnotationKey = "console_log"
ConsoleLogAnnotationKey is the key of the annotation of a cobra command naming the format it shows its logs on the console in, as logging.ConsoleFormatPlain.
const CreateKnownHold = 30 * time.Second
CreateKnownHold is how long the daemon holds the answer of a create asked with no wait for it to know the object, its objectKnownTimeout.
const DefaultWait = time.Hour
DefaultWait is how long one request is held when no duration is asked for. It is the longest the daemon holds one, and a wait with no duration asks again for as long as it takes, so the default is "until it ends".
const HeartbeatNameHelp = `` /* 295-byte string literal not displayed */
HeartbeatNameHelp is the NAME paragraph of the actions addressing a heartbeat as a whole, which all take the same argument.
const HeartbeatStreamNameHelp = `` /* 449-byte string literal not displayed */
HeartbeatStreamNameHelp is the NAME paragraph of the actions addressing one direction of a heartbeat, which is a component of its own.
const NetworkSetupClientTimeout = 2*time.Minute + 15*time.Second
NetworkSetupClientTimeout is the timeout of the client asking a network setup: the api answers once the setup ran, waiting up to 2 minutes for it (networkSetupTimeout of the daemon api), longer than the default client timeout. A client giving up first would say failed a setup still running.
const NodeDriversDefaultOutput = "tab=NODE:meta.node,NAME:data.name,AVAILABLE:data.available,GRANT:data.grant,FEATURES:data.features[*],DOC:data.doc"
NodeDriversDefaultOutput is the default rendering of the driver catalog of "om node drivers" and "ox node drivers".
const ScheduleListOutput = "" /* 179-byte string literal not displayed */
ScheduleListOutput is the listing of the schedules of instances.
const StatusRefreshTimeout = 30 * time.Second
StatusRefreshTimeout is how long a command refreshing the instance statuses cluster-wide waits for the nodes to publish them.
const SyncSnapshotsTab = "" /* 202-byte string literal not displayed */
SyncSnapshotsTab is the column spec of the sync snapshot listings.
Variables ¶
var ( ErrClientRequest = errors.New("client request") ErrClientStatusCode = errors.New("client request unexpected status code") ErrEventKindUnexpected = errors.New("unexpected event kind") ErrFetchFile = errors.New("fetch file") ErrFlagInvalid = errors.New("invalid command flag") ErrInstallFile = errors.New("install file") ErrPrint = errors.New("print") )
var ( GroupIDObjectKinds = "object kinds" GroupIDOrchestrated = "orchestrated" GroupIDQuery = "query" GroupIDSubsystems = "subsystems" GroupIDResourceGroups = "resource groups" GroupIDReplication = "replication" )
var AuditSubsystems = []string{ daemonenv.ListenerNameFamily, daemonenv.ListenerNameInet, daemonenv.ListenerNameUX, "ccfg", "collector", "cstat", "daemonauth", "daemondata", "discover", "dns", "drbdmon", "virtmon", "ctrmon", "mdmon", "hb", "hb.ctrl", "hb.main", "hb.peer_dropper", "hb:", "hook", "icfg", "icfg:", "imon", "imon:", "istat", "mntmon", "netmon", "nmon", "omon", "omon:", "pubsub", "runner", "scheduler", }
AuditSubsystems are the names a daemon audit selects its log feed with, as the subsystems register them.
The ones ending with a colon take a suffix: the object path for icfg, imon and omon, the heartbeat id for hb. A name is matched as a glob pattern, so "imon:*" audits every object monitor and "hb.*" every heartbeat component but the streams themselves.
var (
ErrCmdClusterEnroll = errors.New("command cluster enroll")
)
var (
ErrCmdClusterEvict = errors.New("command cluster evict")
)
var (
ErrCmdDaemonAuth = errors.New("command daemon auth")
)
var ErrStillRunning = errors.New("still running when the wait expired")
ErrStillRunning says a wait expired on work that has not ended. It is not a failure of the work, nor of the request, which is why a wait with no duration asks again rather than reporting it.
var ListenerNameHelp = `NAME is: ` + daemonenv.ListenerNameInet + ` the listener serving the tcp port ` + daemonenv.ListenerNameUX + `, the listener serving the unix socket, has no start, stop or restart of its own: it lives as long as the daemon does, and the request asking for it travels through it. Restart the daemon to restart it.`
ListenerNameHelp is the NAME paragraph of the listener lifecycle actions, naming the listeners they may be addressed to. There are only two listeners, and they are the same on every node, so they are named here rather than looked up.
The unix socket listener is named too, saying why it is not a value: a reader who knows it exists, from an audit or from a status, would take its absence for an oversight.
Functions ¶
func APIKeywordItemsToRaw ¶
func APIKeywordItemsToRaw(items api.KeywordItems) rawconfig.T
func AddFlagsGlobal ¶
func AddFlagsGlobal(flags *pflag.FlagSet, p *OptsGlobal)
AddFlagsGlobal adds the global flags to the flag set. This is the common implementation used by both om and ox.
func AddFlagsGlobalWithColorOutput ¶
AddFlagsGlobalWithColorOutput adds color and output flags
func AddFlagsGlobalWithSelector ¶
AddFlagsGlobalWithSelector adds object selector and ignore not found flags
func AddFlagsNodeGlobal ¶
func AddFlagsNodeGlobal(flagSet *pflag.FlagSet, p *OptsNodeGlobal)
func CheckPRKeyUniqueness ¶
func CheckPRKeyUniqueness() error
CheckPRKeyUniqueness reports the nodes of the cluster that announce the same scsi3 persistent reservation key.
The key identifies a node to the storage, and two nodes holding the same one can each preempt the reservations of the other, which is what a scsireserv resource relies on to keep a peer away from a device it was not given. A duplicate is nearly always a node.conf copied to a peer without redacting the prkey.
The explanation goes to stderr and the error makes the exit code non zero, so that the caller's stdout still holds the value it asked for. A key that could not be read from the daemon is not a duplicate: the caller is told the check did not run, and is not failed for it.
func CmdOrchestrated ¶
CmdOrchestrated marks a command as asking the daemon for an orchestration.
It sorts the command into the orchestrated section of the help, and refuses arguments. An orchestration is asked of the objects the selector names and of nothing else, so an argument is a mistake, and cobra would otherwise accept it and drop it: "om <sel> start foo" would start <sel> and say nothing about foo.
A command declaring what its arguments are keeps them, so that the few orchestrations taking one, like resize, say so themselves.
func CmdWithArg ¶
CmdWithArg appends argument documentation to the command's args annotation. It handles line feeds, padding and indentation to format the text properly. The argument description will be displayed in the "Arguments:" section of the help output.
func CmdWithPlainConsoleLog ¶
CmdWithPlainConsoleLog has the command show its logs on the console as the lines it prints, with no time, and no level below the warnings: for a command whose output tells a story its logs are lines of. --debug and --trace show them with their time and level all the same.
func CollectorCredential ¶
CollectorCredential returns the collector user and password held by the file at filename, or by the OSVC_COLLECTOR_CREDENTIAL environment variable when filename is empty, and two empty strings when neither is set: a node then registers with the id it already holds.
It is parsed where the command is typed rather than where the registration happens, so that a malformed credential is reported once, before any node is asked to register.
func CollectorTagCreate ¶
CollectorTagCreate creates a tag on the collector, as the node serving the request, and prints the answer of the collector.
func CollectorTagList ¶
func CollectorTagList(opts OptsGlobal) error
CollectorTagList lists the tags of the collector, as it answers them to the node serving the request.
func ColorizeINI ¶
func CommandNames ¶
CommandNames returns the name of cmd and its aliases, deduplicated: a command naming itself in its own alias list is one name, not two.
func ComplianceModulesetTreeFromAPI ¶
func ComplianceModulesetTreeFromAPI(r api.ComplianceModulesetTree) *compliance.ModulesetTree
ComplianceModulesetTreeFromAPI returns the tree the api answers as the tree of this node is.
func ComplianceRulesetsFromAPI ¶
func ComplianceRulesetsFromAPI(r api.ComplianceRulesets) compliance.Rulesets
ComplianceRulesetsFromAPI returns the rulesets the api answers as the rulesets of this node are.
func ComplianceRunFromAPI ¶
func ComplianceRunFromAPI(r api.ComplianceRun) *compliance.Run
ComplianceRunFromAPI returns the run the api answers as a run of this node is, so it renders the same.
func ConfigAlertErrors ¶
func ConfigAlertErrors(items api.ConfigAlertItems) error
ConfigAlertErrors returns an error when an alert is an error, so the validation exits non-zero for a configuration that is not good.
func ConfigWaitClient ¶
func ConfigWaitClient(wait bool, duration time.Duration) (*client.T, context.Context, context.CancelFunc, error)
ConfigWaitClient returns the client a configuration update is made with, and the context bounding it.
A wait holds the answer for as long as the wait, which is longer than a client allows an answer by default, so the client allows it and the context bounds it, with a margin for the answer to travel.
func CreateClientTimeout ¶
CreateClientTimeout is the timeout of the client posting a create asked with wait, zero for none, for the answer of the daemon to reach it.
func CreateObjectConfig ¶
func CreateObjectConfig(ctx context.Context, c *client.T, p naming.Path, b []byte, keywords []string, restore, force bool, wait time.Duration, dryRun *DryRun) error
CreateObjectConfig creates the object at p from the configuration b, through the api, which checks it as any configuration it writes, and answers once the daemon knows the object, so the command run next finds it.
The daemon leaves behind what a configuration copied from another object recorded of itself, unless restore, and applies the keyword operations after, so a keyword they name is kept. With force, an object that exists already has its configuration replaced, with the same treatment.
A restore replaces an object that exists too, as the create does with no daemon running: what a backup or a hypervisor restores is the object as it was saved, whatever the node holds of it.
With dryRun, the daemon runs every check of the create and writes nothing, and the alerts it answers with are printed: the problems the create would be refused for, and the warnings of the validation.
With wait, the daemon holds the answer that long at most for every node of the object to have the configuration, and for itself to know the object, which lasts as long as the first status of its instance: without, it holds it CreateKnownHold at most for itself to know the object.
func CreateObjectConfigFromStore ¶
func CreateObjectConfigFromStore(ctx context.Context, c *client.T, p naming.Path, store, snapshot string, keywords []string, restore, force bool, wait time.Duration, dryRun *DryRun) error
CreateObjectConfigFromStore creates the object at p from the snapshot of the store, through the api: the daemon reads the configuration of the object the snapshot is of, creates the keys of the sec and cfg it references that the namespace of p lacks, and names the snapshot the provision restores the heads from.
func CreatedConfigData ¶
func CreatedConfigData(p naming.Path, b []byte, keywords []string, restore bool) (object.Configurer, error)
CreatedConfigData returns the configurer reading the configuration b of an object created at p, as the api writes it, to tell what its validation finds before it is sent.
func DataFromConfigFile ¶
func DataFromStdin ¶
func DataFromTemplate ¶
func DeprecatedFlagDownTo ¶
func DeprecatedFlagSubsets ¶
func DeprecatedFlagTags ¶
func DeprecatedFlagUpTo ¶
func Doc ¶
func Doc(w io.Writer, items api.KeywordDefinitionItems, kind naming.Kind, driver, kw string, depth int) error
Doc renders the documentation of the keywords of an object configuration.
The keywords carry what the rbac policy says about them, because an object configuration is what a user without the root grant sends to the api, and the policy decides which of its keywords the api accepts.
func DryRunPatchObjectConfig ¶
func DryRunPatchObjectConfig(ctx context.Context, c *client.T, p naming.Path, params api.PatchObjectConfigParams) (*api.ConfigAlertList, error)
DryRunPatchObjectConfig has the daemon run every check of the keyword operations of params on the configuration of p, and write nothing. It returns the alerts the checks found: the problems the update would be refused for, and the warnings of the validation.
func FlagAdopt ¶
FlagAdopt is the adoption by a provision of the system resources it finds holding what it would take.
func FlagCPUProfile ¶
func FlagCollectorApp ¶
func FlagCollectorCredential ¶
FlagCollectorCredential registers the only way a collector credential reaches a command, besides the OSVC_COLLECTOR_CREDENTIAL environment variable. It names a file rather than carrying the value, for the reason FlagCredential does.
func FlagCollectorPassword ¶
FlagCollectorPassword registers the deprecated --password option, hidden for the reason FlagCollectorUser is.
func FlagCollectorUser ¶
FlagCollectorUser registers the deprecated --user option, kept for the commands that were typed against the previous release. It is hidden: --credential is the documented way in, because it names a file instead of carrying the password on a command line.
func FlagComplianceAttach ¶
func FlagComplianceForce ¶
func FlagConfigDryRun ¶
FlagConfigDryRun adds the --dry-run of a configuration write: the daemon runs every check of the write and writes nothing.
func FlagConfigForce ¶
FlagConfigForce is the force of a configuration write a resource up on a node would leak by.
func FlagConfigWait ¶
FlagConfigWait is the --wait of a configuration update.
func FlagConfirm ¶
func FlagCreateConfig ¶
func FlagCreateEnv ¶
func FlagCreateForce ¶
func FlagCreateNamespace ¶
func FlagCreateRestore ¶
func FlagCredential ¶
FlagCredential registers the only way a credential reaches a command, besides the OSVC_CREDENTIAL environment variable. It names a file rather than carrying the value: a command line is readable by any user through the process table, and stays in the shell history.
func FlagDaemonExecFilters ¶
func FlagDaemonExecFilters(flags *pflag.FlagSet, options *CmdDaemonExecList)
FlagDaemonExecFilters declares the options that narrow a listing of execs, on the listing and on every preset of it, so the same question is asked the same way wherever it is asked.
func FlagDaemonLogLevel ¶
func FlagDevRoles ¶
func FlagDisableRollback ¶
func FlagDiscard ¶
func FlagDraftConfig ¶
FlagDraftConfig adds the --config of a validation: a draft configuration to validate, rather than the one the object holds.
func FlagDriver ¶
func FlagDryRun ¶
func FlagEventFilters ¶
func FlagEventLimit ¶
func FlagEventOutput ¶
func FlagEventReplay ¶
func FlagEventTemplate ¶
func FlagEventWait ¶
func FlagFollow ¶
FlagFollow is the follow flag of an action asked of daemons, which streams its logs: the logs of its session for an action asked of the daemons of nodes, of its orchestration for a target state.
func FlagForceAffinity ¶
FlagForceAffinity lifts the hard affinity checks of a start, and only those, where --force lifts every check a start makes.
func FlagForceAway ¶
FlagForceAway is the force of a purge, a delete or an unprovision to go on without the instance a node away holds up or provisioned, which it can not reach: that instance is kept stopped on the return of its node, to purge or keep there. With --local, it also allows the dangerous operations of the action.
func FlagIgnoreNotFound ¶
func FlagImpersonate ¶
func FlagInterruptSyncs ¶
func FlagKeepBackup ¶
FlagKeepBackup registers the option keeping the config backup a join or a leave makes, removed once the node has joined or left otherwise. The backup holds the secrets of the cluster the node was a member of.
func FlagKeyName ¶
func FlagKeyNames ¶
func FlagKeyValue ¶
func FlagKeyword ¶
func FlagKeywordOps ¶
func FlagKeywordSelection ¶
FlagKeywordSelection declares the --kw of the commands reading keywords, which take patterns: see configkeywords.IsPattern.
func FlagKeywords ¶
func FlagLeader ¶
func FlagMaster ¶
func FlagModule ¶
func FlagModuleset ¶
func FlagMoveTo ¶
func FlagNetworkName ¶
func FlagNetworkStatusName ¶
func FlagNoLock ¶
func FlagNodeSelector ¶
func FlagNodeSelectorFilter ¶
func FlagNodeSelectorOrAll ¶
func FlagNodeSelectorOrLocalnode ¶
FlagNodeSelectorOrLocalnode declares the node selector of a command whose subject is this node unless another is named.
The default is the name of the node rather than the word "localhost", which the selector has no meaning for: it would look for a node of that name and find none.
func FlagNodeSelectorWithDefault ¶
FlagNodeSelectorWithDefault declares the node selector of a command that om and ox default differently: om answers for the node it runs on, ox has no node of its own to prefer.
func FlagObjectSelector ¶
func FlagOutput ¶
func FlagOutputSections ¶
func FlagPeerSelectorFilter ¶
func FlagPoolName ¶
func FlagPoolPhysical ¶
func FlagPoolStatusExtended ¶
func FlagPreflight ¶
FlagPreflight is the check alone of what a provision would take.
func FlagProvision ¶
func FlagRIDWithCompletion ¶
FlagRIDWithCompletion adds the --rid flag to the given command and registers bash completion for it using the instance.Status resource map. Only provides completion if the selector is a valid path (not a filtering expression). Gets RIDs from status.json if present in the object's var directory (om only), otherwise falls back to the API.
func FlagRecover ¶
func FlagRedactSecrets ¶
func FlagRefresh ¶
func FlagRefreshResInfo ¶
func FlagRelaySince ¶
func FlagRuleset ¶
func FlagSCSIHBA ¶
func FlagSCSILUN ¶
func FlagSCSITarget ¶
func FlagSections ¶
func FlagSlaves ¶
func FlagSort ¶
FlagSort declares the option that orders a listing, overriding the order the command comes in by default.
A term names a column, by the header the table shows it under, or the field a tab expression would select. A term prefixed with "-" reverses that term, and a whole expression prefixed with "+" extends the command's default rather than replacing it. A leading "-" has to be written as --sort=-NAME, or the flag parser reads it as the next option.
func FlagStateOnly ¶
func FlagSubset ¶
func FlagSwitchTo ¶
func FlagSyncTo ¶
func FlagTarget ¶
func FlagToken ¶
FlagToken registers the only way a join token reaches a command, besides the OSVC_JOIN_TOKEN environment variable. It names a file rather than carrying the value, for the reason FlagCredential does.
func FlagUpdateDelete ¶
func FlagUpdateSet ¶
func FlagUpdateUnset ¶
func FlagsAsync ¶
func FlagsCreateFromStore ¶
FlagsCreateFromStore adds the options of a create from a snapshot.
func FlagsEncap ¶
func FlagsResourceSelector ¶
func FlagsResourceSelector(cmd *cobra.Command, p *OptsResourceSelector)
func FlagsRestore ¶
func FlagsRestore(flags *pflag.FlagSet, p *OptsRestore)
FlagsRestore adds the options of a sync restore.
func FlagsRunMarks ¶
FlagsRunMarks adds the options marking the run a sync update writes.
func ForProgram ¶
ForProgram renders a help text written for the om command under the name the binary was invoked as, so an ox help does not tell its reader to type om. The commands of the two binaries are built here, from one source, and the root command names itself the same way.
func GroupCommands ¶
GroupCommands returns the commands of cmd the usage template prints under the group.
func HasConfigAlertErrorsOf ¶
func HasConfigAlertErrorsOf(items api.ConfigAlertItems, kind string) bool
HasConfigAlertErrorsOf says whether an error alert is of kind.
func HeartbeatNames ¶
func HeartbeatNames() []string
HeartbeatNames returns the heartbeats the local cluster configuration defines, named as the actions take them: "1" for the "hb#1" section.
func HeartbeatStreamNames ¶
func HeartbeatStreamNames() []string
HeartbeatStreamNames returns the names a stream action may be addressed to: each heartbeat the local cluster configuration defines, which stands for both of its streams, and each of those streams.
func HiddenFlagForce ¶
func HiddenFlagLeader ¶
func HiddenFlagMaster ¶
func HiddenFlagNoLock ¶
func HiddenFlagNodeSelector ¶
func HiddenFlagRID ¶
func HiddenFlagRIDWithCompletion ¶
HiddenFlagRIDWithCompletion adds the hidden --rid flag to the given command and registers bash completion for it using the instance.Status resource map.
func HiddenFlagSlave ¶
func HiddenFlagSlaves ¶
func HiddenFlagSubset ¶
func HiddenFlagTag ¶
func HiddenFlagTo ¶
func HiddenFlagsEncap ¶
func HiddenFlagsLock ¶
func HiddenFlagsResourceSelectorWithCompletion ¶
func HiddenFlagsResourceSelectorWithCompletion(cmd *cobra.Command, p *OptsResourceSelector)
HiddenFlagsResourceSelectorWithCompletion adds hidden resource selector flags to the given command and registers bash completion for the --rid flag
func HiddenFlagsTo ¶
func InstanceDeviceList ¶
func InstanceDeviceList(objectSelector, nodeSelector, roles string, opts OptsGlobal) error
InstanceDeviceList lists the devices of the resources of the instances of the selected objects on the selected nodes, each asked of its node.
func InstanceSchedules ¶
InstanceSchedules returns the schedules of the instances of the selected objects on the selected nodes, each asked of its node.
func IsStillRunning ¶
IsStillRunning says an answer is nothing but waits that expired on work still running, which is the one answer worth asking again for. A node that failed to answer at all is not.
func IsTabularOutput ¶
func KeysWarningsOf ¶
KeysWarningsOf prints the warnings of the answer body of a key write, a Committed, and says whether it is one.
func KeywordStoreFromAPI ¶
func KeywordStoreFromAPI(items api.KeywordDefinitionItems) (store keywords.Store)
func ListingData ¶
IsTabularOutput says the output format out, the default one when empty, renders columns for a reader, rather than data for a program. A listing renders its views, computed for the reader, in a tabular format, and the api answer as it is in the others: a script reads the same document from the command and from the api. ListingData returns what a listing renders in the output format out: the views, computed for a reader, in a tabular format, and the api answer as it is in the others.
func LocalStoreSnapshots ¶
func LocalStoreSnapshots(items []api.StoreSnapshot)
LocalStoreSnapshots sets the times of the snapshots in the local zone of the requester, as LocalSyncSnapshots.
func LocalSyncSnapshots ¶
func LocalSyncSnapshots(items api.SyncSnapshotItems)
LocalSyncSnapshots sets the times of the snapshots in the local zone of the requester: the stores hold them in UTC, a node answering in its own, and a listing mixing the two is read wrong.
func MakeDataPatch ¶
func MakeDataPatch(name string, value, from *string, action api.PatchDataKeyAction) (api.PatchDataKeys, error)
MakeDataPatch returns the key operation of action on the key name, valued value, or one operation per file read from the from location, named after the file.
func MergeSelector ¶
func NetworkSetup ¶
NetworkSetup asks the node monitor of each node of nodenames to set up the networks names, all of them when names is empty, and waits for the setups to run, on every node at once. The node monitor runs one setup at a time, so a setup asked never writes the firewall rules of the networks along with another.
The setups log with the session id of this command, and their logs are streamed in format as they run, the setup running in the daemons.
func NewCmdAny ¶
NewCmdAny creates the "any" command, whose selector picks objects of any kind, where the command of a kind picks the objects of that kind only.
func NewCmdAnyConfigUpdate ¶
func NewCmdArrayList ¶
func NewCmdClusterAbort ¶
func NewCmdClusterEnroll ¶
func NewCmdClusterEvict ¶
func NewCmdClusterFreeze ¶
func NewCmdClusterLock ¶
NewCmdClusterLock returns the parent of the cluster lock commands.
func NewCmdClusterLockList ¶
NewCmdClusterLockList returns the command listing the cluster locks held.
func NewCmdClusterLockRelease ¶
NewCmdClusterLockRelease returns the command taking a cluster lock back from its holder.
func NewCmdClusterLogs ¶
func NewCmdClusterRegister ¶
func NewCmdClusterSSHTrust ¶
func NewCmdClusterStatus ¶
func NewCmdClusterThaw ¶
func NewCmdClusterTombstone ¶
NewCmdClusterTombstone returns the parent of the cluster tombstone commands.
func NewCmdClusterTombstoneList ¶
NewCmdClusterTombstoneList returns the command listing the tombstones.
func NewCmdClusterUnfreeze ¶
func NewCmdClusterUpdate ¶
NewCmdClusterUpdate is the parent of the cluster update commands. It is the orchestrated one, its commands sitting under it.
func NewCmdClusterUpdatePkg ¶
func NewCmdDaemon ¶
func NewCmdDaemonAudit ¶
func NewCmdDaemonAuth ¶
func NewCmdDaemonDNS ¶
func NewCmdDaemonDNSDump ¶
func NewCmdDaemonEvents ¶
func NewCmdDaemonEventsDoc ¶
NewCmdDaemonEventsDoc returns the "daemon events doc" command.
func NewCmdDaemonExec ¶
NewCmdDaemonExec returns the command group of the runs the daemon made, one per object per node, which is the scale the outcome is at.
func NewCmdDaemonExecList ¶
NewCmdDaemonExecList returns the listing of the exec store.
defaultNodeSelector is what --node defaults to: om answers for the node it runs on, ox has no node of its own to prefer.
func NewCmdDaemonExecLogs ¶
NewCmdDaemonExecLogs returns the logs of one exec.
func NewCmdDaemonExecWait ¶
NewCmdDaemonExecWait returns the command waiting for the end of an exec.
func NewCmdDaemonHeartbeat ¶
func NewCmdDaemonHeartbeatStatus ¶
NewCmdDaemonHeartbeatStatus is the name the list command answered to before the listings were named after what they render: a row per stream. It is kept for the readers whose fingers and scripts type it.
func NewCmdDaemonKill ¶
func NewCmdDaemonListener ¶
func NewCmdDaemonLog ¶
func NewCmdDaemonOrchestration ¶
NewCmdDaemonOrchestration returns the command group of the orchestrations the monitor accepted.
func NewCmdDaemonOrchestrationLogs ¶
NewCmdDaemonOrchestrationLogs returns the logs of one orchestration.
func NewCmdDaemonPs ¶
NewCmdDaemonPs returns the listing of what the daemon is running now.
It is CmdDaemonExecList with the running state preselected and the pid leading the table. What is running and what has run are the same records at different ages, so there is one implementation and this is a preset of it, rather than a second command that can drift from the first.
func NewCmdDaemonRelay ¶
func NewCmdDaemonRelayList ¶
func NewCmdDaemonRelayStatus ¶
NewCmdDaemonRelayStatus is the name the list command answered to before the listings were named after what they render: a row per relay client. It is kept for the readers whose fingers and scripts type it.
func NewCmdDaemonRestart ¶
func NewCmdDaemonRun ¶
func NewCmdDaemonRunning ¶
func NewCmdDaemonSession ¶
NewCmdDaemonSession returns the command group of the commands submitted to the daemon, which it remembers so a client that submitted one can ask how it ended.
func NewCmdDaemonSessionList ¶
NewCmdDaemonSessionList returns the listing of sessions.
It defaults to every node, where the exec listing defaults to this one: a session spans the nodes it reached, and folding only the local share of it would report a count that is not the session's.
func NewCmdDaemonSessionLogs ¶
NewCmdDaemonSessionLogs returns the logs of one session.
func NewCmdDaemonSessionWait ¶
NewCmdDaemonSessionWait returns the command waiting for the end of a session.
func NewCmdDaemonShutdown ¶
func NewCmdDaemonStart ¶
func NewCmdDaemonStatus ¶
func NewCmdDaemonStop ¶
func NewCmdHeartbeatSign ¶
func NewCmdHeartbeatWipe ¶
func NewCmdMonitor ¶
func NewCmdNetwork ¶
NewCmdNetwork creates the "network" command
func NewCmdNetworkIP ¶
NewCmdNetworkIP creates the "ip" subcommand for network
func NewCmdNetworkNode ¶
NewCmdNetworkNode returns the "node" subcommand of network.
func NewCmdNetworkNodeList ¶
NewCmdNetworkNodeList returns the "network node list" command.
func NewCmdNetworkPeer ¶
NewCmdNetworkPeer returns the "peer" subcommand of network.
func NewCmdNetworkPeerList ¶
NewCmdNetworkPeerList returns the "network peer list" command.
func NewCmdNode ¶
func NewCmdNodeCapabilities ¶
NewCmdNodeCapabilities creates the "capabilities" subcommand for node
func NewCmdNodeCollector ¶
NewCmdNodeCollector creates the "collector" subcommand for node
func NewCmdNodeCollectorTag ¶
NewCmdNodeCollectorTag creates the "tag" subcommand for node collector
func NewCmdNodeCompliance ¶
NewCmdNodeCompliance creates the "compliance" subcommand for node
func NewCmdNodeConfigDoc ¶
func NewCmdNodeMetrics ¶
func NewCmdNodeRelay ¶
NewCmdNodeRelay creates the "relay" subcommand for node
func NewCmdNodeSCSI ¶
NewCmdNodeSCSI creates the "scsi" subcommand for node
func NewCmdNodeSSH ¶
NewCmdNodeSSH creates the "ssh" subcommand for node
func NewCmdObjectApp ¶
func NewCmdObjectCap ¶
NewCmdObjectCap returns the cap command of a kind.
Its help lists the pg_* keywords of the store, with their example and the first sentence of their text, so it documents every cap the command sets, the ones added later included.
func NewCmdObjectClear ¶
func NewCmdObjectCollector ¶
func NewCmdObjectCompliance ¶
func NewCmdObjectConfig ¶
func NewCmdObjectConfigDoc ¶
func NewCmdObjectContainer ¶
func NewCmdObjectDisk ¶
func NewCmdObjectFS ¶
func NewCmdObjectGroupInfo ¶
func NewCmdObjectGroupList ¶
func NewCmdObjectGroupResize ¶
NewCmdObjectGroupResize returns the command that changes the size of a resource and of everything it rests on.
func NewCmdObjectGroupRun ¶
func NewCmdObjectGroupStart ¶
func NewCmdObjectGroupStop ¶
func NewCmdObjectIP ¶
func NewCmdObjectInstance ¶
func NewCmdObjectInstancePG ¶
func NewCmdObjectInstanceUnstop ¶
NewCmdObjectInstanceUnstop returns the instance unstop command, without its flags and run function, which om and ox set.
func NewCmdObjectKey ¶
func NewCmdObjectKeyAdd ¶
func NewCmdObjectKeyChange ¶
func NewCmdObjectKeyDecode ¶
func NewCmdObjectKeyEdit ¶
func NewCmdObjectKeyInstall ¶
func NewCmdObjectKeyList ¶
func NewCmdObjectKeyRemove ¶
func NewCmdObjectKeyRename ¶
func NewCmdObjectMonitor ¶
func NewCmdObjectPrint ¶
func NewCmdObjectResource ¶
func NewCmdObjectSSH ¶
func NewCmdObjectSchedule ¶
func NewCmdObjectShare ¶
func NewCmdObjectSync ¶
func NewCmdObjectSyncRestore ¶
NewCmdObjectSyncRestore returns the sync restore command, its run left to om and ox.
func NewCmdObjectSyncSnapshot ¶
NewCmdObjectSyncSnapshot returns the sync snapshot command group.
func NewCmdObjectSyncSnapshotList ¶
NewCmdObjectSyncSnapshotList returns the sync snapshot list command, its run left to om and ox.
func NewCmdObjectTask ¶
func NewCmdObjectVolume ¶
func NewCmdPoolVolume ¶
NewCmdPoolVolume creates the "volume" subcommand for pool
func NewCmdStore ¶
NewCmdStore returns the parent of the store commands.
func NewCmdStoreList ¶
NewCmdStoreList returns the store list command.
func NewCmdStoreSnapshot ¶
NewCmdStoreSnapshot returns the parent of the store snapshot commands.
func NewCmdStoreSnapshotList ¶
NewCmdStoreSnapshotList returns the store snapshot list command.
func NewCmdStoreSnapshotRm ¶
NewCmdStoreSnapshotRm returns the store snapshot rm command.
func NewCmdTemplate ¶
func NewGroupObjectKinds ¶
NewGroupObjectKinds returns the section listing the commands scoped to an object kind, at the root of the command tree.
func NewGroupOrchestrated ¶
func NewGroupQuery ¶
func NewGroupReplication ¶
func NewGroupResources ¶
func NewGroupSubsystems ¶
func NodeChecks ¶
func NodeChecks(selector string, opts OptsGlobal) error
NodeChecks runs the checks of the selected nodes, each on its node through the api, which pushes the results to the collector, and lists them: also when a push failed, which the command then says.
func NodeCollectorTagAttachRemote ¶
func NodeCollectorTagAttachRemote(name string, attachData *string) func(context.Context, string) (any, error)
NodeCollectorTagAttachRemote returns the remote function of "node collector tag attach": the answer of the collector.
func NodeCollectorTagDetachRemote ¶
NodeCollectorTagDetachRemote returns the remote function of "node collector tag detach": the answer of the collector.
func NodeCollectorTagShowRemote ¶
NodeCollectorTagShowRemote returns the remote function of "node collector tag show": the names of the tags attached to the node, or all their data with verbose.
func NodeComplianceEnvRemote ¶
NodeComplianceEnvRemote returns the remote function of "node compliance env".
func NodeComplianceModulesRemote ¶
NodeComplianceModulesRemote returns the remote function of "node compliance list module": the modules installed on the node.
func NodeComplianceModulesetAttachmentRemote ¶
func NodeComplianceModulesetAttachmentRemote(moduleset string, attach bool) func(context.Context, string) (any, error)
NodeComplianceModulesetAttachmentRemote returns the remote function of "node compliance attach moduleset", or of its detach.
func NodeComplianceModulesetTreeRemote ¶
func NodeComplianceModulesetTreeRemote(modulesets string) func(context.Context, string) (any, error)
NodeComplianceModulesetTreeRemote returns the remote function of "node compliance show moduleset".
func NodeComplianceModulesetsRemote ¶
NodeComplianceModulesetsRemote returns the remote function of "node compliance list moduleset".
func NodeComplianceRulesRemote ¶
NodeComplianceRulesRemote returns the remote function of "node compliance show ruleset".
func NodeComplianceRulesetAttachmentRemote ¶
func NodeComplianceRulesetAttachmentRemote(ruleset string, attach bool) func(context.Context, string) (any, error)
NodeComplianceRulesetAttachmentRemote returns the remote function of "node compliance attach ruleset", or of its detach.
func NodeComplianceRulesetsRemote ¶
NodeComplianceRulesetsRemote returns the remote function of "node compliance list ruleset".
func NodeComplianceRunRemote ¶
func NodeComplianceRunRemote(action compliance.Action, opts ComplianceRunOptions, runs *ComplianceRuns) func(context.Context, string) (any, error)
NodeComplianceRunRemote returns the remote function of a compliance run: the run of the node, rendered as a run of this node is, and added to runs.
func NodeConfigMigrateLong ¶
func NodeConfigMigrateLong() string
NodeConfigMigrateLong is the help of the node config migrate command, listing the rules it applies.
func NodeConfigValidate ¶
func NodeConfigValidate(selector string, opts OptsGlobal) error
NodeConfigValidate validates the configuration of the selected nodes, each on the node, through the api.
func NodeDoc ¶
func NodeDoc(w io.Writer, items api.KeywordDefinitionItems, kind naming.Kind, driver, kw string, depth int) error
NodeDoc renders the documentation of the keywords of the node configuration.
They carry no rbac line: the node configuration is not written through the api by a user holding a grant on a namespace, so the policy that gates the object configurations says nothing about them.
func NodePRKeys ¶
func NodePRKeys(selector string, opts OptsGlobal) error
NodePRKeys lists the scsi3 persistent reservation keys of the selected nodes, as their daemons announce them, and says whether each is its node's alone.
func ObjectComplianceEnvRemote ¶
func ObjectComplianceEnvRemote(modulesets, modules string) func(context.Context, naming.Path, string) (any, error)
ObjectComplianceEnvRemote returns the remote function of "<path> compliance env".
func ObjectComplianceRulesRemote ¶
ObjectComplianceRulesRemote returns the remote function of "<path> compliance show ruleset".
func ObjectComplianceRunRemote ¶
func ObjectComplianceRunRemote(action compliance.Action, opts ComplianceRunOptions, runs *ComplianceRuns) func(context.Context, naming.Path, string) (any, error)
ObjectComplianceRunRemote returns the remote function of a compliance run of an object: the run of its instance on the node, rendered as a run on this node is, and added to runs.
func ObjectConfigMigrateLong ¶
ObjectConfigMigrateLong is the help of the config migrate command of a kind of object, listing the rules it applies.
func ObjectKeyInstallRemote ¶
ObjectKeyInstallRemote returns the remote function of "<path> key install": the keys of the datastore, the key named or all of them, are installed again in the volumes of the node projecting them, by an exec the node starts.
func ObjectResourceInfoList ¶
func ObjectResourceInfoList(objectSelector, nodeSelector, rid string, opts OptsGlobal) error
ObjectResourceInfoList lists the key-values the resources of the selected objects report, of the rid selected if any: of the instances of the nodes selected, or of all their instances without a node selector.
func ObjectResourceInfoRefreshRemote ¶
func ObjectResourceInfoRefreshRemote(rid string) func(context.Context, naming.Path, string) (any, error)
ObjectResourceInfoRefreshRemote returns the remote function asking the node to recompute the resource info cache of its instance. Reporting the refreshed key-values to the collector is the collector speaker's job, driven by the InstanceResourceInfoUpdated signal.
func ObjectsAPIDo ¶
func ObjectsAPIDo(objectSelector string, opts OptsGlobal, fn ObjectAPIFunc) error
ObjectsAPIDo runs fn for each object the selector expands to, through the api: for the commands whose work no instance does, as an attachment held by the collector, which the daemon receiving the request asks for the object. The results render as the local command renders them, each under its object when there are several.
func PatchObjectConfig ¶
func PatchObjectConfig(ctx context.Context, c *client.T, p naming.Path, params api.PatchObjectConfigParams) (bool, []string, error)
PatchObjectConfig writes the keyword operations of params to the configuration of p, and says whether it changed, and what the daemon warns of, the write being done.
With params.Wait, the daemon holds the answer until the configuration has reached every live node of the object. A wait that expires is an error naming where it has not landed, after a write that was made all the same: writing again would apply a += operation twice.
func PatchObjectData ¶
func PatchObjectData(ctx context.Context, c *client.T, p naming.Path, data api.PatchDataKeys, wait bool, duration time.Duration) error
PatchObjectData applies the key operations of data to the datastore p, through the api, waiting for the configuration to reach every live node of the object when wait is set.
func PostDaemonRestart ¶
PostDaemonRestart sends an api request to restart the daemon and handles the response status codes.
func PostDaemonStop ¶
PostDaemonStop sends an api request to stop the daemon and handles the response status codes.
func PostInstanceActionUnstop ¶
func PostInstanceActionUnstop(ctx context.Context, c *client.T, p naming.Path, nodename string, sel OptsResourceSelector) (interface{}, error)
PostInstanceActionUnstop asks the daemon of nodename to lower the flags a stop raised on the instance of p, or on the resources sel selects.
func PrintConfigAlerts ¶
func PrintConfigAlerts(items api.ConfigAlertItems, out, sort, color string) error
PrintConfigAlerts prints the alerts of the validation of a configuration, as om validate config does.
func PrintKeysWarnings ¶
PrintKeysWarnings prints what a key write warns of, the keys written: the services whose install of the keys failed.
func PrintLocalKeysWarnings ¶
PrintLocalKeysWarnings prints the warnings of a key write made without the daemon, and returns its error, nil when the keys were written.
func RawStringSliceVar ¶
func RawStringSliceVar(flags *pflag.FlagSet, p *[]string, name string, value []string, usage string)
RawStringSliceVar declares a repeatable option whose values are taken whole.
func RawStringSliceVarP ¶
func RawStringSliceVarP(flags *pflag.FlagSet, p *[]string, name, shorthand string, value []string, usage string)
RawStringSliceVarP declares a repeatable option whose values are taken whole. It lives in util/flagvalue, which the command sets that cannot import this package reach too.
func ReadKeysFrom ¶
ReadKeysFrom returns the values the from location of a key command holds, by the path of each file read, the one value of a location that is no directory under the empty path. A deprecated from is warned of, with the one to write instead.
func RefreshInstanceStatusFromClusterStatus ¶
func RefreshInstanceStatusFromClusterStatus(ctx context.Context, clusterStatus clusterdump.Data) error
RefreshInstanceStatusFromClusterStatus asks every node to evaluate again the status of its instances the cluster status lists, and returns once each node published the status, so the caller reads the fresh ones.
The instances are refreshed in parallel, and the error joins the ones of the instances whose status could not be refreshed, a node that did not publish it before ctx is done included.
func RenderDuration ¶
RenderDuration is how long a span lasted, or how long it has lasted so far when it has not ended.
The records carry the two ends and not the length: two numbers that answer the same question can disagree, and these two did. The length is derived here, where it is wanted, and derived the same way for an exec, a session and an orchestration.
A running span is measured against the reader's clock, where its start came from the node that ran it, so a clock skew can make it negative. FmtShortDuration answers "0s" for that rather than a negative age.
func RenderRelayList ¶
func RenderRelayList(data api.RelayStatusList, out, sort, color string) error
RenderRelayList prints the clients of the relays. A table shows the views, with the AGE rendered from the update time. A machine format prints the api answer as it is, a list of its kind, as the api documents it: a script reads the same whether it asks the api or the command.
func ResolveExecID ¶
ResolveExecID returns the exec id s names: an id, or the start of the one id the daemons of the selected nodes know.
func ResolveOrchestrationID ¶
ResolveOrchestrationID returns the orchestration id s names: an id, or the start of the one id the daemons of the selected nodes know, as the status shows it.
A node answers for the orchestrations of the objects it has an instance of, so the daemon the client talks to may know nothing of the one asked about. No selection asks every node.
func ResolveSessionID ¶
ResolveSessionID returns the session id s names: an id, or the start of the one id the daemons of the selected nodes know.
func RunObjectDataPatch ¶
func RunObjectDataPatch(selector string, data api.PatchDataKeys, wait bool, duration time.Duration) error
RunObjectDataPatch applies the key operations of data to the datastores the selector names, through the api.
With wait, each answer is held until the configuration the operations committed has reached every live node of the object, for no longer than duration.
func SecretFromFileOrEnv ¶
SecretFromFileOrEnv returns the secret held by the file at filename, or the value of the envVar environment variable when filename is empty, or an empty string when neither is set.
A secret never reaches a command as a flag value: a command line is readable by any user through the process table, and stays in the shell history. So the flags naming one, --token and --credential, name a file, and the environment is what the daemon uses to hand a secret to a command it forks.
The file wins over the environment, so that an operator naming a file is told about a bad path instead of silently getting an inherited value.
func SectionBody ¶
SectionBody returns what the usage of cmd prints under the section title, up to the next empty line, and whether the section is there at all.
func SelectorFromStdin ¶
func SelectorFromStdin() string
func SetCustomUsageTemplate ¶
SetCustomUsageTemplate sets the custom help template on a command. This template will display an Arguments section if the command has an "args" annotation. It uses [FLAGS] (uppercase) instead of [flags] for consistency with [ID].
func SetKeywordsFromArgs ¶
SetKeywordsFromArgs adds the keywords named as positional arguments to the ones the --kw flag named.
Naming a keyword is what these commands are for, so it is the argument, and --kw is kept for the scripts written before it was.
func SetRIDFromArgs ¶
func SetSectionsFromArgs ¶
SetSectionsFromArgs adds the sections named as positional arguments to the ones the --section flag named.
Naming a section is how this command is narrowed, so it is the argument, and --section is kept for the scripts written before it was.
func SetWait ¶
SetWait reads what the caller asked to wait for.
No duration is a wait with no end: the daemon holds one request for an hour at most, so the wait is that hour asked again for as long as it takes, which is what unbounded says. A duration that is not positive is refused, rather than silently making a wait command a listing that reports success on work still running.
func UsageFlagEventFilter ¶
func UsageFlagEventFilter() string
func UsageFlagEventTemplate ¶
func UsageFlagEventTemplate() string
func ValidateArgs ¶
ValidateArgs returns an error when args name a command that does not exist.
cobra walks the command chain and, when the deepest command it reaches has no Run function, prints that command help and returns no error, silently dropping whatever was typed after it. A stale or mistyped command path exits 0 that way, which is how the daemon scheduler and the api exec kept reporting successful runs of commands renamed under their hard-coded argv.
func ValidateDraftConfig ¶
ValidateDraftConfig has the daemon validate the configuration read from src, a file path or - for stdin, as a write of it to the object of selector, a single path, would be checked: a create of an object that does not exist, a replace of one that does. The alerts are printed, and the error says whether one is an error.
func WaitAllInstanceMonitor ¶
func WaitInstanceMonitor ¶
func WaitInstanceMonitor(ctx context.Context, c *client.T, p naming.Path, timeout time.Duration, errC chan error) error
WaitInstanceMonitor launches a go routine that waits for a specific instance monitor update event within a given timeout, or ctx.Done() reached. The result of the wait is sent to the errC channel: nil if the InstanceMonitorUpdated event occurs, or a non-nil error otherwise.
If acquiring the event reader fails, WaitInstanceMonitor returns the error immediately and does not send anything to errC.
func WaitInstanceStatusUpdated ¶
func WaitInstanceStatusUpdated(ctx context.Context, c *client.T, nodename string, p naming.Path, timeout time.Duration, errC chan error) error
WaitInstanceStatusUpdated launches a go routine that waits for a specific instance status update event within a given timeout, or ctx.Done() reached. The result of the wait is sent to the errC channel: nil if the InstanceStatusUpdated event occurs, or a non-nil error otherwise.
If acquiring the event reader fails, WaitInstanceStatusUpdated returns the error immediately and does not send anything to errC.
func WaitObjectKnown ¶
func WaitObjectKnown(ctx context.Context, c *client.T, p naming.Path, timeout time.Duration, errC chan error) error
WaitAllInstanceMonitor launches a go routine that waits for all instance monitor updated events are received for an object within a given timeout, or ctx.Done() reached. The result of the wait is sent to the errC channel: nil if the InstanceMonitorUpdated event occurs, or a non-nil error otherwise.
It also filters the ObjectConfigUpdated events to get the expected Instance monitor updated events from the instance config scope nodes.
If acquiring the event reader fails, WaitInstanceMonitor returns the error immediately and does not send anything to errC. WaitObjectKnown watches for the daemon to know p, and sends nil on errC once it does: listed, which is how a selection names it, and watched by an instance monitor, on any node, which is what an action is asked of.
It is started before the configuration of p is written, so no event is missed between the write and the wait. The daemon learns of an object a moment after its configuration file is written, and a command run in that moment is told the object does not exist.
Types ¶
type CmdClusterAbort ¶
func (*CmdClusterAbort) Run ¶
func (t *CmdClusterAbort) Run() error
type CmdClusterConfigDoc ¶
type CmdClusterConfigDoc struct {
Color string
Output string
Keyword string
Driver string
Depth int
}
func (*CmdClusterConfigDoc) Run ¶
func (t *CmdClusterConfigDoc) Run() error
type CmdClusterEnroll ¶
type CmdClusterEnroll struct {
// Node is the location of the node to enroll, in the
// [<scheme>://]<addr>[:<port>] format.
Node string
// TokenFile is the path of a file holding an access token with the
// join role, created on the node to enroll. When empty, the
// OSVC_JOIN_TOKEN environment variable is used.
TokenFile string
// JoinAddr is the location the enrolled node must use to reach the
// cluster it joins.
JoinAddr string
// Timeout is the lifetime of the join token handed to the enrolled
// node, and the maximum duration to wait for the join to complete.
Timeout time.Duration
// Wait blocks until the enrolled node heartbeat is beating.
Wait bool
// KeepBackup keeps the config backup of the enrolled node once it has
// joined.
KeepBackup bool
// contains filtered or unexported fields
}
func (*CmdClusterEnroll) Run ¶
func (t *CmdClusterEnroll) Run() error
type CmdClusterEvict ¶
type CmdClusterEvict struct {
// Node is the nodename to remove from the cluster nodes.
Node string
// CredentialFile is the path of a file holding the
// <username>:<password> of the user to create on the evicted node.
CredentialFile string
// Timeout is the maximum duration of the leave forked on the evicted
// node, and the maximum duration to wait for it when Wait is set.
Timeout time.Duration
// Wait blocks until the cluster has dropped the evicted node.
Wait bool
// KeepBackup keeps the config backup of the evicted node once it has
// left.
KeepBackup bool
}
func (*CmdClusterEvict) Run ¶
func (t *CmdClusterEvict) Run() error
type CmdClusterFreeze ¶
func (*CmdClusterFreeze) Run ¶
func (t *CmdClusterFreeze) Run() error
type CmdClusterLockList ¶
type CmdClusterLockList struct {
OptsGlobal
}
CmdClusterLockList lists the cluster locks held.
func (*CmdClusterLockList) Run ¶
func (t *CmdClusterLockList) Run() error
type CmdClusterLockRelease ¶
CmdClusterLockRelease takes a cluster lock back from its holder.
func (*CmdClusterLockRelease) Run ¶
func (t *CmdClusterLockRelease) Run() error
type CmdClusterLogs ¶
func (*CmdClusterLogs) Run ¶
func (t *CmdClusterLogs) Run() error
type CmdClusterRegister ¶
func (*CmdClusterRegister) Run ¶
func (t *CmdClusterRegister) Run() error
type CmdClusterSSHTrust ¶
type CmdClusterSSHTrust struct {
}
func (*CmdClusterSSHTrust) Run ¶
func (t *CmdClusterSSHTrust) Run() error
type CmdClusterTombstoneList ¶
type CmdClusterTombstoneList struct {
OptsGlobal
}
CmdClusterTombstoneList lists the tombstones of the cluster.
func (*CmdClusterTombstoneList) Run ¶
func (t *CmdClusterTombstoneList) Run() error
type CmdClusterUnfreeze ¶
func (*CmdClusterUnfreeze) Run ¶
func (t *CmdClusterUnfreeze) Run() error
type CmdClusterUpdatePkg ¶
func (*CmdClusterUpdatePkg) Run ¶
func (t *CmdClusterUpdatePkg) Run() error
type CmdDaemonAudit ¶
type CmdDaemonAudit struct {
CmdDaemonSubAction
Output string
Level string
Subsystems []string
Preempt bool
}
func (*CmdDaemonAudit) Run ¶
func (t *CmdDaemonAudit) Run() error
type CmdDaemonAuth ¶
type CmdDaemonAuth struct {
Roles []string
Subject string
Scope string
AccessDuration time.Duration
Out string
Refresh bool
RefreshDuration time.Duration
}
func (*CmdDaemonAuth) Run ¶
func (t *CmdDaemonAuth) Run() error
type CmdDaemonDNSDump ¶
func (*CmdDaemonDNSDump) Run ¶
func (t *CmdDaemonDNSDump) Run() error
type CmdDaemonEvents ¶
type CmdDaemonEvents struct {
OptsGlobal
Filters []string
Duration time.Duration
Limit uint64
Template string
Wait bool
// Replay is used to enable replay event from the cached state
Replay bool
Quiet bool
NodeSelector string
// contains filtered or unexported fields
}
func (*CmdDaemonEvents) DoNodes ¶
func (t *CmdDaemonEvents) DoNodes() error
type CmdDaemonEventsDoc ¶
CmdDaemonEventsDoc documents the event kinds of the daemon.
func (*CmdDaemonEventsDoc) Run ¶
func (t *CmdDaemonEventsDoc) Run() error
type CmdDaemonExecList ¶
type CmdDaemonExecList struct {
NodeSelector string
Output string
Color string
States []string
Origins []string
SessionID string
OrchestrationID string
ExecID string
RID string
Selector string
// Columns is the table this renders. "om daemon ps" leads with the
// pid, the listing leads with the outcome.
Columns string
// Sort overrides the order the listing comes in.
Sort string
// Wait holds each request until the execs it asks about have ended,
// and is how "om daemon exec|session wait" waits: the daemon answers
// when the work is over rather than when it is asked, so a caller
// neither polls nor keeps an event stream open for it.
Wait time.Duration
// Unbounded says the caller named no duration and waits for as long
// as it takes. The daemon holds one request for an hour at most, so
// that wait is the request asked again until the work ends.
Unbounded bool
}
CmdDaemonExecList lists the commands the daemon ran and is running.
It is the one listing of the exec store, and "om daemon ps" is it with the running state preselected: what is running and what has run are the same records at different ages, so they are read by one code path and shown in one shape.
func (*CmdDaemonExecList) Gather ¶
func (t *CmdDaemonExecList) Gather() ([]api.ExecItem, error)
Gather asks every selected node and returns what they answered together.
An exec is node-local, so the union over the nodes is the whole of what a command did. A node that has forgotten an id it is asked for by name is not an error when another still holds it, which is why the by-id answers are folded in rather than returned.
func (*CmdDaemonExecList) Run ¶
func (t *CmdDaemonExecList) Run() error
func (*CmdDaemonExecList) RunWait ¶
func (t *CmdDaemonExecList) RunWait() error
RunWait waits for the execs it selects to end, reports them, and says whether any of them failed.
An exec id is what one run of one object on one node is called, and the node that ran it is the only one that knows how it went, so this asks the nodes the selector names and folds what they answer.
type CmdDaemonHeartbeatList ¶
type CmdDaemonHeartbeatList struct {
Color string
Output string
Sort string
NodeSelector string
PeerSelector string
Name string
}
func (*CmdDaemonHeartbeatList) Run ¶
func (t *CmdDaemonHeartbeatList) Run() error
type CmdDaemonHeartbeatRestart ¶
type CmdDaemonHeartbeatRestart struct {
CmdDaemonSubAction
Names []string
}
func (*CmdDaemonHeartbeatRestart) Run ¶
func (t *CmdDaemonHeartbeatRestart) Run() error
type CmdDaemonHeartbeatRotate ¶
func (*CmdDaemonHeartbeatRotate) Run ¶
func (t *CmdDaemonHeartbeatRotate) Run() error
type CmdDaemonHeartbeatSign ¶
type CmdDaemonHeartbeatSign struct {
CmdDaemonSubAction
Names []string
Force bool
}
func (*CmdDaemonHeartbeatSign) Run ¶
func (t *CmdDaemonHeartbeatSign) Run() error
type CmdDaemonHeartbeatStart ¶
type CmdDaemonHeartbeatStart struct {
CmdDaemonSubAction
Names []string
}
func (*CmdDaemonHeartbeatStart) Run ¶
func (t *CmdDaemonHeartbeatStart) Run() error
type CmdDaemonHeartbeatStop ¶
type CmdDaemonHeartbeatStop struct {
CmdDaemonSubAction
Names []string
}
func (*CmdDaemonHeartbeatStop) Run ¶
func (t *CmdDaemonHeartbeatStop) Run() error
type CmdDaemonHeartbeatWipe ¶
type CmdDaemonHeartbeatWipe struct {
CmdDaemonSubAction
Names []string
Force bool
}
func (*CmdDaemonHeartbeatWipe) Run ¶
func (t *CmdDaemonHeartbeatWipe) Run() error
type CmdDaemonIDLogs ¶
type CmdDaemonIDLogs struct {
CmdNodeLogs
// Key is the log field the id is matched on.
Key string
// ID is the id to report the entries of.
ID string
// Resolve returns the id the ID given names, which can be the
// start of one, as the listings and the status show them.
Resolve func(t *CmdDaemonIDLogs) (string, error)
}
CmdDaemonIDLogs reports the log entries one id names.
The daemon stamps what it runs with the ids it was run under: the exec that forked it, the session the exec belongs to, and the orchestration the session was a step of. A listing hands one of those ids back, and this is how it is followed to what was logged under it.
It is "om node logs" with the filter already written: the ids are log fields, and matching one is what the filter does.
func (*CmdDaemonIDLogs) Run ¶
func (t *CmdDaemonIDLogs) Run() error
type CmdDaemonKill ¶
type CmdDaemonKill struct {
NodeSelector string
Output string
Sort string
Color string
Signal string
DryRun bool
ExecID string
SessionID string
OrchestrationID string
Origins []string
RID string
Selector string
}
CmdDaemonKill signals the processes of the execs a filter selects.
It selects them the way "om daemon exec list" selects them, so what that lists is what this signals, and the answer is the same shape: the execs signaled.
func (*CmdDaemonKill) Run ¶
func (t *CmdDaemonKill) Run() error
type CmdDaemonListenerRestart ¶
type CmdDaemonListenerRestart struct {
CmdDaemonSubAction
Name string
}
func (*CmdDaemonListenerRestart) Run ¶
func (t *CmdDaemonListenerRestart) Run() error
type CmdDaemonListenerStart ¶
type CmdDaemonListenerStart struct {
CmdDaemonSubAction
Name string
}
func (*CmdDaemonListenerStart) Run ¶
func (t *CmdDaemonListenerStart) Run() error
type CmdDaemonListenerStop ¶
type CmdDaemonListenerStop struct {
CmdDaemonSubAction
Name string
}
func (*CmdDaemonListenerStop) Run ¶
func (t *CmdDaemonListenerStop) Run() error
type CmdDaemonLog ¶
type CmdDaemonLog struct {
CmdDaemonSubAction
Level string
}
func (*CmdDaemonLog) Run ¶
func (t *CmdDaemonLog) Run() error
type CmdDaemonRelayList ¶
func (*CmdDaemonRelayList) Run ¶
func (t *CmdDaemonRelayList) Run() error
type CmdDaemonSessionList ¶
type CmdDaemonSessionList struct {
CmdDaemonExecList
}
CmdDaemonSessionList reports sessions, one row per session.
A session is what was submitted; an exec is one run of one object on one node, and one session is several of them. Folding the execs into the session is the work this command exists to do: a reader asking how their command went should not have to count succeeded rows themselves.
The fold is done here and not in the daemon because a session spans nodes and each daemon holds only the execs it ran. A per-node session is a partial one, which is worse than none.
func (*CmdDaemonSessionList) Run ¶
func (t *CmdDaemonSessionList) Run() error
func (*CmdDaemonSessionList) RunWait ¶
func (t *CmdDaemonSessionList) RunWait() error
RunWait waits for every exec of the session to end, reports the session, and says whether any of its execs failed.
type CmdDaemonSubAction ¶
type CmdDaemonSubAction struct {
Debug bool
NodeSelector string
// OnResponse, when set, receives the body each node answered
// with. It is called from the goroutine handling that node, so
// an implementation shared by several nodes serializes itself.
OnResponse func(nodename string, b []byte)
}
func (*CmdDaemonSubAction) Run ¶
func (t *CmdDaemonSubAction) Run(fn apiFuncWithNode) error
Run daemon sub-component action
func (*CmdDaemonSubAction) RunForEach ¶
func (t *CmdDaemonSubAction) RunForEach(names []string, fn func(name string) apiFuncWithNode) error
RunForEach runs the action once per name, so a command taking several names attempts them all rather than stopping on the first that fails, and reports every failure.
type CmdNetworkNodeList ¶
type CmdNetworkNodeList struct {
Color string
Output string
Sort string
Name string
NodeSelector string
}
CmdNetworkNodeList lists what the last setup of each network made on each node.
func (*CmdNetworkNodeList) Run ¶
func (t *CmdNetworkNodeList) Run() error
type CmdNetworkPeerList ¶
type CmdNetworkPeerList struct {
CmdNetworkNodeList
PeerSelector string
}
CmdNetworkPeerList lists how each node reaches each other node of each network, as the last setup of the network on the node made it.
func (*CmdNetworkPeerList) Run ¶
func (t *CmdNetworkPeerList) Run() error
type CmdNodeConfigDoc ¶
type CmdNodeConfigDoc struct {
Color string
Output string
Sort string
Keyword string
Driver string
Depth int
}
func (*CmdNodeConfigDoc) Run ¶
func (t *CmdNodeConfigDoc) Run() error
type CmdNodeConfigMigrate ¶
func (*CmdNodeConfigMigrate) Run ¶
func (t *CmdNodeConfigMigrate) Run() error
Run writes the configurations of the selected nodes in the shape om reads them in, as CmdObjectConfigMigrate does for objects.
type CmdNodeDequeue ¶
type CmdNodeDequeue struct {
OptsNodeGlobal
}
CmdNodeDequeue duplicates the omcmd and oxcmd CmdNodeDequeue configuration for nodes based on the specified NodeSelector.
func (*CmdNodeDequeue) Remote ¶
func (t *CmdNodeDequeue) Remote() error
Remote performs a remote action dequeue operation on nodes specified by the NodeSelector and returns any encountered errors.
type CmdNodeLogs ¶
type CmdNodeLogs struct {
OptsGlobal
OptsLogs
NodeSelector string
}
CmdNodeLogs duplicates the omcmd and oxcmd CmdNodeLogs configuration for fetching logs from nodes based on the specified NodeSelector.
func (*CmdNodeLogs) Remote ¶
func (t *CmdNodeLogs) Remote() error
Remote fetches logs remotely from the nodes specified by the NodeSelector, using concurrent streaming for each node. Returns an error if the client setup fails, no nodes are selected, or if there are issues during the process.
type CmdNodeMetrics ¶
type CmdNodeMetrics struct {
NodeSelector string
}
func (*CmdNodeMetrics) Run ¶
func (t *CmdNodeMetrics) Run() error
type CmdObjectCap ¶
type CmdObjectCap struct {
OptsGlobal
OptsAsync
Set []string
}
CmdObjectCap sets the process group caps of objects and applies them to their running instances.
func (*CmdObjectCap) Run ¶
func (t *CmdObjectCap) Run(kind string) error
Run writes the caps and queues the orchestration applying them.
type CmdObjectConfigDoc ¶
type CmdObjectConfigDoc struct {
OptsGlobal
Color string
Output string
Keyword string
Driver string
Depth int
}
func (*CmdObjectConfigDoc) Run ¶
func (t *CmdObjectConfigDoc) Run(kind string) error
type CmdObjectConfigMigrate ¶
type CmdObjectConfigMigrate struct {
OptsGlobal
OptsLock
DryRun bool
}
func (*CmdObjectConfigMigrate) Run ¶
func (t *CmdObjectConfigMigrate) Run(kind string) error
Run writes the configurations of the selected objects in the shape om reads them in.
The changes land through the configuration update path, so a migration is weighed like any other write: the same validation, the same policy, the same claim on a pool.
type CmdObjectInstanceClear ¶
func (*CmdObjectInstanceClear) Run ¶
func (t *CmdObjectInstanceClear) Run(kind string) error
type CmdObjectLogs ¶
type CmdObjectLogs struct {
OptsGlobal
OptsLogs
NodeSelector string
}
CmdObjectLogs duplicates the omcmd and oxcmd CmdObjectLogs configuration for fetching logs from nodes based on the specified NodeSelector.
func (*CmdObjectLogs) Remote ¶
func (t *CmdObjectLogs) Remote(selStr string) error
Remote executes the object log retrieval operation for selected nodes and paths in an asynchronous manner. It leverages the provided selector string to identify target objects and nodes for log streaming.
type CmdObjectMonitor ¶
type CmdObjectMonitor struct {
Color string
ObjectSelector string
Output string
Sections string
Watch bool
}
func (*CmdObjectMonitor) Run ¶
func (t *CmdObjectMonitor) Run(selector, kind string) error
type CmdPoolList ¶
type CmdPoolList struct {
OptsGlobal
Name string
NodeSelector string
Physical bool
}
func (*CmdPoolList) Run ¶
func (t *CmdPoolList) Run() error
type ComplianceRunOptions ¶
ComplianceRunOptions are the options of a run of the compliance modules of a node.
type ComplianceRuns ¶
type ComplianceRuns struct {
// contains filtered or unexported fields
}
ComplianceRuns collects the runs of a compliance action, on this node or on the nodes selected, for the exit code of the command.
func (*ComplianceRuns) Add ¶
func (t *ComplianceRuns) Add(run *compliance.Run)
Add adds the run to the ones the exit code of the command reflects.
func (*ComplianceRuns) Err ¶
func (t *ComplianceRuns) Err() error
Err returns the error the command ends with when a run is not compliant, exit code 1, or when every run is not applicable to its node, exit code 2: the contract of a compliance module, applied to the command running them.
type DryRun ¶
DryRun has a configuration write run its checks and write nothing, and says how to print the alerts the daemon answers it with.
func NewDryRun ¶
NewDryRun returns the dry run a command asks with dryRun, printing as its output and color options say, and nil for a write.
func (DryRun) Report ¶
Report prints the alerts the daemon answered a dry run of a configuration write of p with, and returns an error when one is an error, so the dry run exits non-zero for a write that would be refused.
For a reader, the alerts print only when there are some, and the dry run says what the write would have done when none is an error. A machine output is the list, even empty.
type ExecView ¶
type ExecView struct {
Node string `json:"node"`
State string `json:"state"`
ExecID string `json:"exec_id"`
SessionID string `json:"session_id"`
OrchestrationID string `json:"orchestration_id,omitempty"`
Path string `json:"path,omitempty"`
Origin string `json:"origin"`
RID string `json:"rid,omitempty"`
Pid *int `json:"pid,omitempty"`
StartedAt time.Time `json:"started_at"`
EndedAt *time.Time `json:"ended_at,omitempty"`
// Duration is rendered, not carried: the two ends are the data. So
// --sort=duration orders the text of it, where --sort=started_at and
// --sort=ended_at order the moments they name.
Duration string `json:"duration,omitempty"`
ExitCode *int `json:"exit_code,omitempty"`
Command string `json:"command,omitempty"`
Error string `json:"error,omitempty"`
}
ExecView is what the table shows: the api reports a duration in nanoseconds and an instant to the nanosecond, which a machine wants and a reader does not.
func ToExecViews ¶
type InstanceDeviceLine ¶
type InstanceDeviceLine struct {
Node string `json:"node"`
api.InstanceDevice
}
InstanceDeviceLine is a device of a resource of an instance as a listing shows it, with the node of the instance.
type List ¶
List is a listing a command builds itself, from what the node holds or from the status of the cluster, printed in the machine formats as the lists the api answers with, {kind, items}: a script reads every listing, from om or ox, the same way. Kind is the one of the api list of the same things, when there is one.
type NodeCheckLine ¶
NodeCheckLine is a check result of a node as a listing shows it.
func NodeCheckLines ¶
func NodeCheckLines(l api.CheckList) ([]NodeCheckLine, error)
NodeCheckLines returns the results of the list as a listing shows them, with the error of their push to the collector if it failed.
type ObjectAPIFunc ¶
ObjectAPIFunc does the work of a command for one object, through the api.
func ObjectCollectorTagAttach ¶
func ObjectCollectorTagAttach(name string, attachData *string) ObjectAPIFunc
ObjectCollectorTagAttach returns the work of "<path> collector tag attach": the answer of the collector.
func ObjectCollectorTagDetach ¶
func ObjectCollectorTagDetach(name string) ObjectAPIFunc
ObjectCollectorTagDetach returns the work of "<path> collector tag detach": the answer of the collector.
func ObjectCollectorTagShow ¶
func ObjectCollectorTagShow(verbose bool) ObjectAPIFunc
ObjectCollectorTagShow returns the work of "<path> collector tag show": the names of the tags attached to the object, or all their data with verbose.
func ObjectComplianceModules ¶
func ObjectComplianceModules() ObjectAPIFunc
ObjectComplianceModules returns the work of "<path> compliance list module": the modules installed on the node serving the request.
func ObjectComplianceModulesetAttachment ¶
func ObjectComplianceModulesetAttachment(moduleset string, attach bool) ObjectAPIFunc
ObjectComplianceModulesetAttachment returns the work of "<path> compliance attach moduleset", or of its detach.
func ObjectComplianceModulesetTree ¶
func ObjectComplianceModulesetTree(modulesets string) ObjectAPIFunc
ObjectComplianceModulesetTree returns the work of "<path> compliance show moduleset".
func ObjectComplianceModulesets ¶
func ObjectComplianceModulesets(filter string) ObjectAPIFunc
ObjectComplianceModulesets returns the work of "<path> compliance list moduleset".
func ObjectComplianceRulesetAttachment ¶
func ObjectComplianceRulesetAttachment(ruleset string, attach bool) ObjectAPIFunc
ObjectComplianceRulesetAttachment returns the work of "<path> compliance attach ruleset", or of its detach.
func ObjectComplianceRulesets ¶
func ObjectComplianceRulesets(filter string) ObjectAPIFunc
ObjectComplianceRulesets returns the work of "<path> compliance list ruleset".
type OptsEncap ¶
type OptsEncap struct {
// A list of encap instance, identified by hostname of the container
Slaves []string
// The host instance
Master bool
// All encap instances
AllSlaves bool
}
OptsEncap contains options to select where a instance action runs with a encap enabled service
type OptsGlobal ¶
type OptsLock ¶
type OptsLock struct {
Disable bool
Timeout time.Duration
// TimeoutSet says --waitlock was given, and Timeout is not its
// default: an action that would wait longer by default keeps to
// it.
TimeoutSet bool
}
OptsLock contains options accepted by all actions using an action lock
type OptsLogs ¶
OptsLogs contains options used by all log commands: node logs, cluster logs, object logs
type OptsNodeGlobal ¶
type OptsResourceSelector ¶
OptsResourceSelector contains options needed to initialize a resourceselector.Options struct
type OptsRestore ¶
type OptsRestore struct {
// Snapshot is the snapshot to restore, by id or a prefix of
// it, the latest when empty.
Snapshot string
// Into is a directory to restore aside into.
Into string
// Config asks the configuration of the object restored: in
// place, it alone, aside, beside the heads.
Config bool
// ByRID asks each head restored into the current head of the
// resource of its rid, rather than at the path it was saved
// from.
ByRID bool
// Stop asks the instance brought to the state a restore in place
// needs, and left stopped.
Stop bool
// Heads are the heads to restore, every head of the snapshot
// when empty.
Heads []string
// Refs is how the referenced keys are restored: missing, skip
// or overwrite.
Refs string
}
OptsRestore contains the options of a sync restore.
type PoolLine ¶
type PoolLine struct {
api.Pool
BinSize string `json:"bin_size"`
BinUsed string `json:"bin_used"`
BinFree string `json:"bin_free"`
}
PoolLine is a pool as a listing shows it: the pool the api sent, and the sizes in the units a reader reads.
The sizes shown are what the pool can hand out to volumes, which is what a volume is asked for in and what a claim rations, and not what the storage behind it holds: a pool whose nodes each hold a copy of every volume hands out what one of them can take. The storage is what the physical listing shows.
The embedded value is inlined, by the json encoder and by the jsonpath the tab expressions are written in alike, so a column names a pool field directly and the columns added here sit next to them.
type PoolVolumeLine ¶
type PoolVolumeLine struct {
api.PoolVolume
BinSize string `json:"bin_size"`
Charges string `json:"charges_text"`
}
PoolVolumeLine is a pool volume as a listing shows it: the volume the api sent, and its size and what it takes of other pools in the form a reader reads.
func NewPoolVolumeLine ¶
func NewPoolVolumeLine(item api.PoolVolume) PoolVolumeLine
NewPoolVolumeLine returns the volume as a listing shows it.
type RelayView ¶
type RelayView struct {
api.RelayStatusItem
// Age is rendered, not carried: how long ago the data was updated, by
// the reader's clock.
Age string `json:"age,omitempty"`
}
RelayView is what the table shows of a relay client: the api item and the age of its data.
func ToRelayViews ¶
func ToRelayViews(items api.RelayStatusItems, now time.Time) []RelayView
type SessionView ¶
type SessionView struct {
SessionID string `json:"session_id"`
State string `json:"state"`
OrchestrationID string `json:"orchestration_id,omitempty"`
Execs int `json:"execs"`
Running int `json:"running"`
Failed int `json:"failed"`
Nodes int `json:"nodes"`
Objects int `json:"objects"`
Origin string `json:"origin"`
StartedAt time.Time `json:"started_at"`
EndedAt *time.Time `json:"ended_at,omitempty"`
Duration string `json:"duration,omitempty"`
Command string `json:"command,omitempty"`
}
SessionView is one session, folded from its execs.
func ToSessionViews ¶
func ToSessionViews(items []api.ExecItem) []SessionView
ToSessionViews folds execs into the sessions they belong to, newest first.
Source Files
¶
- args.go
- cluster_abort.go
- cluster_config_doc.go
- cluster_enroll.go
- cluster_evict.go
- cluster_freeze.go
- cluster_lock.go
- cluster_logs.go
- cluster_register.go
- cluster_ssh_trust.go
- cluster_status.go
- cluster_tombstone.go
- cluster_unfreeze.go
- cluster_update_pkg.go
- cobra_helpers.go
- config.go
- config_alerts.go
- config_doc.go
- config_update.go
- daemon.go
- daemon_audit.go
- daemon_auth.go
- daemon_dns_dump.go
- daemon_events.go
- daemon_events_doc.go
- daemon_exec_list.go
- daemon_hb_list.go
- daemon_hb_restart.go
- daemon_hb_rotate.go
- daemon_hb_sign.go
- daemon_hb_start.go
- daemon_hb_stop.go
- daemon_hb_wipe.go
- daemon_id_logs.go
- daemon_kill.go
- daemon_listener_restart.go
- daemon_listener_start.go
- daemon_listener_stop.go
- daemon_log.go
- daemon_ps.go
- daemon_relay_list.go
- daemon_session_list.go
- daemon_sub_action.go
- daemon_subsystems.go
- daemon_wait.go
- errors.go
- factory_kind.go
- flag_raw_string_slice.go
- flags.go
- flags_global.go
- groups.go
- help.go
- listing.go
- main.go
- network_node.go
- network_setup.go
- node.go
- node_checks.go
- node_collector_tag.go
- node_compliance.go
- node_config_doc.go
- node_config_migrate.go
- node_config_validate.go
- node_dequeue.go
- node_drivers.go
- node_log.go
- node_metrics.go
- node_prkey.go
- object.go
- object_api.go
- object_cap.go
- object_clear.go
- object_collector_tag.go
- object_compliance.go
- object_config_doc.go
- object_config_migrate.go
- object_config_validate_draft.go
- object_create.go
- object_instance_delete.go
- object_instance_device_list.go
- object_instance_pg.go
- object_instance_unstop.go
- object_key.go
- object_key_install.go
- object_key_patch.go
- object_log.go
- object_monitor.go
- object_resource_info.go
- object_schedule.go
- object_schedule_list.go
- options.go
- password.go
- pool_list.go
- post_daemon_restart.go
- post_daemon_stop.go
- relay_list.go
- restore.go
- secret.go
- template.go