Examples

POST /api/ptables/import
{
  "ptable": {
    "name": "ptable420",
    "template": "b"
  }
}
201
{
  "template": "b",
  "snippet": false,
  "description": null,
  "id": 1007981705,
  "name": "ptable420",
  "template_kind_id": null,
  "created_at": "2024-02-22T16:22:41.539Z",
  "updated_at": "2024-02-22T16:22:41.546Z",
  "locked": false,
  "default": false,
  "vendor": null,
  "os_family": "Redhat",
  "job_category": "Miscellaneous",
  "provider_type": null,
  "description_format": null,
  "execution_timeout_interval": null
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

ptable
required

Validations:

  • Hash

ptable[name]
optional

template name

Validations:

  • String

ptable[template]
optional

template contents including metadata

Validations:

  • String

ptable[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

ptable[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type

options
optional

Validations:

  • 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.