GET /api/smart_class_parameters
Elenca tutti i parametri di classe smart

GET /api/hosts/:host_id/smart_class_parameters
Elenco parametri di classe smart per un host specifico

GET /api/hostgroups/:hostgroup_id/smart_class_parameters
Elenco parametri di classe smart per un gruppo di host specifico

GET /api/puppetclasses/:puppetclass_id/smart_class_parameters
Elenco parametri di classe smart per una classe puppet specifica

GET /api/environments/:environment_id/smart_class_parameters
Elenco parametri di classe smart per un ambiente specifico

GET /api/environments/:environment_id/puppetclasses/:puppetclass_id/smart_class_parameters
Elenco parametri di classe smart per una combinazione classe puppet/ambiente specifica

Esempi

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": "2019-11-07 08:52:01 UTC",
      "updated_at": "2019-11-07 08:52:01 UTC",
      "use_puppet_default": null,
      "parameter": "cluster",
      "id": 328495940,
      "puppetclass_id": 980190962,
      "override_values_count": 2,
      "default_value": "secret",
      "puppetclass_name": "base"
    }
  ]
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opzionale

Set the current organization context for the request

Validations:

  • Must be a Integer

host_id
opzionale

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
opzionale

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
opzionale

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
opzionale

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
opzionale

Display hidden values

Validations:

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

search
opzionale

filtra i risultati

Validations:

  • Must be a String

order
opzionale

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
opzionale

Numero pagina, iniziando da 1

Validations:

  • Must be a number.

per_page
opzionale

Numero di risultati per pagina da ritornare

Validations:

  • Must be a number.

Search fields

Field name Tipo 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
Mostra un parametro di classe smart

Esempi

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": "2019-11-07 08:36:36 UTC",
  "updated_at": "2019-11-07 08:36:36 UTC",
  "use_puppet_default": null,
  "parameter": "param38",
  "id": 1018350796,
  "puppetclass_id": 980190962,
  "override_values_count": 1,
  "default_value": "hidden",
  "puppetclass_name": "base",
  "environments": [],
  "override_values": [
    {
      "created_at": "2019-11-07 08:36:36 UTC",
      "updated_at": "2019-11-07 08:36:36 UTC",
      "id": 1018350796,
      "match": "os=fake",
      "value": "abc",
      "omit": false,
      "use_puppet_default": false
    }
  ]
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opzionale

Set the current organization context for the request

Validations:

  • Must be a Integer

id
richiesto

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
opzionale

Display hidden values

Validations:

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


PUT /api/smart_class_parameters/:id
Aggiorna un parametro classe smart

Esempi

PUT /api/smart_class_parameters/1018350796
{
  "smart_class_parameter": {
    "parameter_type": "boolean",
    "default_value": "bTreQsKkLv"
  }
}
500
{
  "error": {
    "message": "Validation failed: Default value is invalid, Lookup values is invalid"
  }
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opzionale

Set the current organization context for the request

Validations:

  • Must be a Integer

id
richiesto

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
richiesto

Validations:

  • Must be a Hash

smart_class_parameter[override]
opzionale

Whether the smart class parameter value is managed by Foreman

Validations:

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

smart_class_parameter[description]
opzionale

Description of smart class

Validations:

  • Must be a String

smart_class_parameter[default_value]
opzionale

Valore da usare quando non è presente alcuna corrispondenza

Validations:

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

smart_class_parameter[hidden_value]
opzionale

When enabled the parameter is hidden in the UI

Validations:

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

smart_class_parameter[use_puppet_default]
opzionale

Deprecated, please use omit

Validations:

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

smart_class_parameter[omit]
opzionale

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]
opzionale

L’ordine attraverso il quale vengono risolti i valori

Validations:

  • Must be a String

smart_class_parameter[validator_type]
opzionale

Types of validation values

Validations:

  • Must be one of: regexp, list.

smart_class_parameter[validator_rule]
opzionale

Used to enforce certain values for the parameter values

Validations:

  • Must be a String

smart_class_parameter[override_value_order]
opzionale

L’ordine attraverso il quale vengono risolti i valori

Validations:

  • Must be a String

smart_class_parameter[parameter_type]
opzionale

Types of variable values

Validations:

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

smart_class_parameter[required]
opzionale

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]
opzionale

Merge all matching values (only array/hash type)

Validations:

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

smart_class_parameter[merge_default]
opzionale

Include default value when merging all matching values

Validations:

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

smart_class_parameter[avoid_duplicates]
opzionale

Remove duplicate values (only array type)

Validations:

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