Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify distinction between maintenance and waiting status #1148

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions ops/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1830,9 +1830,12 @@ class ErrorStatus(StatusBase):

@StatusBase.register
class ActiveStatus(StatusBase):
"""The unit is ready.
"""The unit or application is ready and active.

The unit believes it is correctly offering all the services it has been asked to offer.
Set this status when the charm is correctly offering all the services it
has been asked to offer. If the unit or application is operational but
some feature (like high availability) is in a degraded state, set "active"
with an appropriate message.
"""
name = 'active'

Expand All @@ -1842,32 +1845,36 @@ def __init__(self, message: str = ''):

@StatusBase.register
class BlockedStatus(StatusBase):
"""The unit requires manual intervention.
"""The unit or application requires manual intervention.

An admin has to manually intervene to unblock the unit and let it proceed.
Set this status when an administrator has to manually intervene to unblock
the charm to let it proceed.
"""
name = 'blocked'


@StatusBase.register
class MaintenanceStatus(StatusBase):
"""The unit is performing maintenance tasks.

The unit is not yet providing services, but is actively doing work 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.
"""The unit or application is performing maintenance tasks.

Set this status when the charm is performing an operation such as
``apt install``, or is waiting for something under its control, such as
``pebble-ready`` or an exec operation in the workload container. In
contrast to :class:`WaitingStatus`, "maintenance" reflects activity on
this unit or charm, not on peers or related units.
"""
name = 'maintenance'


@StatusBase.register
class WaitingStatus(StatusBase):
"""A unit is unable to progress.

The unit is unable to progress to an active state because an application with which
it is integrated is not running.
"""The unit or application is waiting on a charm it's integrated with.

Set this status when waiting on a charm this is integrated with. For
example, a web app charm would set "waiting" status when it is integrated
with a database charm that is not ready yet (it might be creating a
database). In contrast to :class:`MaintenanceStatus`, "waiting" reflects
activity on related units, not on this unit or charm.
"""
name = 'waiting'

Expand Down
Loading