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

Examples

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

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

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 and order by a searchable field, e.g. '<field> DESC'

Validations:

  • Must be a String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, 'all' to return all results

Validations:

  • Must match regular expression /\A([1-9]\d*|all)\Z$/.

Search fields

Field name Type Possible values
id integer
input_type string
name string

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

Examples

GET /api/templates/1007981704-report_template75/template_inputs/3
200
{
  "template_id": 1007981704,
  "fact_name": null,
  "variable_name": null,
  "puppet_parameter_name": null,
  "puppet_class_name": null,
  "description": null,
  "required": false,
  "default": null,
  "hidden_value": false,
  "id": 3,
  "name": "Template input 13",
  "input_type": "user",
  "options": null
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

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/1007981702-report_template73/template_inputs
{
  "template_input": {}
}
422
{
  "error": {
    "id": null,
    "errors": {
      "name": [
        "can't be blank"
      ],
      "input_type": [
        "can't be blank",
        "is not included in the list"
      ]
    },
    "full_messages": [
      "Name can't be blank",
      "Input type can't be blank",
      "Input type is not included in the list"
    ]
  }
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

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.

template_input[fact_name]
optional , nil allowed

Fact name, used when input type is Fact value

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[options]
optional , nil allowed

Selectable values for user inputs

Validations:

  • Must be an array of any type

template_input[default]
optional , nil allowed

Default value for user input

Validations:

  • Must be a String

template_input[hidden_value]
optional , nil allowed

The value contains sensitive information and shouldn not be normally visible, useful e.g. for passwords

Validations:

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

template_input[value_type]
optional , nil allowed

Value type, defaults to plain

Validations:

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

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: Architecture, Audit, AuthSource, Bookmark, ComputeProfile, ComputeResource, ConfigReport, Domain, ExternalUsergroup, FactValue, Filter, Host, Hostgroup, HttpProxy, Image, KeyPair, Location, MailNotification, Medium, Model, Operatingsystem, Organization, Parameter, PersonalAccessToken, ProvisioningTemplate, Ptable, Realm, ReportTemplate, Role, Setting, SmartProxy, SshKey, Subnet, User, Usergroup.


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

Examples

DELETE /api/templates/1007981703-report_template74/template_inputs/2
{
  "template_input": {}
}
200
{
  "id": 2,
  "name": "Template input 12",
  "required": false,
  "input_type": "user",
  "fact_name": null,
  "variable_name": null,
  "puppet_class_name": null,
  "puppet_parameter_name": null,
  "description": null,
  "template_id": 1007981703,
  "created_at": "2022-09-06T14:56:28.149Z",
  "updated_at": "2022-09-06T14:56:28.149Z",
  "options": null,
  "advanced": false,
  "value_type": "plain",
  "resource_type": null,
  "default": null,
  "hidden_value": false
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

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/1007981705-report_template76/template_inputs/4
{
  "template_input": {
    "name": ""
  }
}
422
{
  "error": {
    "id": 4,
    "errors": {
      "name": [
        "can't be blank"
      ]
    },
    "full_messages": [
      "Name can't be blank"
    ]
  }
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

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.

template_input[fact_name]
optional , nil allowed

Fact name, used when input type is Fact value

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[options]
optional , nil allowed

Selectable values for user inputs

Validations:

  • Must be an array of any type

template_input[default]
optional , nil allowed

Default value for user input

Validations:

  • Must be a String

template_input[hidden_value]
optional , nil allowed

The value contains sensitive information and shouldn not be normally visible, useful e.g. for passwords

Validations:

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

template_input[value_type]
optional , nil allowed

Value type, defaults to plain

Validations:

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

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: Architecture, Audit, AuthSource, Bookmark, ComputeProfile, ComputeResource, ConfigReport, Domain, ExternalUsergroup, FactValue, Filter, Host, Hostgroup, HttpProxy, Image, KeyPair, Location, MailNotification, Medium, Model, Operatingsystem, Organization, Parameter, PersonalAccessToken, ProvisioningTemplate, Ptable, Realm, ReportTemplate, Role, Setting, SmartProxy, SshKey, Subnet, User, Usergroup.