From 97571e6ccc9b7fa339a7e27d9b0b9ab782ff3003 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Wed, 16 Jun 2021 13:54:10 -0400
Subject: [PATCH 1/5] Low: schemas: Copy crm_mon.rng in preparation for
changes.
---
xml/api/crm_mon-2.12.rng | 243 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 243 insertions(+)
create mode 100644 xml/api/crm_mon-2.12.rng
diff --git a/xml/api/crm_mon-2.12.rng b/xml/api/crm_mon-2.12.rng
new file mode 100644
index 0000000..ffec923
--- /dev/null
+++ b/xml/api/crm_mon-2.12.rng
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+ <start>
+ <ref name="element-crm-mon"/>
+ </start>
+
+ <define name="element-crm-mon">
+ <optional>
+ <ref name="element-summary" />
+ </optional>
+ <optional>
+ <ref name="nodes-list" />
+ </optional>
+ <optional>
+ <ref name="resources-list" />
+ </optional>
+ <optional>
+ <ref name="node-attributes-list" />
+ </optional>
+ <optional>
+ <ref name="node-history-list" />
+ </optional>
+ <optional>
+ <ref name="failures-list" />
+ </optional>
+ <optional>
+ <ref name="fence-event-list" />
+ </optional>
+ <optional>
+ <ref name="tickets-list" />
+ </optional>
+ <optional>
+ <ref name="bans-list" />
+ </optional>
+ </define>
+
+ <define name="element-summary">
+ <element name="summary">
+ <optional>
+ <element name="stack">
+ <attribute name="type"> <text /> </attribute>
+ </element>
+ </optional>
+ <optional>
+ <element name="current_dc">
+ <attribute name="present"> <data type="boolean" /> </attribute>
+ <optional>
+ <group>
+ <attribute name="version"> <text /> </attribute>
+ <attribute name="name"> <text /> </attribute>
+ <attribute name="id"> <text /> </attribute>
+ <attribute name="with_quorum"> <data type="boolean" /> </attribute>
+ </group>
+ </optional>
+ </element>
+ </optional>
+ <optional>
+ <element name="last_update">
+ <attribute name="time"> <text /> </attribute>
+ </element>
+ <element name="last_change">
+ <attribute name="time"> <text /> </attribute>
+ <attribute name="user"> <text /> </attribute>
+ <attribute name="client"> <text /> </attribute>
+ <attribute name="origin"> <text /> </attribute>
+ </element>
+ </optional>
+ <optional>
+ <element name="nodes_configured">
+ <attribute name="number"> <data type="nonNegativeInteger" /> </attribute>
+ </element>
+ <element name="resources_configured">
+ <attribute name="number"> <data type="nonNegativeInteger" /> </attribute>
+ <attribute name="disabled"> <data type="nonNegativeInteger" /> </attribute>
+ <attribute name="blocked"> <data type="nonNegativeInteger" /> </attribute>
+ </element>
+ </optional>
+ <optional>
+ <element name="cluster_options">
+ <attribute name="stonith-enabled"> <data type="boolean" /> </attribute>
+ <attribute name="symmetric-cluster"> <data type="boolean" /> </attribute>
+ <attribute name="no-quorum-policy"> <text /> </attribute>
+ <attribute name="maintenance-mode"> <data type="boolean" /> </attribute>
+ <attribute name="stop-all-resources"> <data type="boolean" /> </attribute>
+ </element>
+ </optional>
+ </element>
+ </define>
+
+ <define name="resources-list">
+ <element name="resources">
+ <zeroOrMore>
+ <externalRef href="resources-2.4.rng" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="nodes-list">
+ <element name="nodes">
+ <zeroOrMore>
+ <externalRef href="nodes-2.8.rng" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="node-attributes-list">
+ <element name="node_attributes">
+ <zeroOrMore>
+ <externalRef href="node-attrs-2.8.rng" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="node-history-list">
+ <element name="node_history">
+ <zeroOrMore>
+ <ref name="element-node-history" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="failures-list">
+ <element name="failures">
+ <zeroOrMore>
+ <externalRef href="failure-2.8.rng" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="fence-event-list">
+ <element name="fence_history">
+ <optional>
+ <attribute name="status"> <data type="integer" /> </attribute>
+ </optional>
+ <zeroOrMore>
+ <externalRef href="fence-event-2.0.rng" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="tickets-list">
+ <element name="tickets">
+ <zeroOrMore>
+ <ref name="element-ticket" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="bans-list">
+ <element name="bans">
+ <zeroOrMore>
+ <ref name="element-ban" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="element-node-history">
+ <element name="node">
+ <attribute name="name"> <text /> </attribute>
+ <zeroOrMore>
+ <ref name="element-resource-history" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="element-resource-history">
+ <element name="resource_history">
+ <attribute name="id"> <text /> </attribute>
+ <attribute name="orphan"> <data type="boolean" /> </attribute>
+ <optional>
+ <group>
+ <attribute name="migration-threshold"> <data type="nonNegativeInteger" /> </attribute>
+ <optional>
+ <attribute name="fail-count"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="last-failure"> <text /> </attribute>
+ </optional>
+ </group>
+ </optional>
+ <zeroOrMore>
+ <ref name="element-operation-history" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="element-operation-history">
+ <element name="operation_history">
+ <attribute name="call"> <text /> </attribute>
+ <attribute name="task"> <text /> </attribute>
+ <optional>
+ <attribute name="interval"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="last-rc-change"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="last-run"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="exec-time"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="queue-time"> <text /> </attribute>
+ </optional>
+ <attribute name="rc"> <data type="integer" /> </attribute>
+ <attribute name="rc_text"> <text /> </attribute>
+ </element>
+ </define>
+
+ <define name="element-ticket">
+ <element name="ticket">
+ <attribute name="id"> <text /> </attribute>
+ <attribute name="status">
+ <choice>
+ <value>granted</value>
+ <value>revoked</value>
+ </choice>
+ </attribute>
+ <attribute name="standby"> <data type="boolean" /> </attribute>
+ <optional>
+ <attribute name="last-granted"> <text /> </attribute>
+ </optional>
+ </element>
+ </define>
+
+ <define name="element-ban">
+ <element name="ban">
+ <attribute name="id"> <text /> </attribute>
+ <attribute name="resource"> <text /> </attribute>
+ <attribute name="node"> <text /> </attribute>
+ <attribute name="weight"> <data type="integer" /> </attribute>
+ <attribute name="promoted-only"> <data type="boolean" /> </attribute>
+ <!-- DEPRECATED: master_only is a duplicate of promoted-only that is
+ provided solely for API backward compatibility. It will be
+ removed in a future release. Check promoted-only instead.
+ -->
+ <attribute name="master_only"> <data type="boolean" /> </attribute>
+ </element>
+ </define>
+</grammar>
--
1.8.3.1
From da394983f106f974274ddd94675a04c85086010e Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Fri, 18 Jun 2021 15:06:34 -0400
Subject: [PATCH 2/5] Refactor: Split node history out into its own XML schema.
This allows for sharing it between crm_mon and crm_simulate.
---
xml/Makefile.am | 2 +-
xml/api/crm_mon-2.12.rng | 64 +--------------------------------------
xml/api/node-history-2.12.rng | 70 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 72 insertions(+), 64 deletions(-)
create mode 100644 xml/api/node-history-2.12.rng
diff --git a/xml/Makefile.am b/xml/Makefile.am
index b9448d4..8e7b6d3 100644
--- a/xml/Makefile.am
+++ b/xml/Makefile.am
@@ -64,7 +64,7 @@ API_request_base = command-output \
CIB_cfg_base = options nodes resources constraints fencing acls tags alerts
# Names of all schemas (including top level and those included by others)
-API_base = $(API_request_base) fence-event failure generic-list item node-attrs nodes resources status
+API_base = $(API_request_base) fence-event failure generic-list item node-attrs node-history nodes resources status
CIB_base = cib $(CIB_cfg_base) status score rule nvset
# Static schema files and transforms (only CIB has transforms)
diff --git a/xml/api/crm_mon-2.12.rng b/xml/api/crm_mon-2.12.rng
index ffec923..be14412 100644
--- a/xml/api/crm_mon-2.12.rng
+++ b/xml/api/crm_mon-2.12.rng
@@ -20,7 +20,7 @@
<ref name="node-attributes-list" />
</optional>
<optional>
- <ref name="node-history-list" />
+ <externalRef href="node-history-2.12.rng"/>
</optional>
<optional>
<ref name="failures-list" />
@@ -113,14 +113,6 @@
</element>
</define>
- <define name="node-history-list">
- <element name="node_history">
- <zeroOrMore>
- <ref name="element-node-history" />
- </zeroOrMore>
- </element>
- </define>
-
<define name="failures-list">
<element name="failures">
<zeroOrMore>
@@ -156,60 +148,6 @@
</element>
</define>
- <define name="element-node-history">
- <element name="node">
- <attribute name="name"> <text /> </attribute>
- <zeroOrMore>
- <ref name="element-resource-history" />
- </zeroOrMore>
- </element>
- </define>
-
- <define name="element-resource-history">
- <element name="resource_history">
- <attribute name="id"> <text /> </attribute>
- <attribute name="orphan"> <data type="boolean" /> </attribute>
- <optional>
- <group>
- <attribute name="migration-threshold"> <data type="nonNegativeInteger" /> </attribute>
- <optional>
- <attribute name="fail-count"> <text /> </attribute>
- </optional>
- <optional>
- <attribute name="last-failure"> <text /> </attribute>
- </optional>
- </group>
- </optional>
- <zeroOrMore>
- <ref name="element-operation-history" />
- </zeroOrMore>
- </element>
- </define>
-
- <define name="element-operation-history">
- <element name="operation_history">
- <attribute name="call"> <text /> </attribute>
- <attribute name="task"> <text /> </attribute>
- <optional>
- <attribute name="interval"> <text /> </attribute>
- </optional>
- <optional>
- <attribute name="last-rc-change"> <text /> </attribute>
- </optional>
- <optional>
- <attribute name="last-run"> <text /> </attribute>
- </optional>
- <optional>
- <attribute name="exec-time"> <text /> </attribute>
- </optional>
- <optional>
- <attribute name="queue-time"> <text /> </attribute>
- </optional>
- <attribute name="rc"> <data type="integer" /> </attribute>
- <attribute name="rc_text"> <text /> </attribute>
- </element>
- </define>
-
<define name="element-ticket">
<element name="ticket">
<attribute name="id"> <text /> </attribute>
diff --git a/xml/api/node-history-2.12.rng b/xml/api/node-history-2.12.rng
new file mode 100644
index 0000000..9628000
--- /dev/null
+++ b/xml/api/node-history-2.12.rng
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+ <start>
+ <ref name="node-history-list" />
+ </start>
+
+ <define name="node-history-list">
+ <element name="node_history">
+ <zeroOrMore>
+ <ref name="element-node-history" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="element-node-history">
+ <element name="node">
+ <attribute name="name"> <text /> </attribute>
+ <zeroOrMore>
+ <ref name="element-resource-history" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="element-resource-history">
+ <element name="resource_history">
+ <attribute name="id"> <text /> </attribute>
+ <attribute name="orphan"> <data type="boolean" /> </attribute>
+ <optional>
+ <group>
+ <attribute name="migration-threshold"> <data type="nonNegativeInteger" /> </attribute>
+ <optional>
+ <attribute name="fail-count"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="last-failure"> <text /> </attribute>
+ </optional>
+ </group>
+ </optional>
+ <zeroOrMore>
+ <ref name="element-operation-history" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="element-operation-history">
+ <element name="operation_history">
+ <attribute name="call"> <text /> </attribute>
+ <attribute name="task"> <text /> </attribute>
+ <optional>
+ <attribute name="interval"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="last-rc-change"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="last-run"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="exec-time"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="queue-time"> <text /> </attribute>
+ </optional>
+ <attribute name="rc"> <data type="integer" /> </attribute>
+ <attribute name="rc_text"> <text /> </attribute>
+ </element>
+ </define>
+</grammar>
--
1.8.3.1
From bf72b2615630eef7876e443d60b34d5a316de847 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Wed, 16 Jun 2021 14:09:31 -0400
Subject: [PATCH 3/5] Low: schemas: Copy crm_simulate.rng in preparation for
changes.
---
xml/api/crm_simulate-2.12.rng | 335 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 335 insertions(+)
create mode 100644 xml/api/crm_simulate-2.12.rng
diff --git a/xml/api/crm_simulate-2.12.rng b/xml/api/crm_simulate-2.12.rng
new file mode 100644
index 0000000..9a7612d
--- /dev/null
+++ b/xml/api/crm_simulate-2.12.rng
@@ -0,0 +1,335 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+ <start>
+ <ref name="element-crm-simulate"/>
+ </start>
+
+ <define name="element-crm-simulate">
+ <choice>
+ <ref name="timings-list" />
+ <group>
+ <ref name="cluster-status" />
+ <optional>
+ <ref name="modifications-list" />
+ </optional>
+ <optional>
+ <ref name="allocations-utilizations-list" />
+ </optional>
+ <optional>
+ <ref name="action-list" />
+ </optional>
+ <optional>
+ <ref name="cluster-injected-actions-list" />
+ <ref name="revised-cluster-status" />
+ </optional>
+ </group>
+ </choice>
+ </define>
+
+ <define name="allocations-utilizations-list">
+ <choice>
+ <element name="allocations">
+ <zeroOrMore>
+ <choice>
+ <ref name="element-allocation" />
+ <ref name="element-promotion" />
+ </choice>
+ </zeroOrMore>
+ </element>
+ <element name="utilizations">
+ <zeroOrMore>
+ <choice>
+ <ref name="element-capacity" />
+ <ref name="element-utilization" />
+ </choice>
+ </zeroOrMore>
+ </element>
+ <element name="allocations_utilizations">
+ <zeroOrMore>
+ <choice>
+ <ref name="element-allocation" />
+ <ref name="element-promotion" />
+ <ref name="element-capacity" />
+ <ref name="element-utilization" />
+ </choice>
+ </zeroOrMore>
+ </element>
+ </choice>
+ </define>
+
+ <define name="cluster-status">
+ <element name="cluster_status">
+ <ref name="nodes-list" />
+ <ref name="resources-list" />
+ <optional>
+ <ref name="node-attributes-list" />
+ </optional>
+ <optional>
+ <ref name="failures-list" />
+ </optional>
+ </element>
+ </define>
+
+ <define name="modifications-list">
+ <element name="modifications">
+ <optional>
+ <attribute name="quorum"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="watchdog"> <text /> </attribute>
+ </optional>
+ <zeroOrMore>
+ <ref name="element-inject-modify-node" />
+ </zeroOrMore>
+ <zeroOrMore>
+ <ref name="element-inject-modify-ticket" />
+ </zeroOrMore>
+ <zeroOrMore>
+ <ref name="element-inject-spec" />
+ </zeroOrMore>
+ <zeroOrMore>
+ <ref name="element-inject-attr" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="revised-cluster-status">
+ <element name="revised_cluster_status">
+ <ref name="nodes-list" />
+ <ref name="resources-list" />
+ <optional>
+ <ref name="node-attributes-list" />
+ </optional>
+ <optional>
+ <ref name="failures-list" />
+ </optional>
+ </element>
+ </define>
+
+ <define name="element-inject-attr">
+ <element name="inject_attr">
+ <attribute name="cib_node"> <text /> </attribute>
+ <attribute name="name"> <text /> </attribute>
+ <attribute name="node_path"> <text /> </attribute>
+ <attribute name="value"> <text /> </attribute>
+ </element>
+ </define>
+
+ <define name="element-inject-modify-node">
+ <element name="modify_node">
+ <attribute name="action"> <text /> </attribute>
+ <attribute name="node"> <text /> </attribute>
+ </element>
+ </define>
+
+ <define name="element-inject-spec">
+ <element name="inject_spec">
+ <attribute name="spec"> <text /> </attribute>
+ </element>
+ </define>
+
+ <define name="element-inject-modify-ticket">
+ <element name="modify_ticket">
+ <attribute name="action"> <text /> </attribute>
+ <attribute name="ticket"> <text /> </attribute>
+ </element>
+ </define>
+
+ <define name="cluster-injected-actions-list">
+ <element name="transition">
+ <zeroOrMore>
+ <ref name="element-injected-actions" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="node-attributes-list">
+ <element name="node_attributes">
+ <zeroOrMore>
+ <externalRef href="node-attrs-2.8.rng" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="failures-list">
+ <element name="failures">
+ <zeroOrMore>
+ <externalRef href="failure-2.8.rng" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="nodes-list">
+ <element name="nodes">
+ <zeroOrMore>
+ <externalRef href="nodes-2.8.rng" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="resources-list">
+ <element name="resources">
+ <zeroOrMore>
+ <externalRef href="resources-2.4.rng" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="timings-list">
+ <element name="timings">
+ <zeroOrMore>
+ <ref name="element-timing" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="action-list">
+ <element name="actions">
+ <zeroOrMore>
+ <ref name="element-node-action" />
+ </zeroOrMore>
+ <zeroOrMore>
+ <ref name="element-rsc-action" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="element-allocation">
+ <element name="node_weight">
+ <attribute name="function"> <text /> </attribute>
+ <attribute name="node"> <text /> </attribute>
+ <externalRef href="../score.rng" />
+ <optional>
+ <attribute name="id"> <text /> </attribute>
+ </optional>
+ </element>
+ </define>
+
+ <define name="element-capacity">
+ <element name="capacity">
+ <attribute name="comment"> <text /> </attribute>
+ <attribute name="node"> <text /> </attribute>
+ <zeroOrMore>
+ <element>
+ <anyName />
+ <text />
+ </element>
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="element-inject-cluster-action">
+ <element name="cluster_action">
+ <attribute name="node"> <text /> </attribute>
+ <attribute name="task"> <text /> </attribute>
+ <optional>
+ <attribute name="id"> <text /> </attribute>
+ </optional>
+ </element>
+ </define>
+
+ <define name="element-injected-actions">
+ <choice>
+ <ref name="element-inject-cluster-action" />
+ <ref name="element-inject-fencing-action" />
+ <ref name="element-inject-pseudo-action" />
+ <ref name="element-inject-rsc-action" />
+ </choice>
+ </define>
+
+ <define name="element-inject-fencing-action">
+ <element name="fencing_action">
+ <attribute name="op"> <text /> </attribute>
+ <attribute name="target"> <text /> </attribute>
+ </element>
+ </define>
+
+ <define name="element-node-action">
+ <element name="node_action">
+ <attribute name="node"> <text /> </attribute>
+ <attribute name="reason"> <text /> </attribute>
+ <attribute name="task"> <text /> </attribute>
+ </element>
+ </define>
+
+ <define name="element-promotion">
+ <element name="promotion_score">
+ <attribute name="id"> <text /> </attribute>
+ <externalRef href="../score.rng" />
+ <optional>
+ <attribute name="node"> <text /> </attribute>
+ </optional>
+ </element>
+ </define>
+
+ <define name="element-inject-pseudo-action">
+ <element name="pseudo_action">
+ <attribute name="task"> <text /> </attribute>
+ <optional>
+ <attribute name="node"> <text /> </attribute>
+ </optional>
+ </element>
+ </define>
+
+ <define name="element-inject-rsc-action">
+ <element name="rsc_action">
+ <attribute name="node"> <text /> </attribute>
+ <attribute name="op"> <text /> </attribute>
+ <attribute name="resource"> <text /> </attribute>
+ <optional>
+ <attribute name="interval"> <data type="integer" /> </attribute>
+ </optional>
+ </element>
+ </define>
+
+ <define name="element-timing">
+ <element name="timing">
+ <attribute name="file"> <text /> </attribute>
+ <attribute name="duration"> <data type="double" /> </attribute>
+ </element>
+ </define>
+
+ <define name="element-rsc-action">
+ <element name="rsc_action">
+ <attribute name="action"> <text /> </attribute>
+ <attribute name="resource"> <text /> </attribute>
+ <optional>
+ <attribute name="blocked"> <data type="boolean" /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="dest"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="next-role"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="node"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="reason"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="role"> <text /> </attribute>
+ </optional>
+ <optional>
+ <attribute name="source"> <text /> </attribute>
+ </optional>
+ </element>
+ </define>
+
+ <define name="element-utilization">
+ <element name="utilization">
+ <attribute name="function"> <text /> </attribute>
+ <attribute name="node"> <text /> </attribute>
+ <attribute name="resource"> <text /> </attribute>
+ <zeroOrMore>
+ <element>
+ <anyName />
+ <text />
+ </element>
+ </zeroOrMore>
+ </element>
+ </define>
+</grammar>
--
1.8.3.1
From c46e07788788acf5669e3f89b9344190a91c7331 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Fri, 18 Jun 2021 15:10:19 -0400
Subject: [PATCH 4/5] Feature: tools: Add the node-summary to crm_simulate
output.
If --show-failcounts is given to crm_simulate, it should also display
the node-summary message.
See: rhbz#1686426
---
tools/crm_simulate.c | 7 +++++--
xml/api/crm_simulate-2.12.rng | 3 +++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/tools/crm_simulate.c b/tools/crm_simulate.c
index b4aa9d1..2ea292c 100644
--- a/tools/crm_simulate.c
+++ b/tools/crm_simulate.c
@@ -409,11 +409,14 @@ print_cluster_status(pe_working_set_t * data_set, unsigned int print_opts)
FALSE, FALSE, all, all, FALSE);
if (options.show_attrs) {
- out->message(out, "node-attribute-list", data_set,
- 0, rc == pcmk_rc_ok, FALSE, FALSE, FALSE, all, all);
+ rc = out->message(out, "node-attribute-list", data_set,
+ 0, rc == pcmk_rc_ok, FALSE, FALSE, FALSE, all, all);
}
if (options.show_failcounts) {
+ rc = out->message(out, "node-summary", data_set, all, all,
+ 0, print_opts, FALSE, FALSE, FALSE, FALSE, rc == pcmk_rc_ok);
+
out->message(out, "failed-action-list", data_set, all, all,
rc == pcmk_rc_ok);
}
diff --git a/xml/api/crm_simulate-2.12.rng b/xml/api/crm_simulate-2.12.rng
index 9a7612d..f90bd36 100644
--- a/xml/api/crm_simulate-2.12.rng
+++ b/xml/api/crm_simulate-2.12.rng
@@ -67,6 +67,9 @@
<ref name="node-attributes-list" />
</optional>
<optional>
+ <externalRef href="node-history-2.12.rng" />
+ </optional>
+ <optional>
<ref name="failures-list" />
</optional>
</element>
--
1.8.3.1
From bac50336e0264604716e5997b87ee7e65311b982 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Fri, 18 Jun 2021 15:21:52 -0400
Subject: [PATCH 5/5] Low: libcrmcommon: Increase PCMK__API_VERSION for new
crm_resource output.
See: rhbz#1686426
---
include/crm/common/output_internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/crm/common/output_internal.h b/include/crm/common/output_internal.h
index 0436cde..ba9c423 100644
--- a/include/crm/common/output_internal.h
+++ b/include/crm/common/output_internal.h
@@ -27,7 +27,7 @@ extern "C" {
# include <glib.h>
# include <crm/common/results.h>
-# define PCMK__API_VERSION "2.11"
+# define PCMK__API_VERSION "2.12"
#if defined(PCMK__WITH_ATTRIBUTE_OUTPUT_ARGS)
# define PCMK__OUTPUT_ARGS(ARGS...) __attribute__((output_args(ARGS)))
--
1.8.3.1