juju: github.com/juju/juju/core/status Index | Files

package status

import "github.com/juju/juju/core/status"

Index

Package Files

status.go status_history.go

Constants

const (
    MessageWaitForMachine    = "waiting for machine"
    MessageWaitForContainer  = "waiting for container"
    MessageInstallingAgent   = "installing agent"
    MessageInitializingAgent = "agent initializing"
    MessageInstallingCharm   = "installing charm software"
)

func AllHistoryKind Uses

func AllHistoryKind() map[HistoryKind]string

AllHistoryKind will return all valid HistoryKinds.

func ValidModelStatus Uses

func ValidModelStatus(status Status) bool

ValidModelStatus returns true if status has a valid value (that is to say, a value that it's OK to set) for models.

func ValidWorkloadStatus Uses

func ValidWorkloadStatus(status Status) bool

ValidWorkloadStatus returns true if status has a valid value (that is to say, a value that it's OK to set) for units or applications.

type DetailedStatus Uses

type DetailedStatus struct {
    Status Status
    Info   string
    Data   map[string]interface{}
    Since  *time.Time
    Kind   HistoryKind
    // TODO(perrito666) make sure this is not used and remove.
    Version string
    Life    string
    Err     error
}

DetailedStatus holds status info about a machine or unit agent.

type History Uses

type History []DetailedStatus

History holds many DetailedStatus,

type HistoryKind Uses

type HistoryKind string

HistoryKind represents the possible types of status history entries.

const (
    // KindUnit represents agent and workload combined.
    KindUnit HistoryKind = "unit"
    // KindUnitAgent represent a unit agent status history entry.
    KindUnitAgent HistoryKind = "juju-unit"
    // KindWorkload represents a charm workload status history entry.
    KindWorkload HistoryKind = "workload"
    // KindMachineInstance represents an entry for a machine instance.
    KindMachineInstance HistoryKind = "machine"
    // KindMachine represents an entry for a machine agent.
    KindMachine HistoryKind = "juju-machine"
    // KindContainerInstance represents an entry for a container instance.
    KindContainerInstance HistoryKind = "container"
    // KindContainer represents an entry for a container agent.
    KindContainer HistoryKind = "juju-container"
)

IMPORTANT DEV NOTE: when changing this HistoryKind list in anyway, these may need to be revised:

* HistoryKind.Valid() * AllHistoryKind() * command help for 'show-status-log' describing these kinds.

func (HistoryKind) String Uses

func (k HistoryKind) String() string

String returns a string representation of the HistoryKind.

func (HistoryKind) Valid Uses

func (k HistoryKind) Valid() bool

Valid will return true if the current kind is a valid one.

type InstanceStatusGetter Uses

type InstanceStatusGetter interface {
    InstanceStatus() (StatusInfo, error)
}

InstanceStatusGetter represents a type whose instance status can be read.

type InstanceStatusHistoryGetter Uses

type InstanceStatusHistoryGetter interface {
    InstanceStatusHistory(filter StatusHistoryFilter) ([]StatusInfo, error)
}

InstanceStatusHistoryGetter instances can fetch their instance status history.

type ModificationStatusGetter Uses

type ModificationStatusGetter interface {
    ModificationStatus() (StatusInfo, error)
}

ModificationStatusGetter represents a type whose modification status can be read.

type Status Uses

type Status string

Status used to represent the status of an entity, but has recently become and applies to "workloads" as well, which we don't currently model, for no very clear reason.

Status values currently apply to machine (agents), unit (agents), unit (workloads), application (workloads), volumes, filesystems, and models.

const (

    // Error means the entity requires human intervention
    // in order to operate correctly.
    Error Status = "error"

    // Started is set when:
    // The entity is actively participating in the model.
    // For unit agents, this is a state we preserve for backwards
    // compatibility with scripts during the life of Juju 1.x.
    // In Juju 2.x, the agent-state will remain “active” and scripts
    // will watch the unit-state instead for signals of application readiness.
    Started Status = "started"
)
const (

    // Pending is set when:
    // The machine is not yet participating in the model.
    Pending Status = "pending"

    // Stopped is set when:
    // The machine's agent will perform no further action, other than
    // to set the unit to Dead at a suitable moment.
    Stopped Status = "stopped"

    // Down is set when:
    // The machine ought to be signalling activity, but it cannot be
    // detected.
    Down Status = "down"
)
const (

    // Allocating is set when:
    // The machine on which a unit is to be hosted is still being
    // spun up in the cloud.
    Allocating Status = "allocating"

    // Rebooting is set when:
    // The machine on which this agent is running is being rebooted.
    // The juju-agent should move from rebooting to idle when the reboot is complete.
    Rebooting Status = "rebooting"

    // Executing is set when:
    // The agent is running a hook or action. The human-readable message should reflect
    // which hook or action is being run.
    Executing Status = "executing"

    // Idle is set when:
    // Once the agent is installed and running it will notify the Juju server and its state
    // becomes "idle". It will stay "idle" until some action (e.g. it needs to run a hook) or
    // error (e.g it loses contact with the Juju server) moves it to a different state.
    Idle Status = "idle"

    // Failed is set when:
    // The unit agent has failed in some way,eg the agent ought to be signalling
    // activity, but it cannot be detected. It might also be that the unit agent
    // detected an unrecoverable condition and managed to tell the Juju server about it.
    Failed Status = "failed"

    // Lost is set when:
    // The juju agent has has not communicated with the juju server for an unexpectedly long time;
    // the unit agent ought to be signalling activity, but none has been detected.
    Lost Status = "lost"
)
const (

    // Maintenance is set when:
    // The unit is not yet providing services, but is actively doing stuff
    // in preparation for providing those services.
    // This is a "spinning" state, not an error state.
    // It reflects activity on the unit itself, not on peers or related units.
    Maintenance Status = "maintenance"

    // Terminated is set when:
    // This unit used to exist, we have a record of it (perhaps because of storage
    // allocated for it that was flagged to survive it). Nonetheless, it is now gone.
    Terminated Status = "terminated"

    // Unknown is set when:
    // A unit-agent has finished calling install, config-changed, and start,
    // but the charm has not called status-set yet.
    Unknown Status = "unknown"

    // Waiting is set when:
    // The unit is unable to progress to an active state because an application to
    // which it is related is not running.
    Waiting Status = "waiting"

    // Blocked is set when:
    // The unit needs manual intervention to get back to the Running state.
    Blocked Status = "blocked"

    // Active is set when:
    // The unit believes it is correctly offering all the services it has
    // been asked to offer.
    Active Status = "active"
)
const (

    // Attaching indicates that the storage is being attached
    // to a machine.
    Attaching Status = "attaching"

    // Attached indicates that the storage is attached to a
    // machine.
    Attached Status = "attached"

    // Detaching indicates that the storage is being detached
    // from a machine.
    Detaching Status = "detaching"

    // Detached indicates that the storage is not attached to
    // any machine.
    Detached Status = "detached"
)
const (

    // Available indicates that the model is available for use.
    Available Status = "available"

    // Busy indicates that the model is not available for use because it is
    // running a process that must take the model offline, such as a migration,
    // upgrade, or backup.  This is a spinning state, it is not an error state,
    // and it should be expected that the model will eventually go back to
    // available.
    Busy Status = "busy"
)
const (

    // Joining is used to signify that a relation should become joined soon.
    Joining Status = "joining"

    // Joined is the normal status for a healthy, alive relation.
    Joined Status = "joined"

    // Broken is the status for when a relation life goes to Dead.
    Broken Status = "broken"

    // Suspended is used to signify that a relation will be temporarily broken
    // pending action to resume it.
    Suspending Status = "suspending"

    // Suspended is used to signify that a relation is temporarily broken pending
    // action to resume it.
    Suspended Status = "suspended"
)
const (
    Empty             Status = ""
    Provisioning      Status = "allocating"
    Running           Status = "running"
    ProvisioningError Status = "provisioning error"
)

InstanceStatus

const (
    Applied Status = "applied"
)

ModificationStatus

const (

    // Destroying indicates that the entity is being destroyed.
    //
    // This is valid for volumes, filesystems, and models.
    Destroying Status = "destroying"
)

func (Status) KnownAgentStatus Uses

func (status Status) KnownAgentStatus() bool

KnownAgentStatus returns true if status has a known value for an agent. It includes every status that has ever been valid for a unit or machine agent. This is used by the apiserver client facade to filter out unknown values.

func (Status) KnownInstanceStatus Uses

func (status Status) KnownInstanceStatus() bool

func (Status) KnownModificationStatus Uses

func (status Status) KnownModificationStatus() bool

KnownModificationStatus returns true if the status has a known value for a modification of an instance.

func (Status) KnownWorkloadStatus Uses

func (status Status) KnownWorkloadStatus() bool

KnownWorkloadStatus returns true if status has a known value for a workload. It includes every status that has ever been valid for a unit agent. This is used by the apiserver client facade to filter out unknown values.

func (Status) Matches Uses

func (status Status) Matches(candidate Status) bool

Matches returns true if the candidate matches status, taking into account that the candidate may be a legacy status value which has been deprecated.

func (Status) String Uses

func (s Status) String() string

String returns a string representation of the Status.

func (Status) WorkloadMatches Uses

func (status Status) WorkloadMatches(candidate Status) bool

WorkloadMatches returns true if the candidate matches status, taking into account that the candidate may be a legacy status value which has been deprecated.

type StatusGetter Uses

type StatusGetter interface {
    Status() (StatusInfo, error)
}

StatusGetter represents a type whose status can be read.

type StatusHistoryFilter Uses

type StatusHistoryFilter struct {
    // Size indicates how many results are expected at most.
    Size int
    // FromDate indicates the earliest date from which logs are expected.
    FromDate *time.Time
    // Delta indicates the age of the oldest log expected.
    Delta *time.Duration
    // Exclude indicates the status messages that should be excluded
    // from the returned result.
    Exclude set.Strings
}

StatusHistoryFilter holds arguments that can be use to filter a status history backlog.

func (*StatusHistoryFilter) Validate Uses

func (f *StatusHistoryFilter) Validate() error

Validate checks that the minimum requirements of a StatusHistoryFilter are met.

type StatusHistoryGetter Uses

type StatusHistoryGetter interface {
    StatusHistory(filter StatusHistoryFilter) ([]StatusInfo, error)
}

StatusHistoryGetter instances can fetch their status history.

type StatusInfo Uses

type StatusInfo struct {
    Status  Status
    Message string
    Data    map[string]interface{}
    Since   *time.Time
}

StatusInfo holds a Status and associated information.

type StatusSetter Uses

type StatusSetter interface {
    SetStatus(StatusInfo) error
}

StatusSetter represents a type whose status can be set.

Package status imports 3 packages (graph) and is imported by 248 packages. Updated 2019-06-24. Refresh now. Tools for package owners.