Examples

POST /api/provisioning_templates/import
{
  "provisioning_template": {
    "name": "taxonomy override test name",
    "template": "<%#\nkind: PXELinux\nname: taxonomy override test name\nmodel: ProvisioningTemplate\norganizations:\n - org432\nlocations:\n - loc339\n%>\ntest",
    "organization_ids": [
      447626449
    ],
    "location_ids": [
      447626450
    ]
  },
  "options": {
    "associate": "new"
  }
}
201
{
  "id": 1007981788,
  "name": "taxonomy override test name",
  "template": "<%#\nkind: PXELinux\nname: taxonomy override test name\nmodel: ProvisioningTemplate\norganizations:\n - org432\nlocations:\n - loc339\n%>\ntest",
  "snippet": false,
  "template_kind_id": 452984334,
  "created_at": "2019-09-11T14:57:19.599Z",
  "updated_at": "2019-09-11T14:57:19.599Z",
  "locked": false,
  "default": false,
  "vendor": null,
  "os_family": null
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

provisioning_template
required

Validations:

  • Must be a Hash

provisioning_template[name]
optional

template name

Validations:

  • Must be a String

provisioning_template[template]
optional

template contents including metadata

Validations:

  • Must be a String

provisioning_template[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

provisioning_template[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type

options
optional

Validations:

  • Must be a Hash

options[force]
optional , nil allowed

use if you want update locked templates

Validations:

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

options[associate]
optional , nil allowed

determines when the template should associate objects based on metadata, new means only when new template is being created, always means both for new and existing template which is only being updated, never ignores metadata

Validations:

  • Must be one of: new, always, never.

options[lock]
optional , nil allowed

lock imported templates (false by default)

Validations:

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

options[default]
optional , nil allowed

makes the template default meaning it will be automatically associated with newly created organizations and locations (false by default)

Validations:

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