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"}]}]}