示例

GET /api/puppetclasses/298486374/smart_variables
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "description": null,
      "parameter_type": "string",
      "variable_type": "string",
      "hidden_value?": false,
      "validator_type": null,
      "validator_rule": null,
      "override_value_order": "organization,location\nxyz\nhostgroup",
      "merge_overrides": false,
      "merge_default": false,
      "avoid_duplicates": false,
      "puppetclass_id": 298486374,
      "puppetclass_name": "apache",
      "created_at": "2019-09-11 14:58:01 UTC",
      "updated_at": "2019-09-11 14:58:01 UTC",
      "variable": "special_info",
      "id": 281110143,
      "default_value": "secret",
      "override_values_count": 2
    }
  ]
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

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.

show_hidden
选填

显示隐藏值

Validations:

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

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.

搜索字段

字段名 类型 可能的值
avoid_duplicates true, false
key string
merge_default true, false
merge_overrides true, false
override true, false
parameter string
puppetclass string