示例

POST /api/templates/1007981703-report_template86/template_inputs
{
  "template_input": {
    "name": "is_potato",
    "input_type": "user",
    "options": [
      "true",
      "false"
    ]
  }
}
201
{
  "template_id": 1007981703,
  "fact_name": null,
  "variable_name": null,
  "puppet_parameter_name": null,
  "puppet_class_name": null,
  "description": null,
  "required": false,
  "default": null,
  "id": 2,
  "name": "is_potato",
  "input_type": "user",
  "options": [
    "true",
    "false"
  ]
}

参数

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

template_id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

template_input
必填

Validations:

  • Must be a Hash

template_input[name]
必填

输入名称

Validations:

  • Must be a String

template_input[description]
选填 , 允许空值

输入描述

Validations:

  • Must be a String

template_input[required]
选填 , 允许空值

需要输入

Validations:

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

template_input[advanced]
选填 , 允许空值

输入时高级的

Validations:

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

template_input[input_type]
必填

输入类型

Validations:

  • Must be one of: user, fact, variable, puppet_parameter.

template_input[fact_name]
选填 , 允许空值

Fact 名称,输入类型为 fact 时使用。

Validations:

  • Must be a String

template_input[variable_name]
选填 , 允许空值

变量名称,输入类型为 variable 时使用。

Validations:

  • Must be a String

template_input[puppet_class_name]
选填 , 允许空值

Puppet 类别名称,输入类型为 puppet_parameter 时使用。

Validations:

  • Must be a String

template_input[puppet_parameter_name]
选填 , 允许空值

Puppet 参数名称,输入类型为 puppet_parameter 时使用。

Validations:

  • Must be a String

template_input[options]
选填 , 允许空值

用户输入的可选值

Validations:

  • Must be an array of any type

template_input[default]
选填 , 允许空值

Default value for user input

Validations:

  • Must be a String

template_input[value_type]
选填 , 允许空值

Value type, defaults to plain

Validations:

  • Must be one of: plain, search, date.

template_input[resource_type]
选填 , 允许空值

For values of type search, this is the resource the value searches in

Validations:

  • Must be one of: Architecture, Audit, AuthSource, Bookmark, ComputeProfile, ComputeResource, ConfigGroup, ConfigReport, Domain, Environment, ExternalUsergroup, FactValue, Filter, Host, HostClass, Hostgroup, HttpProxy, Image, KeyPair, Location, MailNotification, Medium, Model, Operatingsystem, Organization, Parameter, PersonalAccessToken, ProvisioningTemplate, Ptable, Puppetclass, PuppetclassLookupKey, Realm, Report, ReportTemplate, Role, Setting, SmartProxy, SshKey, Subnet, Trend, User, Usergroup, VariableLookupKey.