GET /api/puppetclasses
Listar todas las clases Puppet

GET /api/hosts/:host_id/puppetclasses
Listar todas las clases Puppet de un host

GET /api/hostgroups/:hostgroup_id/puppetclasses
Listar todas las clases Puppet de un grupo de hosts

GET /api/environments/:environment_id/puppetclasses
Listar todas las clases Puppet de un entorno

Ejemplos

GET /api/hosts/host636/puppetclasses
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": {
    "class19": [
      {
        "id": 1018350797,
        "name": "class19",
        "created_at": "2019-11-07T08:39:20.984Z",
        "updated_at": "2019-11-07T08:39:20.984Z"
      }
    ]
  }
}

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

host_id
opcional

ID del host

Validations:

  • Must be a String

hostgroup_id
opcional

ID del grupo de hosts

Validations:

  • Must be a String

environment_id
opcional

ID del entorno

Validations:

  • Must be a String

search
opcional

filtrar resultados

Validations:

  • Must be a String

order
opcional

Orden y campo de clasificación, p. ej., ‘id DESC’

Validations:

  • Must be a String

page
opcional

Número de página, comenzando por 1

Validations:

  • Must be a number.

per_page
opcional

Número de resultados por página para devolver

Validations:

  • Must be a number.

Campos de búsqueda

Nombre del campo Tipo Valores posibles
config_group string
environment string
host string
hostgroup string
key string
location string
name string
organization string

GET /api/puppetclasses/:id
Mostrar una clase Puppet

GET /api/hosts/:host_id/puppetclasses/:id
Mostrar una clase Puppet para un host

GET /api/hostgroups/:hostgroup_id/puppetclasses/:id
Mostrar una clase Puppet para un grupo de hosts

GET /api/environments/:environment_id/puppetclasses/:id
Mostrar una clase Puppet para un entorno

Ejemplos

GET /api/environments/production/puppetclasses/980190962
200
{
  "created_at": "2019-11-07 08:39:06 UTC",
  "updated_at": "2019-11-07 08:39:06 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
    }
  ]
}

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

host_id
opcional

ID del host

Validations:

  • Must be a String

hostgroup_id
opcional

ID del grupo de hosts

Validations:

  • Must be a String

environment_id
opcional

ID del entorno

Validations:

  • Must be a String

id
requerido

ID de la clase Puppet

Validations:

  • Must be a String


POST /api/puppetclasses
Crear una clase Puppet

Ejemplos

POST /api/puppetclasses
{
  "puppetclass": {
    "name": "test_puppetclass",
    "lookup_keys_attributes": [
      {
        "key": "smart_variable1"
      }
    ]
  }
}
201
{
  "created_at": "2019-11-07 08:39:20 UTC",
  "updated_at": "2019-11-07 08:39:20 UTC",
  "id": 1018350796,
  "name": "test_puppetclass",
  "module_name": "test_puppetclass",
  "environments": [],
  "hostgroups": [],
  "smart_variables": [
    {
      "variable": "smart_variable1",
      "id": 1018350796
    }
  ],
  "smart_class_parameters": []
}

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

puppetclass
requerido

Validations:

  • Must be a Hash

puppetclass[name]
requerido

Validations:

  • Must be a String


PUT /api/puppetclasses/:id
Actualizar una clase Puppet

Ejemplos

PUT /api/puppetclasses/980190962-base
{
  "puppetclass": {
    "name": "test_puppetclass"
  }
}
200
{
  "created_at": "2019-11-07 08:39:06 UTC",
  "updated_at": "2019-11-07 08:39:21 UTC",
  "id": 980190962,
  "name": "test_puppetclass",
  "module_name": "test_puppetclass",
  "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
    }
  ]
}

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be a String

puppetclass
requerido

Validations:

  • Must be a Hash

puppetclass[name]
opcional

Validations:

  • Must be a String


DELETE /api/puppetclasses/:id
Borrar una clase Puppet

Ejemplos

DELETE /api/puppetclasses/980190962-base
{
  "puppetclass": {}
}
200
{
  "id": 980190962,
  "name": "base",
  "created_at": "2019-11-07T08:39:06.354Z",
  "updated_at": "2019-11-07T08:39:06.354Z"
}

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be a String