GET /api/smart_class_parameters
Llista tots els paràmetres de la classe intel·ligent

GET /api/hosts/:host_id/smart_class_parameters
Llista tots els paràmetres de la classe intel·ligent per a un amfitrió específic

GET /api/hostgroups/:hostgroup_id/smart_class_parameters
Llista tots els paràmetres de la classe intel·ligent per a un grup d'amfitrions específic

GET /api/puppetclasses/:puppetclass_id/smart_class_parameters
Llista tots els paràmetres de la classe intel·ligent per a una classe de Puppet específica

GET /api/environments/:environment_id/smart_class_parameters
Llista tots els paràmetres de la classe intel·ligent per a un entorn específic

GET /api/environments/:environment_id/puppetclasses/:puppetclass_id/smart_class_parameters
Llista tots els paràmetres de la classe intel·ligent per a una combinació especifica d'entorn i classe de Puppet

Examples

GET /api/hostgroups/636252244-Common/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-09-11 14:57:07 UTC",
      "updated_at": "2019-09-11 14:57:07 UTC",
      "use_puppet_default": null,
      "parameter": "cluster",
      "id": 328495940,
      "puppetclass_id": 980190962,
      "override_values_count": 2,
      "default_value": "secret",
      "puppetclass_name": "base"
    }
  ]
}

Params

Param Name Description
location_id
Optional

Abast per ubicacions

Validations:

  • Must be a Integer

organization_id
Optional

Abast per organitzacions

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

Mostra els valors ocults

Validations:

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

search
Optional

filtra els resultats

Validations:

  • Must be a String

order
Optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
Optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
Optional

Nombre de resultats per pàgina a retornar

Validations:

  • Must be a number.

Search fields

Field name Tipus 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 paràmetre de classe intel·ligent

Examples

GET /api/puppetclasses/980190962/smart_class_parameters/1018350809
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-09-11 14:41:01 UTC",
  "updated_at": "2019-09-11 14:41:01 UTC",
  "use_puppet_default": null,
  "parameter": "param140",
  "id": 1018350809,
  "puppetclass_id": 980190962,
  "override_values_count": 0,
  "default_value": "*****",
  "puppetclass_name": "base",
  "environments": [
    {
      "id": 687036937,
      "name": "testing"
    }
  ],
  "override_values": []
}

Params

Param Name Description
location_id
Optional

Abast per ubicacions

Validations:

  • Must be a Integer

organization_id
Optional

Abast per organitzacions

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

Mostra els valors ocults

Validations:

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


PUT /api/smart_class_parameters/:id
Actualitza un paràmetre de classe intel·ligent

Examples

PUT /api/smart_class_parameters/1018350795
{
  "smart_class_parameter": {
    "override": true,
    "parameter_type": "array",
    "default_value": "[aPtzKwuMSk, neBPGzsIqu]",
    "merge_overrides": true,
    "merge_default": 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": true,
  "avoid_duplicates": false,
  "override_value_order": "fqdn\norganization,location\nhostgroup",
  "created_at": "2019-09-11 14:57:07 UTC",
  "updated_at": "2019-09-11 14:57:47 UTC",
  "use_puppet_default": null,
  "parameter": "custom_class_param",
  "id": 1018350795,
  "puppetclass_id": 298486374,
  "override_values_count": 0,
  "default_value": [
    "aPtzKwuMSk",
    "neBPGzsIqu"
  ],
  "puppetclass_name": "apache",
  "environments": [
    {
      "id": 334344675,
      "name": "production"
    }
  ],
  "puppetclass": {
    "id": 298486374,
    "name": "apache",
    "module_name": "apache"
  },
  "override_values": []
}

Params

Param Name Description
location_id
Optional

Abast per ubicacions

Validations:

  • Must be a Integer

organization_id
Optional

Abast per organitzacions

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

Descripció de la classe intel·ligent

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

L’ordre en què es resolen els valors

Validations:

  • Must be a String

smart_class_parameter[validator_type]
Optional

Tipus de valors de validació

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

L’ordre en què es resolen els valors

Validations:

  • Must be a String

smart_class_parameter[parameter_type]
Optional

Tipus de valors de la variable

Validations:

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

smart_class_parameter[required]
Optional

En cas que sigui cert, es produirà un error si no hi ha cap valor per defecte i no hi ha cap classificador que proporcioni un valor

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.