Documentation
¶
Index ¶
- Variables
- func AllSlaves(ctx context.Context) bool
- func Env(ctx context.Context) []string
- func HasProps(ctx context.Context) bool
- func HasResourceSelector(ctx context.Context) bool
- func IsActionForMaster(ctx context.Context) bool
- func IsActionForSlave(ctx context.Context, nodename string) bool
- func IsConfirm(ctx context.Context) bool
- func IsCron(ctx context.Context) bool
- func IsForce(ctx context.Context) bool
- func IsInterruptSyncs(ctx context.Context) bool
- func IsLeader(ctx context.Context) bool
- func IsLockDisabled(ctx context.Context) bool
- func IsLockTimeoutSet(ctx context.Context) bool
- func IsQuiet(ctx context.Context) bool
- func IsResourceSelected(ctx context.Context, path naming.Path, rid string) (selected, known bool)
- func IsRollbackDisabled(ctx context.Context) bool
- func IsStep(ctx context.Context) bool
- func LockTimeout(ctx context.Context) time.Duration
- func Master(ctx context.Context) bool
- func MoveTo(ctx context.Context) string
- func RID(ctx context.Context) string
- func Slaves(ctx context.Context) []string
- func Subset(ctx context.Context) string
- func Tag(ctx context.Context) string
- func Target(ctx context.Context) []string
- func To(ctx context.Context) string
- func Verbose(ctx context.Context) int
- func WithAllSlaves(ctx context.Context, v bool) context.Context
- func WithConfirm(ctx context.Context, v bool) context.Context
- func WithCron(ctx context.Context, v bool) context.Context
- func WithEnv(ctx context.Context, s []string) context.Context
- func WithForce(ctx context.Context, v bool) context.Context
- func WithInterruptSyncs(ctx context.Context, v bool) context.Context
- func WithLeader(ctx context.Context, v bool) context.Context
- func WithLockDisabled(ctx context.Context, v bool) context.Context
- func WithLockTimeout(ctx context.Context, d time.Duration) context.Context
- func WithLockTimeoutSet(ctx context.Context, v bool) context.Context
- func WithMaster(ctx context.Context, v bool) context.Context
- func WithMoveTo(ctx context.Context, v string) context.Context
- func WithProps(ctx context.Context, props Properties) context.Context
- func WithQuiet(ctx context.Context, v bool) context.Context
- func WithRID(ctx context.Context, s string) context.Context
- func WithRollbackDisabled(ctx context.Context, v bool) context.Context
- func WithSelectedRIDs(ctx context.Context, path naming.Path, rids []string) context.Context
- func WithSlaves(ctx context.Context, s []string) context.Context
- func WithSubset(ctx context.Context, s string) context.Context
- func WithTag(ctx context.Context, s string) context.Context
- func WithTarget(ctx context.Context, s []string) context.Context
- func WithTo(ctx context.Context, s string) context.Context
- func WithVerbose(ctx context.Context, v int) context.Context
- type Properties
Constants ¶
This section is empty.
Variables ¶
var ( Boot = Properties{ Name: "boot", Target: "booted", Progress: "booting", Failure: "boot failed", MustLock: true, Order: ordering.Desc, MarksStopped: true, TimeoutKeywords: []string{"timeout"}, PG: true, } Delete = Properties{ Name: "delete", Target: "deleted", Progress: "deleting", Failure: "delete failed", Order: ordering.Desc, MustLock: true, } Freeze = Properties{ Name: "freeze", Target: "frozen", Progress: "freezing", Failure: "freeze failed", PG: true, } PRStart = Properties{ Name: "prstart", Failure: "start failed", Progress: "starting", Rollback: true, TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } PRStop = Properties{ Name: "prstop", Failure: "stop failed", MustLock: true, Order: ordering.Desc, Progress: "stopping", TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, } Set = Properties{ Name: "set", MustLock: true, } SetProvisioned = Properties{ Name: "set provisioned", MustLock: true, } SetUnprovisioned = Properties{ Name: "set unprovisioned", MustLock: true, } Status = Properties{ Name: "status", PG: true, MustLock: true, LockGroup: "status", } Enable = Properties{ Name: "enable", MustLock: true, } Disable = Properties{ Name: "disable", MustLock: true, } Unset = Properties{ Name: "unset", MustLock: true, } ValidateConfig = Properties{ Name: "validate_config", MustLock: true, } Provision = Properties{ Name: "provision", Target: "provisioned", Progress: "provisioning", Failure: "provision failed", MustLock: true, Rollback: true, TimeoutKeywords: []string{"provision_timeout", "timeout"}, PG: true, } PushResInfo = Properties{ Name: "push resinfo", PG: true, } // Install installs again what the volumes and the filesystems of the // instance declare, as their start does, without starting anything. Install = Properties{ Name: "install", MustLock: true, PG: true, } Run = Properties{ Name: "run", TimeoutKeywords: []string{"run_timeout", "timeout"}, PG: true, } Shutdown = Properties{ Name: "shutdown", Target: "shutdown", Progress: "shutting", Failure: "shutdown failed", Order: ordering.Desc, TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, } PGUpdate = Properties{ Name: "pg_update", MustLock: true, PG: true, } PGReset = Properties{ Name: "pg_reset", MustLock: true, PG: true, } Start = Properties{ Name: "start", Target: "started", Progress: "starting", Failure: "start failed", MustLock: true, ClearsStopped: true, Rollback: true, TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } StartStandby = Properties{ Name: "startstandby", Progress: "starting", Failure: "start failed", MustLock: true, Rollback: true, TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } Stop = Properties{ Name: "stop", Target: "stopped", Progress: "stopping", Failure: "stop failed", MustLock: true, Order: ordering.Desc, MarksStopped: true, TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, } // ProvisionStop is the stop ending a provision off the placement // leader, which leaves stopped what the provision started on an // instance it found down. ProvisionStop = Properties{ Name: "stop", Target: "stopped", Progress: "stopping", Failure: "stop failed", MustLock: true, Order: ordering.Desc, StepOf: "provision", TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, } SyncFull = Properties{ Name: "full", MustLock: true, PG: true, } SyncIngest = Properties{ Name: "sync_ingest", MustLock: true, PG: true, } SyncResync = Properties{ Name: "sync_resync", MustLock: true, PG: true, } SyncSplit = Properties{ Name: "sync_split", MustLock: true, PG: true, } SyncUpdate = Properties{ Name: "update", MustLock: true, PG: true, } Unfreeze = Properties{ Name: "unfreeze", Target: "unfrozen", Progress: "unfreezing", Failure: "unfreeze failed", PG: true, } Unprovision = Properties{ Name: "unprovision", Target: "unprovisioned", Progress: "unprovisioning", Failure: "unprovision failed", MustLock: true, Order: ordering.Desc, TimeoutKeywords: []string{"unprovision_timeout", "timeout"}, PG: true, } )
Functions ¶
func HasResourceSelector ¶
func IsActionForMaster ¶
func IsInterruptSyncs ¶
func IsLockDisabled ¶
func IsLockTimeoutSet ¶
func IsResourceSelected ¶
IsResourceSelected tells whether the resource identified by rid, of the object at path, is among the ones recorded by WithSelectedRIDs. The known return value is false when no selection is recorded for this object, i.e. outside an action, during an action on all the resources, or during the status evaluation of another object, so the caller can apply its default policy.
func IsRollbackDisabled ¶
func IsStep ¶
IsStep tells whether the action of the context is a step of another action, which flags nothing stopped on purpose.
func WithInterruptSyncs ¶
WithInterruptSyncs has a stop end the syncs running on the instance before stopping it, instead of waiting for the object lock they hold.
func WithLockTimeoutSet ¶
WithLockTimeoutSet says the lock timeout was given by the user, not defaulted: an action that would wait longer by default keeps to it.
func WithSelectedRIDs ¶
WithSelectedRIDs records the rids of the resources an action with a resource selection works on or reads the state of, for the object at path. Drivers read it with IsResourceSelected, for example to spare a provider api call on a resource the action does not depend on.
The path scopes the rids: an action can evaluate the status of another object with the same context, like the start affinity checks do, and the resources of that object must not be judged by this selection.
Types ¶
type Properties ¶
type Properties struct {
Name string
Target string
Progress string
Failure string
Order ordering.T
MustLock bool
LockGroup string
// MarksStopped says the action leaves the instance stopped on
// purpose, so the daemon must not start it back on its own until
// the object is wanted up again.
MarksStopped bool
// ClearsStopped says the action wants the instance up, so the
// daemon may start it on its own again.
ClearsStopped bool
// StepOf names the action this one is a step of, and is empty for
// an action asked for itself. A step flags nothing stopped on
// purpose, neither the instance nor a resource: the user asked for
// the action it is a step of, not for it.
StepOf string
Rollback bool
PG bool
TimeoutKeywords []string
}
func Props ¶
func Props(ctx context.Context) Properties