Get build status

Updated at:

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

GET/templates/{templateCode}/builds/{buildID}/status

Query 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

templateCodestringRequired

Unique template code, that is, the templateID.

buildIDstringRequired

Build ID, from the response of the create or update template operation.

Response fields

templateIDstring

Template ID.

buildIDstring

Build ID.

statusstring

Build 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.

reasonobject

Reason 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": []
}