2.24. hammer discovery-rule


操作发现的规则。

Usage:
    hammer discovery-rule [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 create                        Create a discovery rule
 delete, destroy               Delete a rule
 info, show                    Show a discovery rule
 list, index                   List all discovery rules
 update                        Update a rule

Options:
 -h, --help                    Print help

2.24.1. hammer discovery-rule create

创建发现规则

Usage:
    hammer discovery-rule create [OPTIONS]

Options:
 --enabled ENABLED                         Flag is used for temporary shutdown of rules
                                           One of true/false, yes/no, 1/0.
 --hostgroup HOSTGROUP_NAME                Hostgroup name
 --hostgroup-id HOSTGROUP_ID               The hostgroup that is used to auto provision a host
 --hostgroup-title HOSTGROUP_TITLE         Hostgroup title
 --hostname HOSTNAME                       Defines a pattern to assign human-readable hostnames to the matching hosts
 --hosts-limit HOSTS_LIMIT
 --location LOCATION_NAME                  Set the current location context for the request
 --location-id LOCATION_ID                 Set the current location context for the request
 --location-ids LOCATION_IDS               Location ID for provisioned hosts
                                           Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --location-title LOCATION_TITLE           Set the current location context for the request
 --location-titles LOCATION_TITLES         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --locations LOCATION_NAMES                Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --max-count MAX_COUNT                     Enables to limit maximum amount of provisioned hosts per rule
 --name NAME                               Represents rule name shown to the users
 --organization ORGANIZATION_NAME          Set the current organization context for the request
 --organization-id ORGANIZATION_ID         Set the current organization context for the request
 --organization-ids ORGANIZATION_IDS       Organization ID for provisioned hosts
                                           Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --organization-title ORGANIZATION_TITLE   Set the current organization context for the request
 --organization-titles ORGANIZATION_TITLES Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --organizations ORGANIZATION_NAMES        Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --priority PRIORITY                       Puts the rules in order, low numbers go first. Must be greater then zero
 --search SEARCH                           Query to match discovered hosts for the particular rule
 -h, --help                                Print help

2.24.2. hammer discovery-rule delete

删除规则

Usage:
    hammer discovery-rule <delete|destroy> [OPTIONS]

Options:
 --id ID
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --name NAME                             Name to search by
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 -h, --help                              Print help

2.24.3. hammer discovery-rule info

显示发现规则

Usage:
    hammer discovery-rule <info|show> [OPTIONS]

Options:
 --fields FIELDS                         Show specified fields or predefined field sets only. (See below)
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --id ID
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --name NAME                             Name to search by
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 -h, --help                              Print help

Predefined field sets:
  ------------------|-----|---------|-----
  FIELDS            | ALL | DEFAULT | THIN
  ------------------|-----|---------|-----
  Id                | x   | x       | x
  Name              | x   | x       | x
  Priority          | x   | x       |
  Search            | x   | x       |
  Host group        | x   | x       |
  Hosts limit       | x   | x       |
  Enabled           | x   | x       |
  Hostname template | x   | x       |
  Hosts/            | x   | x       |
  Locations/        | x   | x       |
  Organizations/    | x   | x       |
  ------------------|-----|---------|-----

2.24.4. hammer discovery-rule list

列出所有发现规则

Usage:
    hammer discovery-rule <list|index> [OPTIONS]

Options:
 --fields FIELDS                         Show specified fields or predefined field sets only. (See below)
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
 --location LOCATION_NAME                Set the current location context for the request
 --location-id LOCATION_ID               Set the current location context for the request
 --location-title LOCATION_TITLE         Set the current location context for the request
 --order ORDER                           Sort results
 --organization ORGANIZATION_NAME        Set the current organization context for the request
 --organization-id ORGANIZATION_ID       Set the current organization context for the request
 --organization-title ORGANIZATION_TITLE Set the current organization context for the request
 --page PAGE                             Paginate results
 --per-page PER_PAGE                     Number of entries per request
 --search SEARCH                         Filter results
 -h, --help                              Print help

Predefined field sets:
  ------------|-----|---------|-----
  FIELDS      | ALL | DEFAULT | THIN
  ------------|-----|---------|-----
  Id          | x   | x       | x
  Name        | x   | x       | x
  Priority    | x   | x       |
  Search      | x   | x       |
  Host group  | x   | x       |
  Hosts limit | x   | x       |
  Enabled     | x   | x       |
  ------------|-----|---------|-----

2.24.5. hammer discovery-rule 更新

更新规则

Usage:
    hammer discovery-rule update [OPTIONS]

Options:
 --enabled ENABLED                         Flag is used for temporary shutdown of rules
                                           One of true/false, yes/no, 1/0.
 --hostgroup HOSTGROUP_NAME                Hostgroup name
 --hostgroup-id HOSTGROUP_ID               The hostgroup that is used to auto provision a host
 --hostgroup-title HOSTGROUP_TITLE         Hostgroup title
 --hostname HOSTNAME                       Defines a pattern to assign human-readable hostnames to the matching hosts
 --hosts-limit HOSTS_LIMIT
 --id ID
 --location LOCATION_NAME                  Set the current location context for the request
 --location-id LOCATION_ID                 Set the current location context for the request
 --location-ids LOCATION_IDS               Location ID for provisioned hosts
                                           Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --location-title LOCATION_TITLE           Set the current location context for the request
 --location-titles LOCATION_TITLES         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --locations LOCATION_NAMES                Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --max-count MAX_COUNT                     Enables to limit maximum amount of provisioned hosts per rule
 --name NAME                               Name to search by
 --new-name NEW_NAME                       Represents rule name shown to the users
 --organization ORGANIZATION_NAME          Set the current organization context for the request
 --organization-id ORGANIZATION_ID         Set the current organization context for the request
 --organization-ids ORGANIZATION_IDS       Organization ID for provisioned hosts
                                           Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --organization-title ORGANIZATION_TITLE   Set the current organization context for the request
 --organization-titles ORGANIZATION_TITLES Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --organizations ORGANIZATION_NAMES        Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                           JSON is acceptable and preferred way for complex parameters
 --priority PRIORITY                       Puts the rules in order, low numbers go first. Must be greater then zero
 --search SEARCH                           Query to match discovered hosts for the particular rule
 -h, --help                                Print help
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.