Skip to content
Draft
Show file tree
Hide file tree
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
516 changes: 516 additions & 0 deletions sunbeam-python/sunbeam/commands/backup_restore.py

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions sunbeam-python/sunbeam/core/juju.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,24 @@ def run_action(
raise ActionFailedException(str(task))
return task.results

def get_application_actions(self, application: str, model: str) -> list[str]:
"""Return action names available for an application in a model."""
with self._model(model) as juju:
try:
response = self.cli(
"actions",
application,
include_controller=False,
juju=juju,
)
except jubilant.CLIError as e:
raise JujuException(str(e)) from e

actions = response.get(application)
if not isinstance(actions, dict):
return []
return sorted(actions.keys())

def add_secret(self, model: str, name: str, data: dict, info: str) -> str:
"""Add secret to the model.

Expand Down
4 changes: 4 additions & 0 deletions sunbeam-python/sunbeam/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from snaphelpers import Snap

from sunbeam import log
from sunbeam.commands import backup_restore as backup_restore_cmds
from sunbeam.commands import configure as configure_cmds
from sunbeam.commands import dashboard as dashboard_cmds
from sunbeam.commands import generate_cloud_config as generate_cloud_config_cmds
Expand Down Expand Up @@ -123,6 +124,9 @@ def main():
cli.add_command(launch_cmds.launch)
cli.add_command(openrc_cmds.openrc)
cli.add_command(dashboard_cmds.dashboard)
cli.add_command(backup_restore_cmds.backup)
cli.add_command(backup_restore_cmds.list_backups)
cli.add_command(backup_restore_cmds.restore)

# Add identity group
cli.add_command(identity_group)
Expand Down
Loading
Loading