示例

POST /api/ptables/import
{
  "ptable": {
    "name": "ptable212",
    "template": "b"
  }
}
201
{
  "template": "b",
  "name": "ptable212",
  "id": 1007981800,
  "snippet": false,
  "template_kind_id": null,
  "created_at": "2019-09-11T14:34:42.858Z",
  "updated_at": "2019-09-11T14:34:42.873Z",
  "locked": false,
  "default": false,
  "vendor": null,
  "os_family": "Redhat"
}

參數

參數名字 描述
location_id
選填

位置範圍

Validations:

  • Must be a Integer

organization_id
選填

組織範圍

Validations:

  • Must be a Integer

ptable
必填

Validations:

  • Must be a Hash

ptable[name]
選填

範本名稱

Validations:

  • Must be a String

ptable[template]
選填

template contents including metadata

Validations:

  • Must be a String

ptable[location_ids]
選填 , 允許空值

將位置取代為特定 ID

Validations:

  • Must be an array of any type

ptable[organization_ids]
選填 , 允許空值

將組織取代為特定 ID。

Validations:

  • Must be an array of any type

options
選填

Validations:

  • Must be a Hash

options[force]
選填 , 允許空值

use if you want update locked templates

Validations:

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

options[associate]
選填 , 允許空值

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]
選填 , 允許空值

lock imported templates (false by default)

Validations:

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

options[default]
選填 , 允許空值

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.