GET /api/config_groups
配置组列表

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

search
选填

过滤结果

Validations:

  • Must be a String

order
选填

排序项和顺序,例如 ‘id DESC’

Validations:

  • Must be a String

page
选填

页号,从 1 开始

Validations:

  • Must be a number.

per_page
选填

每页中显示的返回结果数

Validations:

  • Must be a number.

搜索字段

字段名 类型 可能的值
class string
name string

GET /api/config_groups/:id
显示配置组

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

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.


POST /api/config_groups
创建配置组

示例

POST /api/config_groups
{
  "config_group": {
    "name": "config-group",
    "puppetclass_ids": [
      980190962,
      281110143
    ]
  }
}
201
{
  "created_at": "2019-09-11 14:38:32 UTC",
  "updated_at": "2019-09-11 14:38:32 UTC",
  "id": 980190963,
  "name": "config-group",
  "puppetclasses": [
    {
      "id": 980190962,
      "name": "base",
      "module_name": "base"
    },
    {
      "id": 281110143,
      "name": "vim",
      "module_name": "vim"
    }
  ]
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

config_group
必填

Validations:

  • Must be a Hash

config_group[name]
必填

Validations:

  • Must be a String

config_group[puppetclass_ids]
选填 , 允许空值

Validations:

  • Must be an array of any type


PUT /api/config_groups/:id
更新配置组

示例

PUT /api/config_groups/980190962-Monitoring
{
  "config_group": {
    "name": "new name",
    "puppetclass_ids": [
      980190962,
      281110143
    ]
  }
}
200
{
  "created_at": "2019-09-11 14:38:12 UTC",
  "updated_at": "2019-09-11 14:38:32 UTC",
  "id": 980190962,
  "name": "new name",
  "puppetclasses": [
    {
      "id": 980190962,
      "name": "base",
      "module_name": "base"
    },
    {
      "id": 281110143,
      "name": "vim",
      "module_name": "vim"
    }
  ]
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be a String

config_group
必填

Validations:

  • Must be a Hash

config_group[name]
选填

Validations:

  • Must be a String

config_group[puppetclass_ids]
选填 , 允许空值

Validations:

  • Must be an array of any type


DELETE /api/config_groups/:id
删除配置组

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be a String