Examples

POST /api/environments
{
  "environment": {
    "name": "some_environment",
    "location_ids": [
      255093256
    ]
  }
}
201
{
  "created_at": "2018-11-15 19:01:57 UTC",
  "updated_at": "2018-11-15 19:01:57 UTC",
  "name": "some_environment",
  "id": 687036938,
  "template_combinations": [],
  "puppetclasses": [],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": []
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

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