GET /api/puppetclasses
Afficher toutes les classes Puppet

GET /api/hosts/:host_id/puppetclasses
Afficher toutes les classes Puppet d'un hôte

GET /api/hostgroups/:hostgroup_id/puppetclasses
Afficher toutes les classes Puppet d'un groupe d'hôtes

GET /api/environments/:environment_id/puppetclasses
Afficher toutes les classes Puppet d'un environnement

Exemples

GET /api/puppetclasses
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": {
    "class82": [
      {
        "id": 1018350796,
        "name": "class82",
        "created_at": "2019-09-11T14:53:24.240Z",
        "updated_at": "2019-09-11T14:53:24.240Z"
      }
    ]
  }
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

host_id
optionel

ID de l’hôte

Validations:

  • Must be a String

hostgroup_id
optionel

ID du groupe d’hôtes

Validations:

  • Must be a String

environment_id
optionel

ID de l’environnement

Validations:

  • Must be a String

search
optionel

filtrer les résultats

Validations:

  • Must be a String

order
optionel

Champ et sens de tri, ex: ‘id DESC’

Validations:

  • Must be a String

page
optionel

Numéro de la page, commençant par 1

Validations:

  • Must be a number.

per_page
optionel

Nombre de résultats par page à renvoyer

Validations:

  • Must be a number.

Rechercher les champs

Nom du champ Type Valeurs possibles
config_group string
environment string
host string
hostgroup string
key string
location string
name string
organization string

GET /api/puppetclasses/:id
Afficher une classe Puppet

GET /api/hosts/:host_id/puppetclasses/:id
Afficher une classe Puppet pour un hôte

GET /api/hostgroups/:hostgroup_id/puppetclasses/:id
Afficher une classe Puppet pour un groupe d'hôtes

GET /api/environments/:environment_id/puppetclasses/:id
Afficher une classe Puppet pour un environnement

Exemples

GET /api/environments/production/puppetclasses/980190962
200
{
  "created_at": "2019-09-11 14:57:07 UTC",
  "updated_at": "2019-09-11 14:57:07 UTC",
  "id": 980190962,
  "name": "base",
  "module_name": "base",
  "environments": [
    {
      "name": "production",
      "id": 334344675
    }
  ],
  "hostgroups": [
    {
      "id": 636252244,
      "name": "Common",
      "title": "Common",
      "description": null
    }
  ],
  "smart_variables": [
    {
      "variable": "bool_test",
      "id": 638205575
    },
    {
      "variable": "ssl_port",
      "id": 298486374
    }
  ],
  "smart_class_parameters": [
    {
      "parameter": "cluster",
      "id": 328495940
    }
  ]
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

host_id
optionel

ID de l’hôte

Validations:

  • Must be a String

hostgroup_id
optionel

ID du groupe d’hôtes

Validations:

  • Must be a String

environment_id
optionel

ID de l’environnement

Validations:

  • Must be a String

id
requis

ID de la classe Puppet

Validations:

  • Must be a String


POST /api/puppetclasses
Créer une classe Puppet

Exemples

POST /api/puppetclasses
{
  "puppetclass": {
    "name": "test_puppetclass",
    "lookup_keys_attributes": [
      {
        "key": "smart_variable1"
      }
    ]
  }
}
201
{
  "created_at": "2019-09-11 14:57:13 UTC",
  "updated_at": "2019-09-11 14:57:13 UTC",
  "id": 1018350800,
  "name": "test_puppetclass",
  "module_name": "test_puppetclass",
  "environments": [],
  "hostgroups": [],
  "smart_variables": [
    {
      "variable": "smart_variable1",
      "id": 1018350797
    }
  ],
  "smart_class_parameters": []
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

puppetclass
requis

Validations:

  • Must be a Hash

puppetclass[name]
requis

Validations:

  • Must be a String


PUT /api/puppetclasses/:id
Mise à jour d'une classe Puppet

Exemples

PUT /api/puppetclasses/1018350797
{
  "smart_class_parameter_ids": [],
  "puppetclass": {}
}
200
{
  "created_at": "2019-09-11 14:57:13 UTC",
  "updated_at": "2019-09-11 14:57:13 UTC",
  "id": 1018350797,
  "name": "class376",
  "module_name": "class376",
  "environments": [
    {
      "name": "environment350",
      "id": 687036944
    }
  ],
  "hostgroups": [],
  "smart_variables": [],
  "smart_class_parameters": [
    {
      "parameter": "param335",
      "id": 1018350796
    }
  ]
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be a String

puppetclass
requis

Validations:

  • Must be a Hash

puppetclass[name]
optionel

Validations:

  • Must be a String


DELETE /api/puppetclasses/:id
Supprimer une classe Puppet

Exemples

DELETE /api/puppetclasses/980190962-base
{
  "puppetclass": {}
}
200
{
  "id": 980190962,
  "name": "base",
  "created_at": "2019-09-11T14:57:07.101Z",
  "updated_at": "2019-09-11T14:57:07.101Z"
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

id
requis

Validations:

  • Must be a String