Przykłady

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"
  ]
}

Parametry

Nazwa parametru Opis
location_id
opcjonalny

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcjonalny

Set the current organization context for the request

Validations:

  • Must be a Integer

template_id
wymagany

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
wymagany

Validations:

  • Must be a Hash

template_input[name]
wymagany

Input name

Validations:

  • Must be a String

template_input[description]
opcjonalny , nil dopuszczalny

Input description

Validations:

  • Must be a String

template_input[required]
opcjonalny , nil dopuszczalny

Input is required

Validations:

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

template_input[advanced]
opcjonalny , nil dopuszczalny

Input is advanced

Validations:

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

template_input[input_type]
wymagany

Input type

Validations:

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

template_input[fact_name]
opcjonalny , nil dopuszczalny

Fact name, used when input type is fact

Validations:

  • Must be a String

template_input[variable_name]
opcjonalny , nil dopuszczalny

Variable name, used when input type is variable

Validations:

  • Must be a String

template_input[puppet_class_name]
opcjonalny , nil dopuszczalny

Puppet class name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[puppet_parameter_name]
opcjonalny , nil dopuszczalny

Puppet parameter name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[options]
opcjonalny , nil dopuszczalny

Selectable values for user inputs

Validations:

  • Must be an array of any type

template_input[default]
opcjonalny , nil dopuszczalny

Default value for user input

Validations:

  • Must be a String

template_input[value_type]
opcjonalny , nil dopuszczalny

Value type, defaults to plain

Validations:

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

template_input[resource_type]
opcjonalny , nil dopuszczalny

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.