10.7. Displaying currently configured resource defaults
The pcs resource defaults [config] command displays a list of currently configured default values for resource options, including any rules that you specified. You can display the output of this command in text, JSON, and command formats.
-
Specifying
--output-format=textdisplays the configured resource defaults in plain text format, which is the default value for this option. -
Specifying
--output-format=cmddisplays thepcs resource defaultscommands created from the current cluster defaults configuration. You can use these commands to re-create configured resource defaults on a different system. -
Specifying
--output-format=jsondisplays the configured resource defaults in JSON format, which is suitable for machine parsing.
The following example procedure shows the three different output formats of the pcs resource defaults config command after you reset the default values for a resource.
Procedure
Reset the default values for or any
ocf:pacemaker:pgsqlresource.# pcs resource defaults set create id=set-1 score=100 meta resource-stickiness=10 rule resource ocf:pacemaker:pgsqlDisplay the configured resource default values in plain text.
# pcs resource defaults config Meta Attrs: build-resource-defaults resource-stickiness=1 Meta Attrs: set-1 score=100 resource-stickiness=10 Rule: boolean-op=and score=INFINITY Expression: resource ocf:pacemaker:pgsqlDisplay the
pcs resource defaultscommands created from the current cluster defaults configuration.# pcs resource defaults config --output-format=cmd pcs -- resource defaults set create id=build-resource-defaults \ meta resource-stickiness=1; pcs -- resource defaults set create id=set-1 score=100 \ meta resource-stickiness=10 \ rule 'resource ocf:pacemaker:pgsql'Display the configured resource default values in JSON format.
# pcs resource defaults config --output-format=json {"instance_attributes": [], "meta_attributes": [{"id": "build-resource-defaults", "options": {}, "rule": null, "nvpairs": [{"id": "build-resource-stickiness", "name": "resource-stickiness", "value": "1"}]}, {"id": "set-1", "options": {"score": "100"}, "rule": {"id": "set-1-rule", "type": "RULE", "in_effect": "UNKNOWN", "options": {"boolean-op": "and", "score": "INFINITY"}, "date_spec": null, "duration": null, "expressions": [{"id": "set-1-rule-rsc-ocf-pacemaker-pgsql", "type": "RSC_EXPRESSION", "in_effect": "UNKNOWN", "options": {"class": "ocf", "provider": "pacemaker", "type": "pgsql"}, "date_spec": null, "duration": null, "expressions": [], "as_string": "resource ocf:pacemaker:pgsql"}], "as_string": "resource ocf:pacemaker:pgsql"}, "nvpairs": [{"id": "set-1-resource-stickiness", "name": "resource-stickiness", "value": "10"}]}]}