Skip to main content
On this page

Inventory templates

An inventory template declares typed input variables and ordered steps. Each step creates an object — for example, a tenant, site, device, VM, or IP address — and can reference objects created by earlier steps.

Where they live

Open Inventory → Templates. The list shows each template's name, slug, shape (variable and step counts), status, and last update; row actions are Run, Edit, Duplicate, and Delete. Below the list, Recent runs tracks executions across all templates.

StatusMeaning
draftBeing authored; duplicates are always created as drafts
activeReady to run
archivedKept for reference

Variables

Variables are the template's typed inputs, filled in at run time:

Value typeNotes
string / integer / number / booleanScalar inputs
jsonArbitrary JSON value
resource_refReference to an existing inventory object

Each variable has a key, label, required flag, optional default and validation rules.

Steps

Each step creates one inventory object. Supported step resource types:

tenant, tenant_group, region, site_group, site, location, rack, rack_role, rack_type, manufacturer, device_role, device_type, platform, device, device_interface, cluster, cluster_type, cluster_group, virtual_machine, vm_interface, ip_address.

A step's payload is a field/value map whose values may use placeholders:

{
  "name": "{{device_name}}",
  "status": "active",
  "site_id": "{{steps.site.id}}",
  "role_id": "{{device_role_id}}",
  "device_type_id": "{{device_type_id}}"
}
  • {{variable_key}} — substituted from the run-time variable values.
  • {{steps.<step_key>.id}} — the ID of an object created by an earlier step in the same run, so a device can land in the site the run just created.

Steps declare explicit dependencies (depends_on_step_keys) and a per-step conflict policy for when a matching object already exists:

PolicyBehaviour
failStop the step with an error
skipLeave the existing object untouched
update_selected_fieldsUpdate the existing object's templated fields

The editor

Create Template opens a full-page editor with three sections — Details, Variables, Steps — validated live as you type: duplicate variable or step keys, missing required payload fields, and unknown or self-referencing dependencies are flagged per section. A sticky preview rail shows the resolved payloads (using default values) for every step.

Running a template

Run opens a two-stage dialog: fill in the variables, review the preview of objects to be created, then start the run. Each run records per-step results — status (success, failed, skipped), duration, created resource IDs, and error messages — expandable under Recent runs. Run statuses: pending, running, completed, completed_with_errors, failed.

Edit created objects in the inventory. Add a connection configuration to connect to devices and VMs, and assign access policies.

REST API

MethodPathPurpose
GET / POST/api/v1/inventory/templatesList / create templates
GET / PUT / DELETE/api/v1/inventory/templates/{id}Read / update / delete
POST/api/v1/inventory/templates/{id}/preview-runServer-side dry run
POST/api/v1/inventory/templates/{id}/runsStart a run
GET/api/v1/inventory/templates/{id}/runsList runs of a template
GET/api/v1/inventory/template-runs/{id}/stepsPer-step results of a run

See the API reference for the full contract.