示例

POST /api/provisioning_templates
{
  "provisioning_template": {
    "template": "This is a test template",
    "template_kind_id": 131565194,
    "name": "new_template"
  }
}
201
{
  "template": "This is a test template",
  "locked": false,
  "snippet": false,
  "description": null,
  "audit_comment": null,
  "created_at": "2019-11-07 08:44:13 UTC",
  "updated_at": "2019-11-07 08:44:13 UTC",
  "id": 1007981703,
  "name": "new_template",
  "template_kind_id": 131565194,
  "template_kind_name": "PXEGrub",
  "template_combinations": [],
  "operatingsystems": [],
  "os_default_templates": [],
  "locations": [],
  "organizations": []
}

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

provisioning_template
必填

Validations:

  • Must be a Hash

provisioning_template[name]
必填

模板名称

Validations:

  • Must be a String

provisioning_template[description]
选填 , 允许空值

Validations:

  • Must be a String

provisioning_template[template]
必填

Validations:

  • Must be a String

provisioning_template[snippet]
选填 , 允许空值

Validations:

  • Must be one of: true, false, 1, 0.

provisioning_template[audit_comment]
选填 , 允许空值

Validations:

  • Must be a String

provisioning_template[template_kind_id]
选填 , 允许空值

与片段无关

Validations:

  • Must be a number.

provisioning_template[template_combinations_attributes]
选填 , 允许空值

模板组合阵列(hostgroup_id, environment_id)

Validations:

  • Must be an array of any type

provisioning_template[operatingsystem_ids]
选填 , 允许空值

与该模板关联的操作系统 ID 阵列

Validations:

  • Must be an array of any type

provisioning_template[locked]
选填 , 允许空值

是否已锁定该模板进行编辑

Validations:

  • Must be one of: true, false, 1, 0.

provisioning_template[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

provisioning_template[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type