示例

POST /api/ptables/import
{
  "ptable": {
    "name": "ptable824",
    "template": "b"
  }
}
201
{
  "template": "b",
  "name": "ptable824",
  "id": 1007981749,
  "snippet": false,
  "description": null,
  "template_kind_id": null,
  "created_at": "2019-11-07T09:07:18.340Z",
  "updated_at": "2019-11-07T09:07:18.356Z",
  "locked": false,
  "default": false,
  "vendor": null,
  "os_family": "Redhat"
}

参数

参数名字 描述
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

ptable
必填

Validations:

  • Must be a Hash

ptable[name]
选填

模板名称

Validations:

  • Must be a String

ptable[template]
选填

包括元数据的模板内容

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]
选填 , 允许空值

在您希望更新锁定的模板时使用

Validations:

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

options[associate]
选填 , 允许空值

确定模板何时应基于元数据关联对象,new 表示只在创建新模板时,always 表示同时适用于新模板和的只进行更新的现有模板,never 表示忽略元数据

Validations:

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

options[lock]
选填 , 允许空值

锁定导入的模板(默认为 false)

Validations:

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

options[default]
选填 , 允许空值

把模块设为默认意味着它将自动与新创建的组织和位置相关联(默认为 false)

Validations:

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