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

represents rule name shown to the users

Validations:

  • Must be String

discovery_rule[search]
必填

query to match discovered hosts for the particular rule

Validations:

  • Must be String

discovery_rule[hostgroup_id]
必填

the hostgroup that is used to auto provision a host

Validations:

  • Must be Integer

discovery_rule[hostname]
选填 , 允许空值

defines a pattern to assign human-readable hostnames to the matching hosts

Validations:

  • Must be String

discovery_rule[max_count]
选填 , 允许空值

enables to limit maximum amount of provisioned hosts per rule

Validations:

  • Must be Integer

discovery_rule[priority]
选填 , 允许空值

puts the rules in order, low numbers go first. Must be greater then zero

Validations:

  • Must be Integer

discovery_rule[enabled]
选填 , 允许空值

flag is used for temporary shutdown of rules

Validations:

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


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]
选填

represents rule name shown to the users

Validations:

  • Must be String

discovery_rule[search]
选填

query to match discovered hosts for the particular rule

Validations:

  • Must be String

discovery_rule[hostgroup_id]
选填

the hostgroup that is used to auto provision a host

Validations:

  • Must be Integer

discovery_rule[hostname]
选填 , 允许空值

defines a pattern to assign human-readable hostnames to the matching hosts

Validations:

  • Must be String

discovery_rule[max_count]
选填 , 允许空值

enables to limit maximum amount of provisioned hosts per rule

Validations:

  • Must be Integer

discovery_rule[priority]
选填 , 允许空值

puts the rules in order, low numbers go first. Must be greater then zero

Validations:

  • Must be Integer

discovery_rule[enabled]
选填 , 允许空值

flag is used for temporary shutdown of rules

Validations:

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


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.