POST /api/smart_proxies/:id/import_puppetclasses
Import puppet classes from puppet proxy

POST /api/smart_proxies/:smart_proxy_id/environments/:id/import_puppetclasses
Import puppet classes from puppet proxy for an environment

POST /api/environments/:environment_id/smart_proxies/:id/import_puppetclasses
Import puppet classes from puppet proxy 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

id
required

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_proxy_id
optional

Validations:

  • Must be a String

environment_id
optional

Validations:

  • Must be a String

dryrun
optional

Validations:

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

except
optional

Optional comma-delimited string containing either ‘new’, ‘updated’, or ‘obsolete’ that is used to limit the imported Puppet classes

Validations:

  • Must be a String


GET /api/environments
List all environments

GET /api/puppetclasses/:puppetclass_id/environments
List environments of Puppet class

GET /api/locations/:location_id/environments
List environments per location

GET /api/organizations/:organization_id/environments
List environments per organization

Params

Param name Description
puppetclass_id
optional

ID of Puppet class

Validations:

  • Must be a String

location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

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

Validations:

  • Must be a number.

Search fields

Field name Type Possible values
location string
location_id integer
name string
organization string
organization_id integer

GET /api/environments/:id
Show an environment

Examples

GET /api/environments/334344675
200
{
  "created_at": "2019-11-07 08:34:09 UTC",
  "updated_at": "2019-11-07 08:34:09 UTC",
  "name": "production",
  "id": 334344675,
  "template_combinations": [
    {
      "id": 980190962,
      "provisioning_template_id": 943779058,
      "provisioning_template_name": "MyString",
      "hostgroup_id": 636252244,
      "hostgroup_name": "Common",
      "environment_id": 334344675,
      "environment_name": "production",
      "config_template_id": 943779058,
      "config_template_name": "MyString"
    },
    {
      "id": 113629430,
      "provisioning_template_id": 104314179,
      "provisioning_template_name": "MyFinish",
      "hostgroup_id": null,
      "hostgroup_name": null,
      "environment_id": 334344675,
      "environment_name": "production",
      "config_template_id": 104314179,
      "config_template_name": "MyFinish"
    },
    {
      "id": 281110143,
      "provisioning_template_id": 269958254,
      "provisioning_template_name": "MyString2",
      "hostgroup_id": 636252244,
      "hostgroup_name": "Common",
      "environment_id": 334344675,
      "environment_name": "production",
      "config_template_id": 269958254,
      "config_template_name": "MyString2"
    },
    {
      "id": 1018350795,
      "provisioning_template_id": 981457253,
      "provisioning_template_name": "MyScript",
      "hostgroup_id": 636252244,
      "hostgroup_name": "Common",
      "environment_id": 334344675,
      "environment_name": "production",
      "config_template_id": 981457253,
      "config_template_name": "MyScript"
    }
  ],
  "puppetclasses": [
    {
      "id": 298486374,
      "name": "apache",
      "module_name": "apache"
    },
    {
      "id": 638205575,
      "name": "auth",
      "module_name": "auth"
    },
    {
      "id": 980190962,
      "name": "base",
      "module_name": "base"
    },
    {
      "id": 51848956,
      "name": "chkmk",
      "module_name": "chkmk"
    },
    {
      "id": 1018350795,
      "name": "nagios",
      "module_name": "nagios"
    },
    {
      "id": 374648174,
      "name": "pam",
      "module_name": "pam"
    },
    {
      "id": 281110143,
      "name": "vim",
      "module_name": "vim"
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

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 an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/environments
Create 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

environment
required

Validations:

  • Must be a Hash

environment[name]
required

Validations:

  • Must be a String

environment[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

environment[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


PUT /api/environments/:id
Update 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

id
required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

environment
required

Validations:

  • Must be a Hash

environment[name]
optional

Validations:

  • Must be a String

environment[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

environment[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


DELETE /api/environments/:id
Delete 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

id
required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.