GET /api/puppetclasses
List all Puppet classes

GET /api/hosts/:host_id/puppetclasses
List all Puppet classes for a host

GET /api/hostgroups/:hostgroup_id/puppetclasses
List all Puppet classes for a host group

GET /api/environments/:environment_id/puppetclasses
List all Puppet classes for an environment

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

host_id
optional

ID of host

Validations:

  • Must be a String

hostgroup_id
optional

ID of host group

Validations:

  • Must be a String

environment_id
optional

ID of environment

Validations:

  • Must be a String

search
optional

filter results

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

Number of results per page to return, ‘all’ to return all results

Validations:

  • Must match regular expression /\A([1-9]\d|all)\Z$/.

Search fields

Field name Type Possible values
config_group string
environment string
host string
hostgroup string
key string
location string
name string
organization string

GET /api/puppetclasses/:id
Show a Puppet class

GET /api/hosts/:host_id/puppetclasses/:id
Show a Puppet class for host

GET /api/hostgroups/:hostgroup_id/puppetclasses/:id
Show a Puppet class for a host group

GET /api/environments/:environment_id/puppetclasses/:id
Show a Puppet class for an environment

Examples

GET /api/hosts/host1325/puppetclasses/1018350802
200
{
  "created_at": "2020-05-20 13:32:05 UTC",
  "updated_at": "2020-05-20 13:32:05 UTC",
  "id": 1018350802,
  "name": "class70",
  "module_name": "class70",
  "environments": [
    {
      "name": "environment165",
      "id": 687036939
    }
  ],
  "hostgroups": [],
  "smart_class_parameters": []
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

host_id
optional

ID of host

Validations:

  • Must be a String

hostgroup_id
optional

ID of host group

Validations:

  • Must be a String

environment_id
optional

ID of environment

Validations:

  • Must be a String

id
required

ID of Puppet class

Validations:

  • Must be a String


POST /api/puppetclasses
Create a Puppet class

Examples

POST /api/puppetclasses
{
  "puppetclass": {
    "name": "test_puppetclass"
  }
}
201
{
  "created_at": "2020-05-20 13:32:05 UTC",
  "updated_at": "2020-05-20 13:32:05 UTC",
  "id": 1018350805,
  "name": "test_puppetclass",
  "module_name": "test_puppetclass",
  "environments": [],
  "hostgroups": [],
  "smart_class_parameters": []
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

puppetclass
required

Validations:

  • Must be a Hash

puppetclass[name]
required

Validations:

  • Must be a String


PUT /api/puppetclasses/:id
Update a Puppet class

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

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
Delete a Puppet class

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be a String