示例

POST /api/environments
{
  "environment": {
    "name": "some_environment",
    "organization_ids": [
      114267492
    ]
  }
}
201
{
  "created_at": "2019-09-11 14:51:49 UTC",
  "updated_at": "2019-09-11 14:51:49 UTC",
  "name": "some_environment",
  "id": 687036947,
  "template_combinations": [],
  "puppetclasses": [],
  "locations": [],
  "organizations": [
    {
      "id": 114267492,
      "name": "Empty Organization",
      "title": "Empty Organization",
      "description": null
    }
  ]
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

environment
必填

Validations:

  • Must be a Hash

environment[name]
必填

Validations:

  • Must be a String

environment[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

environment[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type