toolforge-components-cli 0.0.11__tar.gz → 0.0.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {toolforge_components_cli-0.0.11 → toolforge_components_cli-0.0.12}/PKG-INFO +1 -1
- {toolforge_components_cli-0.0.11 → toolforge_components_cli-0.0.12}/pyproject.toml +1 -1
- {toolforge_components_cli-0.0.11 → toolforge_components_cli-0.0.12}/toolforge_components_cli/cli.py +21 -1
- {toolforge_components_cli-0.0.11 → toolforge_components_cli-0.0.12}/LICENSE +0 -0
- {toolforge_components_cli-0.0.11 → toolforge_components_cli-0.0.12}/README.md +0 -0
- {toolforge_components_cli-0.0.11 → toolforge_components_cli-0.0.12}/toolforge_components_cli/__init__.py +0 -0
- {toolforge_components_cli-0.0.11 → toolforge_components_cli-0.0.12}/toolforge_components_cli/components.py +0 -0
- {toolforge_components_cli-0.0.11 → toolforge_components_cli-0.0.12}/toolforge_components_cli/config.py +0 -0
{toolforge_components_cli-0.0.11 → toolforge_components_cli-0.0.12}/toolforge_components_cli/cli.py
RENAMED
|
@@ -467,7 +467,7 @@ def _format_status(status: str) -> str:
|
|
|
467
467
|
fg_color = "yellow"
|
|
468
468
|
elif status == "failed":
|
|
469
469
|
fg_color = "red"
|
|
470
|
-
elif status
|
|
470
|
+
elif status in ("successful", "cancelled"):
|
|
471
471
|
fg_color = "green"
|
|
472
472
|
|
|
473
473
|
return click.style(status, fg=fg_color)
|
|
@@ -564,6 +564,26 @@ def deployment_delete(
|
|
|
564
564
|
_display_deployment(response.get("data", {}), as_json, prefix="Deleted deployment:")
|
|
565
565
|
|
|
566
566
|
|
|
567
|
+
@deployment.command(name="cancel", help="Cancel a running deployment.")
|
|
568
|
+
@click.option(
|
|
569
|
+
"--json",
|
|
570
|
+
"as_json",
|
|
571
|
+
is_flag=True,
|
|
572
|
+
help="If set, will output in JSON format",
|
|
573
|
+
)
|
|
574
|
+
@click.argument("deployment_id", required=False, default="latest")
|
|
575
|
+
@click.pass_context
|
|
576
|
+
def deployment_cancel(ctx, deployment_id: str, as_json: bool) -> None:
|
|
577
|
+
components_client = ctx.obj["components_client"]
|
|
578
|
+
display_messages = not as_json
|
|
579
|
+
|
|
580
|
+
response = components_client.put(
|
|
581
|
+
f"/deployment/{deployment_id}/cancel", display_messages=display_messages
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
_display_deployment(deployment_data=response["data"], as_json=as_json)
|
|
585
|
+
|
|
586
|
+
|
|
567
587
|
def main() -> int:
|
|
568
588
|
debug = False
|
|
569
589
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|