Query Preconfiguration Template

GET/zstack/v1/baremetal/preconfigurations
GET/zstack/v1/baremetal/preconfigurations/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/preconfigurations?q=uuid=6b34fcf11d6732ba851203bc602b46b7
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/preconfigurations/ed428c815ff43f1ebc97483767b1a6e4

Queryable Fields

Run the CLI command tool, enter QueryPreconfigurationTemplate and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "7242ff1b38c94a00b888c1033ca6223a",
      "name": "centos_7_x86_64_mini_v1.cfg",
      "description": "centos-7-minimal kickstart file",
      "distribution": "centos-7-x86_64",
      "type": "kickstart",
      "content": "...",
      "md5sum": "f01edfbe076f4e24bd346fab494e5de0",
      "isPredefined": false,
      "state": "Enabled",
      "createDate": "Aug 15, 2025 5:38:34 AM",
      "lastOpDate": "Aug 15, 2025 5:38:34 AM"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error3.4.0
inventoriesListFor details, see inventories3.4.0

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, default is null0.6
opaqueLinkedHashMapReserved field, default is null0.6
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null0.6

inventories

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource3.4.0
nameStringResource name3.4.0
descriptionStringDetailed description of the resource3.4.0
distributionStringApplicable operating system distribution3.4.0
typeStringTemplate type3.4.0
contentStringTemplate content3.4.0
md5sumStringTemplate MD53.4.0
isPredefinedBooleanWhether it is system predefined3.4.0
stateStringState3.4.0
createDateTimestampCreate time3.4.0
lastOpDateTimestampLast modification time3.4.0

SDK Examples

Java SDK

QueryPreconfigurationTemplateAction action = new QueryPreconfigurationTemplateAction();
action.conditions = asList("uuid=c3cd8741c2fb3ba88f0493ec77b8fad6");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryPreconfigurationTemplateAction.Result res = action.call();

Python SDK

action = QueryPreconfigurationTemplateAction()
action.conditions = ["uuid=deb4635e9984326b818d0433dfd78576"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()