74 lines
1.7 KiB
Python
74 lines
1.7 KiB
Python
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_start = CommandListing(
|
|
command="start",
|
|
description="Starts a given stack",
|
|
)
|
|
|
|
cmd_stop = CommandListing(
|
|
command="stop",
|
|
description="Stops a given stack",
|
|
)
|
|
|
|
cmd_down = CommandListing(
|
|
command="down",
|
|
description="Stop & Downs 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, cmd_start, cmd_stop, cmd_down]
|
|
commands = { k.command: k for k in commandlist }
|