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

參數

參數名字 描述
host_id
選填

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
選填

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
選填

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
選填

篩選結果

Validations:

  • Must be String

order
選填

排序結果

Validations:

  • Must be String

page
選填

編頁結果

Validations:

  • Must be String

per_page
選填

每個請求的項目數量

Validations:

  • Must be String


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

參數

參數名字 描述
id
必填

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/smart_variables
Create a smart variable

參數

參數名字 描述
smart_variable
必填

Validations:

  • Must be a Hash

smart_variable[variable]
必填

Name of variable

Validations:

  • Must be String

smart_variable[puppetclass_id]
選填 , 允許空值

Puppet class ID

Validations:

  • Must be a number.

smart_variable[default_value]
選填 , 允許空值

Default value of variable

Validations:

  • Must be String

smart_variable[hidden_value]
選填 , 允許空值

When enabled the parameter is hidden in the UI

Validations:

  • Must be 'true' or 'false' or '1' or '0'

smart_variable[override_value_order]
選填 , 允許空值

值解析的順序

Validations:

  • Must be String

smart_variable[description]
選填 , 允許空值

Description of variable

Validations:

  • Must be String

smart_variable[validator_type]
選填 , 允許空值

Types of validation values

Validations:

  • Must be one of: regexp, list.

smart_variable[validator_rule]
選填 , 允許空值

Used to enforce certain values for the parameter values

Validations:

  • Must be String

smart_variable[variable_type]
選填 , 允許空值

Types of variable values

Validations:

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

smart_variable[merge_overrides]
選填 , 允許空值

Merge all matching values (only array/hash type)

Validations:

  • Must be 'true' or 'false' or '1' or '0'

smart_variable[merge_default]
選填 , 允許空值

Include default value when merging all matching values

Validations:

  • Must be 'true' or 'false' or '1' or '0'

smart_variable[avoid_duplicates]
選填 , 允許空值

Remove duplicate values (only array type)

Validations:

  • Must be 'true' or 'false' or '1' or '0'


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

參數

參數名字 描述
id
必填

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
必填

Validations:

  • Must be a Hash

smart_variable[variable]
選填

Name of variable

Validations:

  • Must be String

smart_variable[puppetclass_id]
選填 , 允許空值

Puppet class ID

Validations:

  • Must be a number.

smart_variable[default_value]
選填 , 允許空值

Default value of variable

Validations:

  • Must be String

smart_variable[hidden_value]
選填 , 允許空值

When enabled the parameter is hidden in the UI

Validations:

  • Must be 'true' or 'false' or '1' or '0'

smart_variable[override_value_order]
選填 , 允許空值

值解析的順序

Validations:

  • Must be String

smart_variable[description]
選填 , 允許空值

Description of variable

Validations:

  • Must be String

smart_variable[validator_type]
選填 , 允許空值

Types of validation values

Validations:

  • Must be one of: regexp, list.

smart_variable[validator_rule]
選填 , 允許空值

Used to enforce certain values for the parameter values

Validations:

  • Must be String

smart_variable[variable_type]
選填 , 允許空值

Types of variable values

Validations:

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

smart_variable[merge_overrides]
選填 , 允許空值

Merge all matching values (only array/hash type)

Validations:

  • Must be 'true' or 'false' or '1' or '0'

smart_variable[merge_default]
選填 , 允許空值

Include default value when merging all matching values

Validations:

  • Must be 'true' or 'false' or '1' or '0'

smart_variable[avoid_duplicates]
選填 , 允許空值

Remove duplicate values (only array type)

Validations:

  • Must be 'true' or 'false' or '1' or '0'


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

參數

參數名字 描述
id
必填

Validations:

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