GET /api/smart_variables
列出所有智慧型變數

GET /api/hosts/:host_id/smart_variables
特定主機的智慧型變數之清單

GET /api/hostgroups/:hostgroup_id/smart_variables
特定主機群組的智慧型變數之清單

GET /api/puppetclasses/:puppetclass_id/smart_variables
特定 Puppet 類別的智慧型變數之清單

參數

參數名字 描述
host_id
選填

Value:

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

Value:

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

Value:

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

search
選填

篩選結果


Value:

Must be String

order
選填

排序結果


Value:

Must be String

page
選填

編頁結果


Value:

Must be String

per_page
選填

每個請求的項目數量


Value:

Must be String


GET /api/smart_variables/:id
顯示智慧變數

參數

參數名字 描述
id
必填

Value:

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
建立智慧型變數

參數

參數名字 描述
smart_variable
必填

Value:

Must be a Hash

smart_variable[variable]
必填

Name of variable


Value:

Must be String

smart_variable[puppetclass_id]
選填 , 允許空值

Puppet class ID


Value:

Must be a number.

smart_variable[default_value]
選填 , 允許空值

Default value of variable


Value:

Must be String

smart_variable[hidden_value]
選填 , 允許空值

When enabled the parameter is hidden in the UI


Value:

Must be 'true' or 'false'

smart_variable[override_value_order]
選填 , 允許空值

值解析的順序


Value:

Must be String

smart_variable[description]
選填 , 允許空值

Description of variable


Value:

Must be String

smart_variable[validator_type]
選填 , 允許空值

Types of validation values


Value:

Must be one of: regexp, list.

smart_variable[validator_rule]
選填 , 允許空值

Used to enforce certain values for the parameter values


Value:

Must be String

smart_variable[variable_type]
選填 , 允許空值

Types of variable values


Value:

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

smart_variable[merge_overrides]
選填 , 允許空值

Merge all matching values (only array/hash type)


Value:

Must be 'true' or 'false'

smart_variable[merge_default]
選填 , 允許空值

Include default value when merging all matching values


Value:

Must be 'true' or 'false'

smart_variable[avoid_duplicates]
選填 , 允許空值

Remove duplicate values (only array type)


Value:

Must be 'true' or 'false'


PUT /api/smart_variables/:id
更新智慧變數

參數

參數名字 描述
id
必填

Value:

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

Value:

Must be a Hash

smart_variable[variable]
選填

Name of variable


Value:

Must be String

smart_variable[puppetclass_id]
選填 , 允許空值

Puppet class ID


Value:

Must be a number.

smart_variable[default_value]
選填 , 允許空值

Default value of variable


Value:

Must be String

smart_variable[hidden_value]
選填 , 允許空值

When enabled the parameter is hidden in the UI


Value:

Must be 'true' or 'false'

smart_variable[override_value_order]
選填 , 允許空值

值解析的順序


Value:

Must be String

smart_variable[description]
選填 , 允許空值

Description of variable


Value:

Must be String

smart_variable[validator_type]
選填 , 允許空值

Types of validation values


Value:

Must be one of: regexp, list.

smart_variable[validator_rule]
選填 , 允許空值

Used to enforce certain values for the parameter values


Value:

Must be String

smart_variable[variable_type]
選填 , 允許空值

Types of variable values


Value:

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

smart_variable[merge_overrides]
選填 , 允許空值

Merge all matching values (only array/hash type)


Value:

Must be 'true' or 'false'

smart_variable[merge_default]
選填 , 允許空值

Include default value when merging all matching values


Value:

Must be 'true' or 'false'

smart_variable[avoid_duplicates]
選填 , 允許空值

Remove duplicate values (only array type)


Value:

Must be 'true' or 'false'


DELETE /api/smart_variables/:id
刪除智慧變數

參數

參數名字 描述
id
必填

Value:

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