GET /api/smart_class_parameters
List all smart class parameters

GET /api/hosts/:host_id/smart_class_parameters
List of smart class parameters for a specific host

GET /api/hostgroups/:hostgroup_id/smart_class_parameters
List of smart class parameters for a specific host group

GET /api/puppetclasses/:puppetclass_id/smart_class_parameters
List of smart class parameters for a specific Puppet class

GET /api/environments/:environment_id/smart_class_parameters
List of smart class parameters for a specific environment

GET /api/environments/:environment_id/puppetclasses/:puppetclass_id/smart_class_parameters
List of smart class parameters for a specific environment/Puppet class combination

Examples

GET /api/puppetclasses/980190962/smart_class_parameters
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "description": null,
      "override": true,
      "parameter_type": "string",
      "hidden_value?": false,
      "omit": null,
      "required": false,
      "validator_type": null,
      "validator_rule": null,
      "merge_overrides": false,
      "merge_default": false,
      "avoid_duplicates": false,
      "override_value_order": "fqdn\norganization,location\nhostgroup\nos",
      "created_at": "2018-11-15 19:01:27 UTC",
      "updated_at": "2018-11-15 19:01:27 UTC",
      "use_puppet_default": null,
      "puppetclass_name": "base",
      "parameter": "cluster",
      "id": 328495940,
      "puppetclass_id": 980190962,
      "override_values_count": 2,
      "default_value": "secret"
    }
  ]
}

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.

environment_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

filter results

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

number of entries per request

Validations:

  • Must be a String

Search fields

Field name Type Possible values
avoid_duplicates true, false
environment string
key string
merge_default true, false
merge_overrides true, false
override true, false
parameter string
puppetclass string
puppetclass_name string

GET /api/smart_class_parameters/:id
Show a smart class parameter

Examples

GET /api/puppetclasses/980190962/smart_class_parameters/1018350796
200
{
  "description": null,
  "override": false,
  "parameter_type": null,
  "hidden_value?": true,
  "omit": null,
  "required": false,
  "validator_type": null,
  "validator_rule": null,
  "merge_overrides": false,
  "merge_default": false,
  "avoid_duplicates": false,
  "override_value_order": "fqdn\nhostgroup\nos\ndomain",
  "created_at": "2018-11-15 19:01:35 UTC",
  "updated_at": "2018-11-15 19:01:35 UTC",
  "use_puppet_default": null,
  "puppetclass_name": "base",
  "parameter": "param1",
  "id": 1018350796,
  "puppetclass_id": 980190962,
  "override_values_count": 0,
  "default_value": "hidden",
  "environments": [],
  "override_values": []
}

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


PUT /api/smart_class_parameters/:id
Update a smart class parameter

Examples

PUT /api/smart_class_parameters/1018350795
{
  "smart_class_parameter": {
    "override": true,
    "parameter_type": "array",
    "default_value": "[yJjteNflIu, GXBIHwELce]",
    "avoid_duplicates": true,
    "merge_overrides": true
  }
}
200
{
  "description": null,
  "override": true,
  "parameter_type": "array",
  "hidden_value?": false,
  "omit": null,
  "required": false,
  "validator_type": null,
  "validator_rule": null,
  "merge_overrides": true,
  "merge_default": false,
  "avoid_duplicates": true,
  "override_value_order": "fqdn\norganization,location\nhostgroup",
  "created_at": "2018-11-15 19:01:27 UTC",
  "updated_at": "2018-11-15 19:02:49 UTC",
  "use_puppet_default": null,
  "puppetclass_name": "apache",
  "parameter": "custom_class_param",
  "id": 1018350795,
  "puppetclass_id": 298486374,
  "override_values_count": 0,
  "default_value": [
    "yJjteNflIu",
    "GXBIHwELce"
  ],
  "environments": [
    {
      "id": 334344675,
      "name": "production"
    }
  ],
  "puppetclass": {
    "id": 298486374,
    "name": "apache",
    "module_name": "apache"
  },
  "override_values": []
}

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_class_parameter
required

Validations:

  • Must be a Hash

smart_class_parameter[override]
optional

Whether the smart class parameter value is managed by Foreman

Validations:

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

smart_class_parameter[description]
optional

Description of smart class

Validations:

  • Must be a String

smart_class_parameter[default_value]
optional

Value to use when there is no match

Validations:

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

smart_class_parameter[hidden_value]
optional

When enabled the parameter is hidden in the UI

Validations:

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

smart_class_parameter[use_puppet_default]
optional

Deprecated, please use omit

Validations:

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

smart_class_parameter[omit]
optional

Foreman will not send this parameter in classification output. Puppet will use the value defined in the Puppet manifest for this parameter

Validations:

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

smart_class_parameter[path]
optional

The order in which values are resolved

Validations:

  • Must be a String

smart_class_parameter[validator_type]
optional

Types of validation values

Validations:

  • Must be one of: regexp, list.

smart_class_parameter[validator_rule]
optional

Used to enforce certain values for the parameter values

Validations:

  • Must be a String

smart_class_parameter[override_value_order]
optional

The order in which values are resolved

Validations:

  • Must be a String

smart_class_parameter[parameter_type]
optional

Types of variable values

Validations:

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

smart_class_parameter[required]
optional

If true, will raise an error if there is no default value and no matcher provide a value

Validations:

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

smart_class_parameter[merge_overrides]
optional

Merge all matching values (only array/hash type)

Validations:

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

smart_class_parameter[merge_default]
optional

Include default value when merging all matching values

Validations:

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

smart_class_parameter[avoid_duplicates]
optional

Remove duplicate values (only array type)

Validations:

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