示例

PUT /api/environments/687036940
{
  "environment": {
    "location_ids": [
      255093256
    ]
  }
}
200
{
  "created_at": "2019-11-07 08:34:13 UTC",
  "updated_at": "2019-11-07 08:34:13 UTC",
  "name": "environment85",
  "id": 687036940,
  "template_combinations": [],
  "puppetclasses": [],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

id
必填

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
必填

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