GET /salt/api/salt_variables/:id
Show 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.


GET /salt/api/salt_variables
List Salt variables

参数

参数名字 描述
search
选填

过滤结果

Validations:

  • Must be a String

order
选填

排序项和顺序,例如 ‘id DESC’

Validations:

  • Must be a String

page
选填

页号,从 1 开始

Validations:

  • Must be a number.

per_page
选填

每页中显示的返回结果数

Validations:

  • Must be a number.


DELETE /salt/api/salt_variables/:id
Deletes Salt 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 /salt/api/salt_variables
Create Salt variable

参数

参数名字 描述
salt_variable
必填

Validations:

  • Must be a Hash

salt_variable[variable]
必填

Name of variable

Validations:

  • Must be a String

salt_variable[salt_state_id]
必填

State ID

Validations:

  • Must be a number.

salt_variable[default_value]
选填 , 允许空值

Default value of variable

Validations:

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

salt_variable[hidden_value]
选填 , 允许空值

何时将启用的参数隐藏到 UI 中

Validations:

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

salt_variable[override_value_order]
选填 , 允许空值

解析参数值的指令

Validations:

  • Must be a String

salt_variable[description]
选填 , 允许空值

Description of variable

Validations:

  • Must be a String

salt_variable[validator_type]
选填 , 允许空值

验证值类型

Validations:

  • Must be one of: regexp, list.

salt_variable[validator_rule]
选填 , 允许空值

用来在参数中强制使用某些值

Validations:

  • Must be a String

salt_variable[variable_type]
选填 , 允许空值

变量值类型

Validations:

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

salt_variable[merge_overrides]
选填 , 允许空值

合并所有匹配的值(仅用于阵列/哈希类型)

Validations:

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

salt_variable[merge_default]
选填 , 允许空值

合并所有匹配值时包括默认值

Validations:

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

salt_variable[avoid_duplicates]
选填 , 允许空值

删除重复值(仅用于阵列类型)

Validations:

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


PUT /salt/api/salt_variables/:id
Updates Salt 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.

salt_variable
必填

Validations:

  • Must be a Hash

salt_variable[variable]
选填

Name of variable

Validations:

  • Must be a String

salt_variable[salt_state_id]
选填

State ID

Validations:

  • Must be a number.

salt_variable[default_value]
选填 , 允许空值

Default value of variable

Validations:

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

salt_variable[hidden_value]
选填 , 允许空值

何时将启用的参数隐藏到 UI 中

Validations:

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

salt_variable[override_value_order]
选填 , 允许空值

解析参数值的指令

Validations:

  • Must be a String

salt_variable[description]
选填 , 允许空值

Description of variable

Validations:

  • Must be a String

salt_variable[validator_type]
选填 , 允许空值

验证值类型

Validations:

  • Must be one of: regexp, list.

salt_variable[validator_rule]
选填 , 允许空值

用来在参数中强制使用某些值

Validations:

  • Must be a String

salt_variable[variable_type]
选填 , 允许空值

变量值类型

Validations:

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

salt_variable[merge_overrides]
选填 , 允许空值

合并所有匹配的值(仅用于阵列/哈希类型)

Validations:

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

salt_variable[merge_default]
选填 , 允许空值

合并所有匹配值时包括默认值

Validations:

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

salt_variable[avoid_duplicates]
选填 , 允许空值

删除重复值(仅用于阵列类型)

Validations:

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