First implementation

This commit is contained in:
Firq 2024-07-02 18:09:56 +02:00
parent 44ee9c7cad
commit 0c884e01cf
Signed by: Firq
GPG key ID: 3ACC61C8CEC83C20
14 changed files with 302 additions and 58 deletions

View file

@ -0,0 +1,2 @@
from .commands import commands
from .codes import StackStatus

View file

@ -0,0 +1,7 @@
from enum import Enum
class StackStatus(Enum):
# pylint: disable=invalid-name
inactive = 1
running = 3
exited = 4

View file

@ -0,0 +1,58 @@
from pydantic import BaseModel
class CommandListing(BaseModel):
command: str
description: str
cmd_host = CommandListing(
command="host",
description="Sets and gets the URI of the dockge instance. Remove any unnecessary subdomains/protocols from the URI"
)
cmd_login = CommandListing(
command="login",
description="Logs into a given dockge account, either with an interactive dialogue or by passing --user and --password",
)
cmd_logout = CommandListing(
command="logout",
description="Removes the credentials from the local storage.",
)
cmd_list = CommandListing(
command="list",
description="Lists all available stacks with their status",
)
cmd_status = CommandListing(
command="status",
description="Returns the status of one stack",
)
cmd_restart = CommandListing(
command="restart",
description="Restarts a given stack",
)
cmd_update = CommandListing(
command="update",
description="Updates a stack",
)
cmd_exit = CommandListing(
command="exit",
description="Exits the CLI - this will reset all settings, including credentials and host",
)
cmd_debug = CommandListing(
command="debug",
description="debug",
)
cmd_help = CommandListing(
command="help",
description="Displays helping hints for commands",
)
commandlist = [cmd_host, cmd_login, cmd_logout, cmd_list, cmd_restart, cmd_update, cmd_exit, cmd_debug, cmd_help, cmd_status]
commands = { k.command: k for k in commandlist }