GET /api/templates/:template_id/template_inputs
List template inputs

Examples

GET /api/templates/1007981705/template_inputs
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "template_id": 1007981705,
      "fact_name": null,
      "variable_name": null,
      "puppet_parameter_name": null,
      "puppet_class_name": null,
      "description": null,
      "required": false,
      "id": 4,
      "name": "Template input 9",
      "input_type": "user",
      "options": null
    }
  ]
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

template_id
required

Validations:

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

search
optional

filter results

Validations:

  • Must be a String

order
optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
optional

paginate results

Validations:

  • Must be a String

per_page
optional

number of entries per request

Validations:

  • Must be a String


GET /api/templates/:template_id/template_inputs/:id
Show template input details

Examples

GET /api/templates/1007981708-report_template76/template_inputs/7
200
{
  "template_id": 1007981708,
  "fact_name": null,
  "variable_name": null,
  "puppet_parameter_name": null,
  "puppet_class_name": null,
  "description": null,
  "required": false,
  "id": 7,
  "name": "Template input 12",
  "input_type": "user",
  "options": null
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

template_id
required

Validations:

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

id
required

Validations:

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


POST /api/templates/:template_id/template_inputs
Create a template input

Examples

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

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

template_id
required

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
required

Validations:

  • Must be a Hash

template_input[name]
required

Input name

Validations:

  • Must be a String

template_input[description]
optional , nil allowed

Input description

Validations:

  • Must be a String

template_input[required]
optional , nil allowed

Input is required

Validations:

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

template_input[advanced]
optional , nil allowed

Input is advanced

Validations:

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

template_input[input_type]
required

Input type

Validations:

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

template_input[fact_name]
optional , nil allowed

Fact name, used when input type is fact

Validations:

  • Must be a String

template_input[variable_name]
optional , nil allowed

Variable name, used when input type is variable

Validations:

  • Must be a String

template_input[puppet_class_name]
optional , nil allowed

Puppet class name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[puppet_parameter_name]
optional , nil allowed

Puppet parameter name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[options]
optional , nil allowed

Selectable values for user inputs

Validations:

  • Must be an array of any type

template_input[value_type]
optional , nil allowed

Value type, defaults to plain

Validations:

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

template_input[resource_type]
optional , nil allowed

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

Validations:

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


DELETE /api/templates/:template_id/template_inputs/:id
Delete a template input

Examples

DELETE /api/templates/1007981710-report_template78/template_inputs/9
{
  "template_input": {}
}
200
{
  "id": 9,
  "name": "Template input 14",
  "required": false,
  "input_type": "user",
  "fact_name": null,
  "variable_name": null,
  "puppet_class_name": null,
  "puppet_parameter_name": null,
  "description": null,
  "template_id": 1007981710,
  "created_at": "2019-02-20T13:27:06.847Z",
  "updated_at": "2019-02-20T13:27:06.847Z",
  "options": null,
  "advanced": false
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

template_id
required

Validations:

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

id
required

Validations:

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


PUT /api/templates/:template_id/template_inputs/:id
Update a template input

Examples

PUT /api/templates/1007981707-report_template75/template_inputs/6
{
  "template_input": {
    "name": "blah"
  }
}
200
{
  "id": 6,
  "name": "blah",
  "required": false,
  "input_type": "user",
  "fact_name": null,
  "variable_name": null,
  "puppet_class_name": null,
  "puppet_parameter_name": null,
  "description": null,
  "template_id": 1007981707,
  "created_at": "2019-02-20T13:27:06.771Z",
  "updated_at": "2019-02-20T13:27:06.786Z",
  "options": null,
  "advanced": false
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

template_id
required

Validations:

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

id
required

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
required

Validations:

  • Must be a Hash

template_input[name]
optional

Input name

Validations:

  • Must be a String

template_input[description]
optional , nil allowed

Input description

Validations:

  • Must be a String

template_input[required]
optional , nil allowed

Input is required

Validations:

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

template_input[advanced]
optional , nil allowed

Input is advanced

Validations:

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

template_input[input_type]
optional

Input type

Validations:

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

template_input[fact_name]
optional , nil allowed

Fact name, used when input type is fact

Validations:

  • Must be a String

template_input[variable_name]
optional , nil allowed

Variable name, used when input type is variable

Validations:

  • Must be a String

template_input[puppet_class_name]
optional , nil allowed

Puppet class name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[puppet_parameter_name]
optional , nil allowed

Puppet parameter name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[options]
optional , nil allowed

Selectable values for user inputs

Validations:

  • Must be an array of any type

template_input[value_type]
optional , nil allowed

Value type, defaults to plain

Validations:

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

template_input[resource_type]
optional , nil allowed

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

Validations:

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