GET /api/puppetclasses
Llista totes les classes de Puppet

GET /api/hosts/:host_id/puppetclasses
Llista totes les classes de Puppet per a un amfitrió

GET /api/hostgroups/:hostgroup_id/puppetclasses
Llista totes les classes de Puppet per a un grup d'amfitrions

GET /api/environments/:environment_id/puppetclasses
Llista totes les classes de Puppet per a un entorn

Examples

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

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

ID d’amfitrió

Validations:

  • Must be a String

hostgroup_id
Optional

ID de grup d’amfitrions

Validations:

  • Must be a String

environment_id
Optional

ID d’entorn

Validations:

  • Must be a String

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
config_group string
environment string
host string
hostgroup string
key string
location string
name string
organization string

GET /api/puppetclasses/:id
Mostra una classe de Puppet

GET /api/hosts/:host_id/puppetclasses/:id
Mostra una classe de Puppet per a l'amfitrió

GET /api/hostgroups/:hostgroup_id/puppetclasses/:id
Mostra una classe de Puppet per a un grup d'amfitrions

GET /api/environments/:environment_id/puppetclasses/:id
Mostra una classe de Puppet per a un entorn

Examples

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

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

ID d’amfitrió

Validations:

  • Must be a String

hostgroup_id
Optional

ID de grup d’amfitrions

Validations:

  • Must be a String

environment_id
Optional

ID d’entorn

Validations:

  • Must be a String

id
Required

ID de classe de Puppet

Validations:

  • Must be a String


POST /api/puppetclasses
Crea una classe de Puppet

Examples

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": []
}

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

puppetclass
Required

Validations:

  • Must be a Hash

puppetclass[name]
Required

Validations:

  • Must be a String


PUT /api/puppetclasses/:id
Actualitza una classe de Puppet

Examples

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

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 a String

puppetclass
Required

Validations:

  • Must be a Hash

puppetclass[name]
Optional

Validations:

  • Must be a String


DELETE /api/puppetclasses/:id
Suprimeix una classe de Puppet

Examples

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

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 a String