22.2.3. 現在設定されているリソース操作のデフォルト値の表示


pcs resource op defaults [config] コマンドは、指定したルールなど、現在設定されているリソース操作のデフォルト値のリストを表示します。Red Hat Enterprise Linux 9.5 以降では、このコマンドの出力をテキスト、JSON、およびコマンド形式で表示できます。

  • --output-format=text を指定すると、設定されているリソース操作のデフォルトがプレーンテキスト形式で表示されます。これはこのオプションのデフォルト値です。
  • --output-format=cmd を指定すると、現在のクラスターのデフォルト設定から作成された pcs resource op defaults コマンドが表示されます。このコマンドを使用すると、別のシステムで設定されたリソース操作のデフォルトを再作成できます。
  • --output-format=json を指定すると、設定されているリソース操作のデフォルトが、マシン解析に適した JSON 形式で表示されます。

以下に、pcs resource op defaults config コマンドの 3 つの異なる出力形式の例を示します。まず、次の例のコマンドを使用して、ocf:pacemaker:podman リソースのデフォルトのリソース操作値をリセットします。

# pcs resource op defaults set create id=op-set-1 score=100 meta timeout=30s rule op monitor and resource ocf:pacemaker:podman
Warning: Defaults do not apply to resources which override them with their own defined values

この例では、設定されているリソース操作のデフォルト値をプレーンテキストで表示します。

# pcs resource op defaults config
Meta Attrs: op-set-1 score=100
  timeout=30s
  Rule: boolean-op=and score=INFINITY
    Expression: op monitor
    Expression: resource ocf:pacemaker:podman

この例では、現在のクラスターのデフォルト設定から作成された pcs resource op defaults コマンドを表示します。

# pcs resource op defaults config --output-format=cmd
pcs -- resource op defaults set create id=op-set-1 score=100 \
  meta timeout=30s \
  rule 'op monitor and resource ocf:pacemaker:podman'

この例では、設定されているリソース操作のデフォルト値を JSON 形式で表示します。

# pcs resource op defaults config --output-format=json
{"instance_attributes": [], "meta_attributes": [{"id": "op-set-1", "options": {"score": "100"}, "rule": {"id": "op-set-1-rule", "type": "RULE", "in_effect": "UNKNOWN", "options": {"boolean-op": "and", "score": "INFINITY"}, "date_spec": null, "duration": null, "expressions": [{"id": "op-set-1-rule-op-monitor", "type": "OP_EXPRESSION", "in_effect": "UNKNOWN", "options": {"name": "monitor"}, "date_spec": null, "duration": null, "expressions": [], "as_string": "op monitor"}, {"id": "op-set-1-rule-rsc-ocf-pacemaker-podman", "type": "RSC_EXPRESSION", "in_effect": "UNKNOWN", "options": {"class": "ocf", "provider": "pacemaker", "type": "podman"}, "date_spec": null, "duration": null, "expressions": [], "as_string": "resource ocf:pacemaker:podman"}], "as_string": "op monitor and resource ocf:pacemaker:podman"}, "nvpairs": [{"id": "op-set-1-timeout", "name": "timeout", "value": "30s"}]}]}
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る