From 2cd4509fc0b57b32ff53e17fd31a538432230e59 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 8 Oct 2026 22:11:46 +0200 Subject: [PATCH] Say that a failed template builds again on a repeated post --- src/drukbox_sdk/api.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/drukbox_sdk/api.py b/src/drukbox_sdk/api.py index 380b088..6b77a49 100644 --- a/src/drukbox_sdk/api.py +++ b/src/drukbox_sdk/api.py @@ -435,14 +435,15 @@ async def create_template( base_image: str | None = None, label: str | None = None, ) -> SandboxTemplate: - """Start a template build and return immediately. - - The service responds 202 with ``status="building"``. Poll - :meth:`get_template` until the status becomes ``"available"`` or - ``"failed"``. A failed record carries the reason in - ``last_error``. A repeated post with the same provider, base - image, and setup script returns the existing record without a - rebuild. + """Start a template build. + + The service pulls the base image, then responds 202 with + ``status="building"``. Poll :meth:`get_template` until the status + becomes ``"available"`` or ``"failed"``. A failed record carries the + reason in ``last_error``. A repeated post with the same provider, + base image digest, and setup script returns the existing record. A + ``"failed"`` record builds again and keeps its ``last_error`` until + that build ends. """ payload: dict[str, Any] = {"setup_script": setup_script}