GET /api/smart_variables
List all smart variables

GET /api/hosts/:host_id/smart_variables
List of smart variables for a specific host

GET /api/hostgroups/:hostgroup_id/smart_variables
List of smart variables for a specific host group

GET /api/puppetclasses/:puppetclass_id/smart_variables
List of smart variables for a specific Puppet class

Params

Param name Description
host_id
optional

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, ‘‘, ‘-’ with no leading or trailing space..

hostgroup_id
optional

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, ‘‘, ‘-’ with no leading or trailing space..

puppetclass_id
optional

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, ‘‘, ‘-’ with no leading or trailing space..

show_hidden
optional

Display hidden values

Validations:

  • boolean

search
optional

filter results

Validations:

  • String

order
optional

sort results

Validations:

  • String

page
optional

paginate results

Validations:

  • String

per_page
optional

number of entries per request

Validations:

  • String


GET /api/smart_variables/:id
Show a smart variable

Params

Param name Description
id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, ‘‘, ‘-’ with no leading or trailing space..

show_hidden
optional

Display hidden values

Validations:

  • boolean


POST /api/smart_variables
Create a smart variable

Params

Param name Description
smart_variable
required

Validations:

  • Hash

smart_variable[variable]
required

Name of variable

Validations:

  • String

smart_variable[puppetclass_id]
optional , nil allowed

Puppet class ID

Validations:

  • number.

smart_variable[default_value]
optional , nil allowed

Default value of variable

Validations:

  • String

smart_variable[hidden_value]
optional , nil allowed

When enabled the parameter is hidden in the UI

Validations:

  • boolean

smart_variable[override_value_order]
optional , nil allowed

The order in which values are resolved

Validations:

  • String

smart_variable[description]
optional , nil allowed

Description of variable

Validations:

  • String

smart_variable[validator_type]
optional , nil allowed

Types of validation values

Validations:

  • Must be one of: regexp, list.

smart_variable[validator_rule]
optional , nil allowed

Used to enforce certain values for the parameter values

Validations:

  • String

smart_variable[variable_type]
optional , nil allowed

Types of variable values

Validations:

  • Must be one of: string, boolean, integer, real, array, hash, yaml, json.

smart_variable[merge_overrides]
optional , nil allowed

Merge all matching values (only array/hash type)

Validations:

  • boolean

smart_variable[merge_default]
optional , nil allowed

Include default value when merging all matching values

Validations:

  • boolean

smart_variable[avoid_duplicates]
optional , nil allowed

Remove duplicate values (only array type)

Validations:

  • boolean


PUT /api/smart_variables/:id
Update a smart variable

Params

Param name Description
id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, ‘‘, ‘-’ with no leading or trailing space..

smart_variable
required

Validations:

  • Hash

smart_variable[variable]
optional

Name of variable

Validations:

  • String

smart_variable[puppetclass_id]
optional , nil allowed

Puppet class ID

Validations:

  • number.

smart_variable[default_value]
optional , nil allowed

Default value of variable

Validations:

  • String

smart_variable[hidden_value]
optional , nil allowed

When enabled the parameter is hidden in the UI

Validations:

  • boolean

smart_variable[override_value_order]
optional , nil allowed

The order in which values are resolved

Validations:

  • String

smart_variable[description]
optional , nil allowed

Description of variable

Validations:

  • String

smart_variable[validator_type]
optional , nil allowed

Types of validation values

Validations:

  • Must be one of: regexp, list.

smart_variable[validator_rule]
optional , nil allowed

Used to enforce certain values for the parameter values

Validations:

  • String

smart_variable[variable_type]
optional , nil allowed

Types of variable values

Validations:

  • Must be one of: string, boolean, integer, real, array, hash, yaml, json.

smart_variable[merge_overrides]
optional , nil allowed

Merge all matching values (only array/hash type)

Validations:

  • boolean

smart_variable[merge_default]
optional , nil allowed

Include default value when merging all matching values

Validations:

  • boolean

smart_variable[avoid_duplicates]
optional , nil allowed

Remove duplicate values (only array type)

Validations:

  • boolean


DELETE /api/smart_variables/:id
Delete a smart variable

Params

Param name Description
id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, ‘‘, ‘-’ with no leading or trailing space..