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,
      "default": null,
      "id": 4,
      "name": "Template input 20",
      "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

filtrera resultat

Validations:

  • Must be a String

order
Optional

Sort field and order, eg. ‘id 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

Validations:

  • Must be a number.


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

Examples

GET /api/templates/1007981709-report_template92/template_inputs/8
200
{
  "template_id": 1007981709,
  "fact_name": null,
  "variable_name": null,
  "puppet_parameter_name": null,
  "puppet_class_name": null,
  "description": null,
  "required": false,
  "default": null,
  "id": 8,
  "name": "Template input 24",
  "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/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"
  ]
}

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 , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Input description

Validations:

  • Must be a String

template_input[required]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Input is required

Validations:

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

template_input[advanced]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

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 , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Fact name, used when input type is fact

Validations:

  • Must be a String

template_input[variable_name]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Variable name, used when input type is variable

Validations:

  • Must be a String

template_input[puppet_class_name]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Puppet class name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[puppet_parameter_name]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Puppet parameter name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[options]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Selectable values for user inputs

Validations:

  • Must be an array of any type

template_input[default]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Default value for user input

Validations:

  • Must be a String

template_input[value_type]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Value type, defaults to plain

Validations:

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

template_input[resource_type]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

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.


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

Examples

DELETE /api/templates/1007981704-report_template87/template_inputs/3
{
  "template_input": {}
}
200
{
  "id": 3,
  "name": "Template input 19",
  "required": false,
  "input_type": "user",
  "fact_name": null,
  "variable_name": null,
  "puppet_class_name": null,
  "puppet_parameter_name": null,
  "description": null,
  "template_id": 1007981704,
  "created_at": "2019-11-07T08:54:31.997Z",
  "updated_at": "2019-11-07T08:54:31.997Z",
  "options": null,
  "advanced": false,
  "value_type": "plain",
  "resource_type": null,
  "default": 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.


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

Examples

PUT /api/templates/1007981707-report_template90/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-11-07T08:54:32.081Z",
  "updated_at": "2019-11-07T08:54:32.096Z",
  "options": null,
  "advanced": false,
  "value_type": "plain",
  "resource_type": null,
  "default": 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.

template_input
Required

Validations:

  • Must be a Hash

template_input[name]
Optional

Input name

Validations:

  • Must be a String

template_input[description]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Input description

Validations:

  • Must be a String

template_input[required]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Input is required

Validations:

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

template_input[advanced]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

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 , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Fact name, used when input type is fact

Validations:

  • Must be a String

template_input[variable_name]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Variable name, used when input type is variable

Validations:

  • Must be a String

template_input[puppet_class_name]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Puppet class name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[puppet_parameter_name]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Puppet parameter name, used when input type is puppet_parameter

Validations:

  • Must be a String

template_input[options]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Selectable values for user inputs

Validations:

  • Must be an array of any type

template_input[default]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Default value for user input

Validations:

  • Must be a String

template_input[value_type]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Value type, defaults to plain

Validations:

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

template_input[resource_type]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

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.