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
location_id
Optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
Optional

Scope by organizations

Validations:

  • Must be a Integer

host_id
Optional

Validations:

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

hostgroup_id
Optional

Validations:

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

puppetclass_id
Optional

Validations:

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

show_hidden
Optional

Display hidden values

Validations:

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

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

paginate results

Validations:

  • Must be a String

per_page
Optional

antal poster per begäran

Validations:

  • Must be a String

Search fields

Field name Typ Possible values
avoid_duplicates true, false
key string
merge_default true, false
merge_overrides true, false
override true, false
parameter string
puppetclass string

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

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

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.

show_hidden
Optional

Display hidden values

Validations:

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


POST /api/smart_variables
Create a smart variable

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

smart_variable
Required

Validations:

  • Must be a Hash

smart_variable[variable]
Required

Name of variable

Validations:

  • Must be a String

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

Puppet class ID

Validations:

  • Must be a number.

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

Default value of variable

Validations:

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

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

When enabled the parameter is hidden in the UI

Validations:

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

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

I vilken ordning värden slås upp

Validations:

  • Must be a String

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

Description of variable

Validations:

  • Must be a String

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

Types of validation values

Validations:

  • Must be one of: regexp, list.

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

Used to enforce certain values for the parameter values

Validations:

  • Must be a String

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

Types of variable values

Validations:

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

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

Merge all matching values (only array/hash type)

Validations:

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

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

Include default value when merging all matching values

Validations:

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

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

Remove duplicate values (only array type)

Validations:

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


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

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

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.

smart_variable
Required

Validations:

  • Must be a Hash

smart_variable[variable]
Optional

Name of variable

Validations:

  • Must be a String

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

Puppet class ID

Validations:

  • Must be a number.

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

Default value of variable

Validations:

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

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

When enabled the parameter is hidden in the UI

Validations:

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

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

I vilken ordning värden slås upp

Validations:

  • Must be a String

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

Description of variable

Validations:

  • Must be a String

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

Types of validation values

Validations:

  • Must be one of: regexp, list.

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

Used to enforce certain values for the parameter values

Validations:

  • Must be a String

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

Types of variable values

Validations:

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

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

Merge all matching values (only array/hash type)

Validations:

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

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

Include default value when merging all matching values

Validations:

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

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

Remove duplicate values (only array type)

Validations:

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


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

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

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.