Skip to main content
Bare Metal Management/Bare Metal Template Related Interfaces
POSTBare Metal Template Related InterfacesSince 3.4.0SynchronousAuth Required

Add Preconfiguration Template

Add Preconfiguration Template

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • nameStringRequired

    Resource name

  • descriptionString

    Detailed description of the resource

  • distributionStringRequired

    Applicable operating system distribution

  • typeStringRequired

    Template type

  • contentStringRequired

    Template content

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • errorErrorCodeRequired

    Error code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error

    • codeStringRequired

      Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001

    • descriptionStringRequired

      Brief description of the error

    • detailsStringRequired

      Detailed error information

    • elaborationStringRequired

      Reserved field, default is null

    • opaqueLinkedHashMapRequired

      Reserved field, default is null

    • causeErrorCodeRequired

      Root cause: the source error that triggered the current error. If there is no original error, this field is null

  • inventoryPreconfigurationTemplateInventoryRequired

    For details, see inventory

    • uuidStringRequired

      UUID of the resource, uniquely identifying the resource

    • nameStringRequired

      Resource name

    • descriptionStringRequired

      Detailed description of the resource

    • distributionStringRequired

      Applicable operating system distribution

    • typeStringRequired

      Template type

    • contentStringRequired

      Template content

    • md5sumStringRequired

      Template MD5

    • isPredefinedBooleanRequired

      Whether it is system predefined

    • stateStringRequired

      State

    • createDateTimestampRequired

      Create time

    • lastOpDateTimestampRequired

      Last modification time

Endpoint

POST/zstack/v1/baremetal/preconfigurations

/zstack/v1/baremetal/preconfigurations

Operation ID

AddPreconfigurationTemplate

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/baremetal/preconfigurations' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"name":"<name>","description":"<description>","distribution":"<distribution>","type":"<type>","content":"<content>","resourceUuid":"<resourceUuid>","systemTags":["<systemTags>"],"userTags":["<userTags>"],"tagUuids":["<tagUuids>"]}'

Response Example

200
{ "inventory": { "uuid": "8d837ba978a4462eada4cd80f395617f", "name": "centos_7_x86_64_mini_v1.cfg", "description": "centos-7-minimal kickstart file", "distribution": "centos-7-x86_64", "type": "kickstart", "content": "...", "md5sum": "4448ac513c464e86aeb7eb75417c9345", "isPredefined": false, "state": "Enabled", "createDate": "Aug 15, 2025 5:35:30 AM", "lastOpDate": "Aug 15, 2025 5:35:30 AM" } }

Change History

This API has no change history records yet.

View all change history