2021-10-28 14:53:40 +00:00
|
|
|
from typing import Tuple
|
|
|
|
|
2021-10-21 02:02:38 +00:00
|
|
|
import click
|
|
|
|
|
2021-10-28 13:53:32 +00:00
|
|
|
from ..instance import Instance, pass_instance
|
|
|
|
from ..misc import service_command
|
2021-10-21 02:02:38 +00:00
|
|
|
|
|
|
|
|
2021-10-22 15:52:46 +00:00
|
|
|
@click.command(
|
|
|
|
"list",
|
|
|
|
short_help="Inspect a kiwi-scp instance",
|
|
|
|
)
|
2021-10-28 13:53:32 +00:00
|
|
|
@pass_instance
|
2021-10-21 02:02:38 +00:00
|
|
|
@service_command
|
2021-10-28 14:53:40 +00:00
|
|
|
def cmd(ctx: Instance, project: str, services: Tuple[str]):
|
2021-10-22 15:52:46 +00:00
|
|
|
"""List projects in this instance, services inside a project or service(s) inside a project"""
|
2021-10-28 13:53:32 +00:00
|
|
|
if project is not None:
|
2021-10-28 14:53:40 +00:00
|
|
|
print(ctx.get_services(project, services))
|
2021-10-28 13:53:32 +00:00
|
|
|
else:
|
|
|
|
print(f"projects: {ctx.config.projects}")
|