Get build status
Query the image build status of a template. You can create an instance from the template only after the build status becomes ready.
Prerequisites
Configure the endpoint and authentication first. See API overview and authentication.
Endpoint
/templates/{templateCode}/builds/{buildID}/statusQuery the image build status of a template. The route GET /templates/{templateCode}/builds/{buildID} is also supported. buildID comes from the response of the create or update template operation. You can create an instance from the template only after the build status becomes ready.
Path parameters
templateCodestringRequiredUnique template code, that is, the templateID.
buildIDstringRequiredBuild ID, from the response of the create or update template operation.
Response fields
templateIDstringTemplate ID.
buildIDstringBuild ID.
statusstringBuild status. Valid values: building, ready, error. The final status is ready, or error on failure.
logsarray<string>Build logs.
logEntriesarray<object>Structured build log entries.
reasonobjectReason for the build failure; omitted on success. Sub-fields: code (string, failure reason code, for example InvalidArgument), message (string, failure description).
Request example
curl -X GET "$BASE_URL/templates/your-template-id/builds/your-build-id/status" \
-H "Authorization: Bearer $BAILIAN_API_KEY"
BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/sandbox, and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API key.
Response example
If the build fails, the response includes a reason object that explains the failure.
{
"templateID": "your-template-id",
"buildID": "your-build-id",
"status": "ready",
"logs": ["build started", "build finished"],
"logEntries": []
}