Display instance status
(type)
| 354 | required=True, |
| 355 | ) |
| 356 | def status(type): |
| 357 | """Display instance status""" |
| 358 | cmd = [] |
| 359 | if type == "interactive": |
| 360 | cmd = [ |
| 361 | "docker", |
| 362 | "ps", |
| 363 | "-a", |
| 364 | "--filter", |
| 365 | f"label={INTERACTIVE_DOCKER_CONTAINER_LABEL}", |
| 366 | ] |
| 367 | result = subprocess.run(cmd, capture_output=True, text=True) |
| 368 | if result.returncode == 0: |
| 369 | click.secho("[SUCCESS]\n", fg="green", bold=True) |
| 370 | click.secho(result.stdout, bold=False) |
| 371 | else: |
| 372 | click.secho("[FAILED] ", nl=False, fg="red", bold=True) |
| 373 | click.secho(result.stderr, bold=False) |
| 374 | |
| 375 | |
| 376 | @cli.command() |