parent
44ee9c7cad
commit
0c884e01cf
14 changed files with 302 additions and 58 deletions
dockge_cli/models
2
dockge_cli/models/__init__.py
Normal file
2
dockge_cli/models/__init__.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
from .commands import commands
|
||||
from .codes import StackStatus
|
7
dockge_cli/models/codes.py
Normal file
7
dockge_cli/models/codes.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
from enum import Enum
|
||||
|
||||
class StackStatus(Enum):
|
||||
# pylint: disable=invalid-name
|
||||
inactive = 1
|
||||
running = 3
|
||||
exited = 4
|
58
dockge_cli/models/commands.py
Normal file
58
dockge_cli/models/commands.py
Normal 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 }
|
Loading…
Add table
Add a link
Reference in a new issue