GET /api/v2/discovery_rules
列出所有发现规则

参数

参数名字 描述
search
选填

过滤结果

Validations:

  • Must be String

order
选填

结果排序

Validations:

  • Must be String

page
选填

页数

Validations:

  • Must be String

per_page
选填

每个请求中的条目数

Validations:

  • Must be String


GET /api/v2/discovery_rules/:id
显示发现规则

参数

参数名字 描述
id
必填

Validations:

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


POST /api/v2/discovery_rules
常见发现规则

参数

参数名字 描述
discovery_rule
选填 , 允许空值

Validations:

  • Must be a Hash

discovery_rule[name]
必填

代表显示给用户的规则名称

Validations:

  • Must be String

discovery_rule[search]
必填

查询以便将找到的主机与具体规则匹配

Validations:

  • Must be String

discovery_rule[hostgroup_id]
必填

用来自动供应主机的主机组

Validations:

  • Must be Integer

discovery_rule[hostname]
选填 , 允许空值

定义为匹配的主机分配可读主机名的模式

Validations:

  • Must be String

discovery_rule[max_count]
选填 , 允许空值

启用以便限制每个规则可供应主机的最大数量

Validations:

  • Must be Integer

discovery_rule[priority]
选填 , 允许空值

按顺序排列规则,从最小的数字开始。数字必须大于 0

Validations:

  • Must be Integer

discovery_rule[enabled]
选填 , 允许空值

用于临时关闭规则的标签

Validations:

  • Must be 'true' or 'false' or '1' or '0'

discovery_rule[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

discovery_rule[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


PUT /api/v2/discovery_rules/:id
更新规则

参数

参数名字 描述
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.

discovery_rule
选填 , 允许空值

Validations:

  • Must be a Hash

discovery_rule[name]
选填

代表显示给用户的规则名称

Validations:

  • Must be String

discovery_rule[search]
选填

查询以便将找到的主机与具体规则匹配

Validations:

  • Must be String

discovery_rule[hostgroup_id]
选填

用来自动供应主机的主机组

Validations:

  • Must be Integer

discovery_rule[hostname]
选填 , 允许空值

定义为匹配的主机分配可读主机名的模式

Validations:

  • Must be String

discovery_rule[max_count]
选填 , 允许空值

启用以便限制每个规则可供应主机的最大数量

Validations:

  • Must be Integer

discovery_rule[priority]
选填 , 允许空值

按顺序排列规则,从最小的数字开始。数字必须大于 0

Validations:

  • Must be Integer

discovery_rule[enabled]
选填 , 允许空值

用于临时关闭规则的标签

Validations:

  • Must be 'true' or 'false' or '1' or '0'

discovery_rule[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

discovery_rule[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


DELETE /api/v2/discovery_rules/:id
删除规则

参数

参数名字 描述
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.