GET /api/smart_variables
Elenca tutte le variabili smart

GET /api/hosts/:host_id/smart_variables
Elenco di variabili smart per un host specifico

GET /api/hostgroups/:hostgroup_id/smart_variables
Elenco variabili smart per un gruppo di host specifico

GET /api/puppetclasses/:puppetclass_id/smart_variables
Elenco di variabili smart per una classe puppet specifica

Esempi

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

Parametri

Nome parametro Descrizione
location_id
opzionale

Scopo per posizioni

Validations:

  • Must be a Integer

organization_id
opzionale

Scopo per organizzazioni

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.

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
key string
merge_default true, false
merge_overrides true, false
override true, false
parameter string
puppetclass string

GET /api/smart_variables/:id
Mostra una variabile smart

Esempi

GET /api/puppetclasses/980190962/smart_variables/1018350796
200
{
  "description": null,
  "parameter_type": null,
  "variable_type": null,
  "hidden_value?": true,
  "validator_type": null,
  "validator_rule": null,
  "override_value_order": "fqdn\nhostgroup\nos\ndomain",
  "merge_overrides": false,
  "merge_default": false,
  "avoid_duplicates": false,
  "puppetclass_id": 980190962,
  "puppetclass_name": "base",
  "created_at": "2019-09-11 14:34:10 UTC",
  "updated_at": "2019-09-11 14:34:10 UTC",
  "variable": "param8",
  "id": 1018350796,
  "default_value": "hidden",
  "override_values_count": 0,
  "override_values": []
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Scopo per posizioni

Validations:

  • Must be a Integer

organization_id
opzionale

Scopo per organizzazioni

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.


POST /api/smart_variables
Crea una variabile smart

Esempi

POST /api/smart_variables
{
  "smart_variable": {
    "variable": "QSFxqjVjdV",
    "puppetclass_id": 298486374,
    "hidden_value": true
  }
}
201
{
  "description": null,
  "parameter_type": null,
  "variable_type": null,
  "hidden_value?": true,
  "validator_type": null,
  "validator_rule": null,
  "override_value_order": "fqdn\nhostgroup\nos\ndomain",
  "merge_overrides": false,
  "merge_default": false,
  "avoid_duplicates": false,
  "puppetclass_id": 298486374,
  "puppetclass_name": "apache",
  "created_at": "2019-09-11 14:34:11 UTC",
  "updated_at": "2019-09-11 14:34:11 UTC",
  "variable": "QSFxqjVjdV",
  "id": 1018350798,
  "default_value": "*****",
  "override_values_count": 0,
  "override_values": []
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Scopo per posizioni

Validations:

  • Must be a Integer

organization_id
opzionale

Scopo per organizzazioni

Validations:

  • Must be a Integer

smart_variable
richiesto

Validations:

  • Must be a Hash

smart_variable[variable]
richiesto

Name of variable

Validations:

  • Must be a String

smart_variable[puppetclass_id]
opzionale , consentito nil

Puppet class ID

Validations:

  • Must be a number.

smart_variable[default_value]
opzionale , consentito nil

Default value of variable

Validations:

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

smart_variable[hidden_value]
opzionale , consentito nil

When enabled the parameter is hidden in the UI

Validations:

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

smart_variable[override_value_order]
opzionale , consentito nil

L’ordine attraverso il quale vengono risolti i valori

Validations:

  • Must be a String

smart_variable[description]
opzionale , consentito nil

Description of variable

Validations:

  • Must be a String

smart_variable[validator_type]
opzionale , consentito nil

Types of validation values

Validations:

  • Must be one of: regexp, list.

smart_variable[validator_rule]
opzionale , consentito nil

Used to enforce certain values for the parameter values

Validations:

  • Must be a String

smart_variable[variable_type]
opzionale , consentito nil

Types of variable values

Validations:

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

smart_variable[merge_overrides]
opzionale , consentito nil

Merge all matching values (only array/hash type)

Validations:

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

smart_variable[merge_default]
opzionale , consentito nil

Include default value when merging all matching values

Validations:

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

smart_variable[avoid_duplicates]
opzionale , consentito nil

Remove duplicate values (only array type)

Validations:

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


PUT /api/smart_variables/:id
Aggiorna una variabile smart

Esempi

PUT /api/smart_variables/1018350799-IJcocqAlPP
{
  "smart_variable": {
    "hidden_value": false
  }
}
200
{
  "description": null,
  "parameter_type": null,
  "variable_type": null,
  "hidden_value?": false,
  "validator_type": null,
  "validator_rule": null,
  "override_value_order": "fqdn\nhostgroup\nos\ndomain",
  "merge_overrides": false,
  "merge_default": false,
  "avoid_duplicates": false,
  "puppetclass_id": 980190962,
  "puppetclass_name": "base",
  "created_at": "2019-09-11 14:34:11 UTC",
  "updated_at": "2019-09-11 14:34:11 UTC",
  "variable": "IJcocqAlPP",
  "id": 1018350799,
  "default_value": null,
  "override_values_count": 0,
  "override_values": []
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Scopo per posizioni

Validations:

  • Must be a Integer

organization_id
opzionale

Scopo per organizzazioni

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_variable
richiesto

Validations:

  • Must be a Hash

smart_variable[variable]
opzionale

Name of variable

Validations:

  • Must be a String

smart_variable[puppetclass_id]
opzionale , consentito nil

Puppet class ID

Validations:

  • Must be a number.

smart_variable[default_value]
opzionale , consentito nil

Default value of variable

Validations:

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

smart_variable[hidden_value]
opzionale , consentito nil

When enabled the parameter is hidden in the UI

Validations:

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

smart_variable[override_value_order]
opzionale , consentito nil

L’ordine attraverso il quale vengono risolti i valori

Validations:

  • Must be a String

smart_variable[description]
opzionale , consentito nil

Description of variable

Validations:

  • Must be a String

smart_variable[validator_type]
opzionale , consentito nil

Types of validation values

Validations:

  • Must be one of: regexp, list.

smart_variable[validator_rule]
opzionale , consentito nil

Used to enforce certain values for the parameter values

Validations:

  • Must be a String

smart_variable[variable_type]
opzionale , consentito nil

Types of variable values

Validations:

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

smart_variable[merge_overrides]
opzionale , consentito nil

Merge all matching values (only array/hash type)

Validations:

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

smart_variable[merge_default]
opzionale , consentito nil

Include default value when merging all matching values

Validations:

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

smart_variable[avoid_duplicates]
opzionale , consentito nil

Remove duplicate values (only array type)

Validations:

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


DELETE /api/smart_variables/:id
Cancella una variabile smart

Esempi

DELETE /api/smart_variables/281110143-special_info
{
  "smart_variable": {}
}
200
{
  "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": 0,
  "override_values": []
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Scopo per posizioni

Validations:

  • Must be a Integer

organization_id
opzionale

Scopo per organizzazioni

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.