diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:53:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:53:20 +0000 |
commit | e5a812082ae033afb1eed82c0f2df3d0f6bdc93f (patch) | |
tree | a6716c9275b4b413f6c9194798b34b91affb3cc7 /xml | |
parent | Initial commit. (diff) | |
download | pacemaker-e5a812082ae033afb1eed82c0f2df3d0f6bdc93f.tar.xz pacemaker-e5a812082ae033afb1eed82c0f2df3d0f6bdc93f.zip |
Adding upstream version 2.1.6.upstream/2.1.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xml')
248 files changed, 31871 insertions, 0 deletions
diff --git a/xml/Makefile.am b/xml/Makefile.am new file mode 100644 index 0000000..70dc8ea --- /dev/null +++ b/xml/Makefile.am @@ -0,0 +1,320 @@ +# +# Copyright 2004-2022 the Pacemaker project contributors +# +# The version control history for this file may have further details. +# +# This source code is licensed under the GNU General Public License version 2 +# or later (GPLv2+) WITHOUT ANY WARRANTY. +# + +include $(top_srcdir)/mk/common.mk + +noarch_pkgconfig_DATA = $(builddir)/pacemaker-schemas.pc + +# Pacemaker has 3 schemas: the CIB schema, the API schema (for command-line +# tool XML output), and a legacy schema for crm_mon --as-xml. +# +# See README.md for details on updating CIB schema files (API is similar) + +# The CIB and crm_mon schemas are installed directly in CRM_SCHEMA_DIRECTORY +# for historical reasons, while the API schema is installed in a subdirectory. +APIdir = $(CRM_SCHEMA_DIRECTORY)/api +CIBdir = $(CRM_SCHEMA_DIRECTORY) +MONdir = $(CRM_SCHEMA_DIRECTORY) + +basexsltdir = $(CRM_SCHEMA_DIRECTORY)/base +dist_basexslt_DATA = $(srcdir)/base/access-render-2.xsl + +# Extract a sorted list of available numeric schema versions +# from filenames like NAME-MAJOR[.MINOR][.MINOR-MINOR].rng +numeric_versions = $(shell ls -1 $(1) \ + | sed -n -e 's/^.*-\([0-9][0-9.]*\).rng$$/\1/p' \ + | sort -u -t. -k 1,1n -k 2,2n -k 3,3n) + +# @COMPAT: pacemaker-next is deprecated since 2.1.5 +version_pairs = $(join \ + $(1),$(addprefix \ + -,$(wordlist \ + 2,$(words $(1)),$(1) \ + ) next \ + ) \ + ) + +version_pairs_last = $(wordlist \ + $(words \ + $(wordlist \ + 2,$(1),$(2) \ + ) \ + ),$(1),$(2) \ + ) + +# NOTE: All files in API_request_base, CIB_cfg_base, API_base, and CIB_base +# need to start with a unique prefix. These variables all get iterated over +# and globbed, and two files starting with the same prefix will cause +# problems. + +# Names of API schemas that form the choices for pacemaker-result content +API_request_base = command-output \ + crm_attribute \ + crm_error \ + crm_mon \ + crm_resource \ + crm_rule \ + crm_shadow \ + crm_simulate \ + crmadmin \ + digests \ + pacemakerd \ + stonith_admin \ + version + +# Names of CIB schemas that form the choices for cib/configuration content +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) \ + any-element \ + failure \ + fence-event \ + generic-list \ + instruction \ + item \ + node-attrs \ + node-history \ + nodes \ + patchset \ + resources \ + status \ + subprocess-output +CIB_base = cib $(CIB_cfg_base) status score rule nvset + +# Static schema files and transforms (only CIB has transforms) +# +# This is more complicated than it should be due to the need to support +# VPATH builds and "make distcheck". We need the absolute paths for reliable +# substitution back and forth, and relative paths for distributed files. +API_abs_files = $(foreach base,$(API_base),$(wildcard $(abs_srcdir)/api/$(base)-*.rng)) +CIB_abs_files = $(foreach base,$(CIB_base),$(wildcard $(abs_srcdir)/$(base).rng $(abs_srcdir)/$(base)-*.rng)) +CIB_abs_xsl = $(abs_srcdir)/upgrade-1.3.xsl \ + $(abs_srcdir)/upgrade-2.10.xsl \ + $(wildcard $(abs_srcdir)/upgrade-*enter.xsl) \ + $(wildcard $(abs_srcdir)/upgrade-*leave.xsl) +MON_abs_files = $(abs_srcdir)/crm_mon.rng +API_files = $(foreach base,$(API_base),$(wildcard $(srcdir)/api/$(base)-*.rng)) +CIB_files = $(foreach base,$(CIB_base),$(wildcard $(srcdir)/$(base).rng $(srcdir)/$(base)-*.rng)) +CIB_xsl = $(srcdir)/upgrade-1.3.xsl \ + $(srcdir)/upgrade-2.10.xsl \ + $(wildcard $(srcdir)/upgrade-*enter.xsl) \ + $(wildcard $(srcdir)/upgrade-*leave.xsl) +MON_files = $(srcdir)/crm_mon.rng + +# Sorted lists of all numeric schema versions +API_numeric_versions = $(call numeric_versions,${API_files}) +CIB_numeric_versions = $(call numeric_versions,${CIB_files}) +MON_numeric_versions = $(call numeric_versions,$(wildcard $(srcdir)/api/crm_mon*.rng)) + +# The highest numeric schema version +API_max ?= $(lastword $(API_numeric_versions)) +CIB_max ?= $(lastword $(CIB_numeric_versions)) +MON_max ?= $(lastword $(MON_numeric_versions)) + +# Sorted lists of all schema versions (including "next") +# @COMPAT: pacemaker-next is deprecated since 2.1.5 +API_versions = next $(API_numeric_versions) +CIB_versions = next $(CIB_numeric_versions) + +# Build tree locations of static schema files and transforms (for VPATH builds) +API_build_copies = $(foreach f,$(API_abs_files),$(subst $(abs_srcdir),$(abs_builddir),$(f))) +CIB_build_copies = $(foreach f,$(CIB_abs_files) $(CIB_abs_xsl),$(subst $(abs_srcdir),$(abs_builddir),$(f))) +MON_build_copies = $(foreach f,$(MON_abs_files),$(subst $(abs_srcdir),$(abs_builddir),$(f))) + +# Dynamically generated schema files +API_generated = api/api-result.rng $(foreach base,$(API_versions),api/api-result-$(base).rng) +CIB_generated = pacemaker.rng $(foreach base,$(CIB_versions),pacemaker-$(base).rng) versions.rng +MON_generated = crm_mon.rng + +CIB_version_pairs = $(call version_pairs,${CIB_numeric_versions}) +CIB_version_pairs_cnt = $(words ${CIB_version_pairs}) +CIB_version_pairs_last = $(call version_pairs_last,${CIB_version_pairs_cnt},${CIB_version_pairs}) + +dist_API_DATA = $(API_files) +dist_CIB_DATA = $(CIB_files) $(CIB_xsl) + +nodist_API_DATA = $(API_generated) +nodist_CIB_DATA = $(CIB_generated) +nodist_MON_DATA = $(MON_generated) + +EXTRA_DIST = README.md \ + best-match.sh \ + cibtr-2.rng \ + context-of.xsl \ + ocf-meta2man.xsl \ + regression.sh \ + upgrade-2.10-roundtrip.xsl \ + upgrade-detail.xsl \ + xslt_cibtr-2.rng \ + assets \ + test-2 \ + test-2-enter \ + test-2-leave \ + test-2-roundtrip + +cib-versions: + @echo "Max: $(CIB_max)" + @echo "Available: $(CIB_versions)" + +api-versions: + @echo "Max: $(API_max)" + @echo "Available: $(API_versions)" + +# Dynamically generated top-level API schema +api/api-result.rng: api/api-result-$(API_max).rng + $(AM_V_at)$(MKDIR_P) api # might not exist in VPATH build + $(AM_V_SCHEMA)cp $(top_builddir)/xml/$< $@ + +api/api-result-%.rng: $(API_build_copies) best-match.sh Makefile.am + $(AM_V_at)echo '<?xml version="1.0" encoding="UTF-8"?>' > $@ + $(AM_V_at)echo '<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">' >> $@ + $(AM_V_at)echo ' <start>' >> $@ + $(AM_V_at)echo ' <element name="pacemaker-result">' >> $@ + $(AM_V_at)echo ' <attribute name="api-version"> <text /> </attribute>' >> $@ + $(AM_V_at)echo ' <attribute name="request"> <text /> </attribute>' >> $@ + $(AM_V_at)echo ' <optional>' >> $@ + $(AM_V_at)echo ' <choice>' >> $@ + $(AM_V_at)for rng in $(API_request_base); do $(srcdir)/best-match.sh api/$$rng $(*) $(@) " " || :; done + $(AM_V_at)echo ' </choice>' >> $@ + $(AM_V_at)echo ' </optional>' >> $@ + $(AM_V_at)$(srcdir)/best-match.sh api/status $(*) $(@) " " || : + $(AM_V_at)echo ' </element>' >> $@ + $(AM_V_at)echo ' </start>' >> $@ + $(AM_V_SCHEMA)echo '</grammar>' >> $@ + +crm_mon.rng: api/crm_mon-$(MON_max).rng + $(AM_V_at)echo '<?xml version="1.0" encoding="UTF-8"?>' > $@ + $(AM_V_at)echo '<grammar xmlns="http://relaxng.org/ns/structure/1.0"' >> $@ + $(AM_V_at)echo ' datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">' >> $@ + $(AM_V_at)echo ' <start>' >> $@ + $(AM_V_at)echo ' <ref name="element-crm_mon-old"/>' >> $@ + $(AM_V_at)echo ' </start>' >> $@ + $(AM_V_at)echo ' <define name="element-crm_mon-old">' >> $@ + $(AM_V_at)echo ' <element name="crm_mon">' >> $@ + $(AM_V_at)echo ' <attribute name="version"> <text/> </attribute>' >> $@ + $(AM_V_at)echo ' <externalRef href="$(<)" />' >> $@ + $(AM_V_at)echo ' </element>' >> $@ + $(AM_V_at)echo ' </define>' >> $@ + $(AM_V_SCHEMA)echo '</grammar>' >> $@ + +# Dynamically generated top-level CIB schema +pacemaker.rng: pacemaker-$(CIB_max).rng + $(AM_V_SCHEMA)cp $(top_builddir)/xml/$< $@ + +pacemaker-%.rng: $(CIB_build_copies) best-match.sh Makefile.am + $(AM_V_at)echo '<?xml version="1.0" encoding="UTF-8"?>' > $@ + $(AM_V_at)echo '<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">' >> $@ + $(AM_V_at)echo ' <start>' >> $@ + $(AM_V_at)echo ' <element name="cib">' >> $@ + $(AM_V_at)$(srcdir)/best-match.sh cib $(*) $(@) " " + $(AM_V_at)echo ' <element name="configuration">' >> $@ + $(AM_V_at)echo ' <interleave>' >> $@ + $(AM_V_at)for rng in $(CIB_cfg_base); do $(srcdir)/best-match.sh $$rng $(*) $(@) " " || :; done + $(AM_V_at)echo ' </interleave>' >> $@ + $(AM_V_at)echo ' </element>' >> $@ + $(AM_V_at)echo ' <optional>' >> $@ + $(AM_V_at)echo ' <element name="status">' >> $@ + $(AM_V_at)$(srcdir)/best-match.sh status $(*) $(@) " " + $(AM_V_at)echo ' </element>' >> $@ + $(AM_V_at)echo ' </optional>' >> $@ + $(AM_V_at)echo ' </element>' >> $@ + $(AM_V_at)echo ' </start>' >> $@ + $(AM_V_SCHEMA)echo '</grammar>' >> $@ + +# Dynamically generated CIB schema listing all pacemaker versions +versions.rng: pacemaker-$(CIB_max).rng Makefile.am + $(AM_V_at)echo '<?xml version="1.0" encoding="UTF-8"?>' > $@ + $(AM_V_at)echo '<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">' >> $@ + $(AM_V_at)echo ' <start>' >> $@ + $(AM_V_at)echo ' <interleave>' >> $@ + $(AM_V_at)echo ' <optional>' >> $@ + $(AM_V_at)echo ' <attribute name="validate-with">' >> $@ + $(AM_V_at)echo ' <choice>' >> $@ + $(AM_V_at)echo ' <value>none</value>' >> $@ + $(AM_V_at)echo ' <value>pacemaker-0.6</value>' >> $@ + $(AM_V_at)echo ' <value>transitional-0.6</value>' >> $@ + $(AM_V_at)echo ' <value>pacemaker-0.7</value>' >> $@ + $(AM_V_at)echo ' <value>pacemaker-1.1</value>' >> $@ + $(AM_V_at)for rng in $(CIB_versions); do echo " <value>pacemaker-$$rng</value>" >> $@; done + $(AM_V_at)echo ' </choice>' >> $@ + $(AM_V_at)echo ' </attribute>' >> $@ + $(AM_V_at)echo ' </optional>' >> $@ + $(AM_V_at)echo ' <attribute name="admin_epoch"><data type="nonNegativeInteger"/></attribute>' >> $@ + $(AM_V_at)echo ' <attribute name="epoch"><data type="nonNegativeInteger"/></attribute>' >> $@ + $(AM_V_at)echo ' <attribute name="num_updates"><data type="nonNegativeInteger"/></attribute>' >> $@ + $(AM_V_at)echo ' </interleave>' >> $@ + $(AM_V_at)echo ' </start>' >> $@ + $(AM_V_SCHEMA)echo '</grammar>' >> $@ + +# diff fails with ec=2 if no predecessor is found; +# this uses '=' GNU extension to sed, if that's not available, +# one can use: hline=`echo "$${p}" | grep -Fn "$${hunk}" | cut -d: -f1`; +# XXX: use line information from hunk to avoid "not detected" for ambiguity +version_diff = \ + @for p in $(1); do \ + set `echo "$${p}" | tr '-' ' '`; \ + echo "\#\#\# *-$$2.rng vs. predecessor"; \ + for v in *-$$2.rng; do \ + echo "\#\#\#\# $${v} vs. predecessor"; b=`echo "$${v}" | cut -d- -f1`; \ + old=`./best-match.sh $${b} $$1`; \ + p=`diff -u "$${old}" "$${v}" 2>/dev/null`; \ + case $$? in \ + 1) echo "$${p}" | sed -n -e '/^@@ /!d;=;p' \ + -e ':l;n;/^\([- ]\|+.*<[^ />]\+\([^/>]\+="ID\|>$$\)\)/bl;s/^[+ ]\(.*\)/\1/p' \ + | while read hline; do \ + read h && read i || break; \ + iline=`grep -Fn "$${i}" "$${v}" | cut -d: -f1`; \ + ctxt="(not detected)"; \ + if test `echo "$${iline}" | wc -l` -eq 1; then \ + ctxt=`{ sed -n -e "1,$$(($${iline}-1))p" "$${v}"; \ + echo "<inject id=\"GOAL\"/>$${i}"; \ + sed -n -e "$$(($${iline}+1)),$$ p" "$${v}"; \ + } | $(XSLTPROC) --param skip 1 context-of.xsl -`; \ + fi; \ + echo "$${p}" | sed -n -e "$$(($${hline}-2)),$${hline}!d" \ + -e '/^\(+++\|---\)/p'; \ + echo "$${h} context: $${ctxt}"; \ + echo "$${p}" | sed -n -e "1,$${hline}d" \ + -e '/^\(---\|@@ \)/be;p;d;:e;n;be'; \ + done; \ + ;; \ + 2) echo "\#\#\#\#\# $${v} has no predecessor";; \ + esac; \ + done; \ + done + +diff: best-match.sh + @echo "# Comparing changes in + since $(CIB_max)" + $(call version_diff,${CIB_version_pairs_last}) + +fulldiff: best-match.sh + @echo "# Comparing all changes across all the subsequent increments" + $(call version_diff,${CIB_version_pairs}) + +CLEANFILES = $(API_generated) $(CIB_generated) $(MON_generated) + +# Remove pacemaker schema files generated by *any* source version. This allows +# "make -C xml clean" to have the desired effect when checking out an earlier +# revision in a source tree. +clean-local: + if [ "x$(srcdir)" != "x$(builddir)" ]; then \ + rm -f $(API_build_copies) $(CIB_build_copies) $(MON_build_copies); \ + fi + rm -f $(builddir)/pacemaker-[0-9]*.[0-9]*.rng + +# Enable ability to use $@ in prerequisite +.SECONDEXPANSION: + +# For VPATH builds, copy the static schema files into the build tree +$(API_build_copies) $(CIB_build_copies) $(MON_build_copies): $$(subst $(abs_builddir),$(srcdir),$$(@)) + $(AM_V_GEN)if [ "x$(srcdir)" != "x$(builddir)" ]; then \ + $(MKDIR_P) "$(dir $(@))"; \ + cp "$(<)" "$(@)"; \ + fi diff --git a/xml/README.md b/xml/README.md new file mode 100644 index 0000000..e32edc2 --- /dev/null +++ b/xml/README.md @@ -0,0 +1,136 @@ +# Schema Reference + +Pacemaker's XML schema has a version of its own, independent of the version of +Pacemaker itself. + +## Versioned Schema Evolution + +A versioned schema offers transparent backward and forward compatibility. + +- It reflects the timeline of schema-backed features (introduction, + changes to the syntax, possibly deprecation) through the versioned + stable schema increments, while keeping schema versions used by default + by older Pacemaker versions untouched. + +- Pacemaker internally uses the latest stable schema version, and relies on + supplemental transformations to promote cluster configurations based on + older, incompatible schema versions into the desired form. + +## Mapping Pacemaker Versions to Schema Versions + +| Pacemaker | Latest Schema | Changed +| --------- | ------------- | ---------------------------------------------- +| `2.1.5` | `3.9` | `alerts`, `constraints`, `nodes`, `nvset`, +| | | `options`, `resources`, `rule` +| `2.1.3` | `3.8` | `acls` +| `2.1.0` | `3.7` | `constraints`, `resources` +| `2.0.5` | `3.5` | `api`, `resources`, `rule` +| `2.0.4` | `3.3` | `tags` +| `2.0.1` | `3.2` | `resources` +| `2.0.0` | `3.1` | `constraints`, `resources` +| `1.1.18` | `2.10` | `resources`, `alerts` +| `1.1.17` | `2.9` | `resources`, `rule` +| `1.1.16` | `2.6` | `constraints` +| `1.1.15` | `2.5` | `alerts` +| `1.1.14` | `2.4` | `fencing` +| `1.1.13` | `2.3` | `constraints` +| `1.1.12` | `2.0` | `nodes`, `nvset`, `resources`, `tags`, `acls` +| `1.1.8` | `1.2` | + +## Schema generation + +Each logical portion of the schema goes into its own RNG file, named like +`${base}-${X}.${Y}.rng`. `${base}` identifies the portion of the schema +(e.g. constraints, resources); ${X}.${Y} is the latest schema version that +contained changes in this portion of the schema. + +The complete, overall schema, `pacemaker-${X}.${Y}.rng`, is automatically +generated from the other files via the Makefile. + +# Updating schema files # + +## New features ## + +The current schema version is determined at runtime when +crm\_schema\_init() scans the CRM\_SCHEMA\_DIRECTORY. + +It will have the form `pacemaker-${X}.${Y}` and the highest +`${X}.${Y}` wins. + +### Simple Additions + +When the new syntax is a simple addition to the previous one, create a +new entry, incrementing `${Y}`. + +### Feature Removal or otherwise Incompatible Changes + +When the new syntax is not a simple addition to the previous one, +create a new entry, incrementing `${X}` and setting `${Y} = 0`. + +An XSLT file is also required that converts an old syntax to the new +one and must be named `upgrade-${Xold}.${Yold}.xsl`. + +See `xml/upgrade-1.3.xsl` for an example. + +Since `xml/upgrade-2.10.xsl`, rather self-descriptive approach is taken, +separating metadata of the replacements and other modifications to +perform from the actual executive parts, which is leveraged, e.g., with +the on-the-fly overview as obtained with `./regression.sh -X test2to3`. +Also this was the first time particular key names of `nvpair`s, +i.e. below the granularity of the schemas so far, received attention, +and consequently, no longer expected names became systemically banned +in the after-upgrade schemas, using `<except>` construct in the +data type specification pertaining the affected XML path. + +The implied complexity also resulted in establishing a new compound, +stepwise transformation, alleviating the procedural burden from the +core upgrade recipe. In particular, `id-ref` based syntactic +simplification granted in the CIB format introduces nonnegligible +internal "noise" because of the extra indirection encumbered with +generally non-bijective character of such a scheme (context-dependent +interpretation). To reduce this strain, a symmetric arrangement is +introduced as a pair of _enter_/_leave_ (pre-upgrade/post-upgrade) +transformations where the latter is meant to eventually reversibly +restore what the former intentionally simplified (normalized) for +upgrade transformation's peruse. It's optional (even the post-upgrade +counterpart is optional alone) and depends on whether the suitable +files are found along the upgrade transformation itself: e.g., for +`upgrade-2.10.xsl`, such files are `upgrade-2.10-enter.xsl` and +`upgrade-2.10-leave.xsl`. Note that unfolding + refolding `id-ref` +shortcuts is just a practically imposed individual case of how to +reversibly make the configuration space tractable in the upgrade +itself, allowing for more sophistication down the road. + +### General Procedure + +1. Copy the most recent version of `${base}-*.rng` to `${base}-${X}.${Y}.rng`, + such that the new file name increments the highest number of any schema file, + not just the file being edited. +2. Commit the copy, e.g. `"Low: xml: clone ${base} schema in preparation for + changes"`. This way, the actual change will be obvious in the commit history. +3. Modify `${base}-${X}.${Y}.rng` as required. +4. If required, add an XSLT file, and update `xslt\_SCRIPTS` in `xml/Makefile.am`. +5. Commit. +6. Run `make -C xml clean; make -C xml` to rebuild the schemas in the local +6. Run `make -C xml clean; make -C xml` to rebuild the schemas in the local + source directory. +7. The CIB validity and upgrade regression tests will break after the schema is + updated. Run `cts/cts-cli -s` to make the expected outputs reflect the + changes made so far, and run `git diff` to ensure that these changes look + sane. Finally, commit the changes. +8. Similarly, with the new major version `${X}`, it's advisable to refresh + scheduler tests at some point. See the instructions in `cts/README.md`. + +## Using a New Schema + +New features will not be available until the cluster administrator: + +1. Updates all the nodes +2. Runs the equivalent of `cibadmin --upgrade --force` + +## Random Notes + +From the source directory, run `make -C xml diff` to see the changes +in the current schema (compared to the previous ones). +Alternatively, if the intention is to grok the overall historical schema +evolution, use `make -C xml fulldiff`. diff --git a/xml/acls-1.2.rng b/xml/acls-1.2.rng new file mode 100644 index 0000000..378ce08 --- /dev/null +++ b/xml/acls-1.2.rng @@ -0,0 +1,68 @@ +<?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> + <optional> + <ref name="element-acls"/> + </optional> + </start> + + <define name="element-acls"> + <element name="acls"> + <zeroOrMore> + <choice> + <element name="acl_user"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <zeroOrMore> + <element name="role_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </zeroOrMore> + <zeroOrMore> + <ref name="element-acl"/> + </zeroOrMore> + </choice> + </element> + <element name="acl_role"> + <attribute name="id"><data type="ID"/></attribute> + <zeroOrMore> + <ref name="element-acl"/> + </zeroOrMore> + </element> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-acl"> + <choice> + <element name="read"> + <ref name="attribute-acl"/> + </element> + <element name="write"> + <ref name="attribute-acl"/> + </element> + <element name="deny"> + <ref name="attribute-acl"/> + </element> + </choice> + </define> + + <define name="attribute-acl"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="tag"><text/></attribute> + <attribute name="ref"><data type="IDREF"/></attribute> + <group> + <attribute name="tag"><text/></attribute> + <attribute name="ref"><data type="IDREF"/></attribute> + </group> + <attribute name="xpath"><text/></attribute> + </choice> + <optional> + <attribute name="attribute"><text/></attribute> + </optional> + </define> + +</grammar> diff --git a/xml/acls-2.0.rng b/xml/acls-2.0.rng new file mode 100644 index 0000000..0fe6eed --- /dev/null +++ b/xml/acls-2.0.rng @@ -0,0 +1,80 @@ +<?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> + <optional> + <ref name="element-acls"/> + </optional> + </start> + + <define name="element-acls"> + <element name="acls"> + <zeroOrMore> + <choice> + <element name="acl_target"> + <attribute name="id"><text/></attribute> + <zeroOrMore> + <element name="role"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </zeroOrMore> + </element> + <element name="acl_group"> + <!-- Here 'id' is the name of a unix group --> + <attribute name="id"><data type="ID"/></attribute> + <zeroOrMore> + <element name="role"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </zeroOrMore> + </element> + <element name="acl_role"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <zeroOrMore> + <ref name="element-permission"/> + </zeroOrMore> + </element> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-permission"> + <element name="acl_permission"> + <attribute name="id"><data type="ID"/></attribute> + + <attribute name="kind"> + <choice> + <value>read</value> + <value>write</value> + <value>deny</value> + </choice> + </attribute> + + <choice> + <attribute name="xpath"><text/></attribute> + <!-- reference is already sufficiently specific without 'object-type' --> + <attribute name="reference"><data type="IDREF"/></attribute> + <group> + <!-- Use 'object-type' to avoid conflicting with the 'tag' configuration concept --> + <attribute name="object-type"><text/></attribute> + <optional> + <!-- + does not make sense with anything other than object-type + xpath and reference are already sufficiently specific + --> + <attribute name="attribute"><text/></attribute> + </optional> + </group> + </choice> + + <optional> + <attribute name="description"><text/></attribute> + </optional> + </element> + </define> + +</grammar> diff --git a/xml/acls-3.8.rng b/xml/acls-3.8.rng new file mode 100644 index 0000000..48bcdff --- /dev/null +++ b/xml/acls-3.8.rng @@ -0,0 +1,86 @@ +<?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> + <optional> + <ref name="element-acls"/> + </optional> + </start> + + <define name="element-acls"> + <element name="acls"> + <zeroOrMore> + <choice> + <element name="acl_target"> + <attribute name="id"><text/></attribute> + <optional> + <attribute name="name"><text/></attribute> + </optional> + <zeroOrMore> + <element name="role"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </zeroOrMore> + </element> + <element name="acl_group"> + <!-- Here 'id' is the name of a unix group --> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="name"><text/></attribute> + </optional> + <zeroOrMore> + <element name="role"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </zeroOrMore> + </element> + <element name="acl_role"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <zeroOrMore> + <ref name="element-permission"/> + </zeroOrMore> + </element> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-permission"> + <element name="acl_permission"> + <attribute name="id"><data type="ID"/></attribute> + + <attribute name="kind"> + <choice> + <value>read</value> + <value>write</value> + <value>deny</value> + </choice> + </attribute> + + <choice> + <attribute name="xpath"><text/></attribute> + <!-- reference is already sufficiently specific without 'object-type' --> + <attribute name="reference"><data type="IDREF"/></attribute> + <group> + <!-- Use 'object-type' to avoid conflicting with the 'tag' configuration concept --> + <attribute name="object-type"><text/></attribute> + <optional> + <!-- + does not make sense with anything other than object-type + xpath and reference are already sufficiently specific + --> + <attribute name="attribute"><text/></attribute> + </optional> + </group> + </choice> + + <optional> + <attribute name="description"><text/></attribute> + </optional> + </element> + </define> + +</grammar> diff --git a/xml/alerts-2.10.rng b/xml/alerts-2.10.rng new file mode 100644 index 0000000..ca3cdf8 --- /dev/null +++ b/xml/alerts-2.10.rng @@ -0,0 +1,82 @@ +<?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-alerts"/> + </start> + + <define name="element-alerts"> + <optional> + <element name="alerts"> + <zeroOrMore> + <element name="alert"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <!-- path to the script called for alert --> + <attribute name="path"><text/></attribute> + <interleave> + <ref name="element-alert-extra"/> + <optional> + <element name="select"> + <interleave> + <optional> + <element name="select_attributes"> + <zeroOrMore> + <element name="attribute"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="select_fencing"> + <empty/> + </element> + </optional> + <optional> + <element name="select_nodes"> + <empty/> + </element> + </optional> + <optional> + <element name="select_resources"> + <empty/> + </element> + </optional> + </interleave> + </element> + </optional> + <zeroOrMore> + <element name="recipient"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <attribute name="value"><text/></attribute> + <ref name="element-alert-extra"/> + </element> + </zeroOrMore> + </interleave> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-alert-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-2.9.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-2.9.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + +</grammar> diff --git a/xml/alerts-2.5.rng b/xml/alerts-2.5.rng new file mode 100644 index 0000000..15d72f2 --- /dev/null +++ b/xml/alerts-2.5.rng @@ -0,0 +1,49 @@ +<?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-alerts"/> + </start> + + <define name="element-alerts"> + <optional> + <element name="alerts"> + <zeroOrMore> + <element name="alert"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <!-- path to the script called for alert --> + <attribute name="path"><text/></attribute> + <ref name="element-alert-extra"/> + <zeroOrMore> + <element name="recipient"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <attribute name="value"><text/></attribute> + <ref name="element-alert-extra"/> + </element> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-alert-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-1.3.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-1.3.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + +</grammar> diff --git a/xml/alerts-2.9.rng b/xml/alerts-2.9.rng new file mode 100644 index 0000000..89f12e8 --- /dev/null +++ b/xml/alerts-2.9.rng @@ -0,0 +1,49 @@ +<?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-alerts"/> + </start> + + <define name="element-alerts"> + <optional> + <element name="alerts"> + <zeroOrMore> + <element name="alert"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <!-- path to the script called for alert --> + <attribute name="path"><text/></attribute> + <ref name="element-alert-extra"/> + <zeroOrMore> + <element name="recipient"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <attribute name="value"><text/></attribute> + <ref name="element-alert-extra"/> + </element> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-alert-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-2.9.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-2.9.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + +</grammar> diff --git a/xml/alerts-3.5.rng b/xml/alerts-3.5.rng new file mode 100644 index 0000000..32e7b5d --- /dev/null +++ b/xml/alerts-3.5.rng @@ -0,0 +1,82 @@ +<?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-alerts"/> + </start> + + <define name="element-alerts"> + <optional> + <element name="alerts"> + <zeroOrMore> + <element name="alert"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <!-- path to the script called for alert --> + <attribute name="path"><text/></attribute> + <interleave> + <ref name="element-alert-extra"/> + <optional> + <element name="select"> + <interleave> + <optional> + <element name="select_attributes"> + <zeroOrMore> + <element name="attribute"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="select_fencing"> + <empty/> + </element> + </optional> + <optional> + <element name="select_nodes"> + <empty/> + </element> + </optional> + <optional> + <element name="select_resources"> + <empty/> + </element> + </optional> + </interleave> + </element> + </optional> + <zeroOrMore> + <element name="recipient"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <attribute name="value"><text/></attribute> + <ref name="element-alert-extra"/> + </element> + </zeroOrMore> + </interleave> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-alert-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + +</grammar> diff --git a/xml/alerts-3.9.rng b/xml/alerts-3.9.rng new file mode 100644 index 0000000..ea25af6 --- /dev/null +++ b/xml/alerts-3.9.rng @@ -0,0 +1,82 @@ +<?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-alerts"/> + </start> + + <define name="element-alerts"> + <optional> + <element name="alerts"> + <zeroOrMore> + <element name="alert"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <!-- path to the script called for alert --> + <attribute name="path"><text/></attribute> + <interleave> + <ref name="element-alert-extra"/> + <optional> + <element name="select"> + <interleave> + <optional> + <element name="select_attributes"> + <zeroOrMore> + <element name="attribute"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="select_fencing"> + <empty/> + </element> + </optional> + <optional> + <element name="select_nodes"> + <empty/> + </element> + </optional> + <optional> + <element name="select_resources"> + <empty/> + </element> + </optional> + </interleave> + </element> + </optional> + <zeroOrMore> + <element name="recipient"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <attribute name="value"><text/></attribute> + <ref name="element-alert-extra"/> + </element> + </zeroOrMore> + </interleave> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-alert-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-3.9.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.9.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + +</grammar> diff --git a/xml/api/any-element-2.30.rng b/xml/api/any-element-2.30.rng new file mode 100644 index 0000000..6d4b1d2 --- /dev/null +++ b/xml/api/any-element-2.30.rng @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <!-- + Generic element (from https://relaxng.org/tutorial-20011203.html#IDAFLZR) + --> + <start> + <ref name="element-any" /> + </start> + + <define name="element-any"> + <element> + <anyName/> + <zeroOrMore> + <choice> + <attribute> <anyName/> <text/> </attribute> + <text/> + <ref name="element-any" /> + </choice> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/api/command-output-1.0.rng b/xml/api/command-output-1.0.rng new file mode 100644 index 0000000..710c134 --- /dev/null +++ b/xml/api/command-output-1.0.rng @@ -0,0 +1,26 @@ +<?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="command-output" /> + </start> + + <define name="command-output"> + <element name="command"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <element name="output"> + <attribute name="source"><value>stdout</value></attribute> + <text /> + </element> + </optional> + <optional> + <element name="output"> + <attribute name="source"><value>stderr</value></attribute> + <text /> + </element> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/command-output-2.23.rng b/xml/api/command-output-2.23.rng new file mode 100644 index 0000000..4de49bd --- /dev/null +++ b/xml/api/command-output-2.23.rng @@ -0,0 +1,14 @@ +<?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="command-output" /> + </start> + + <define name="command-output"> + <element name="command"> + <externalRef href="subprocess-output-2.23.rng" /> + </element> + </define> +</grammar> diff --git a/xml/api/crm_attribute-2.17.rng b/xml/api/crm_attribute-2.17.rng new file mode 100644 index 0000000..9c16ce6 --- /dev/null +++ b/xml/api/crm_attribute-2.17.rng @@ -0,0 +1,31 @@ +<?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_attribute"/> + </start> + + <define name="element-crm_attribute"> + <choice> + <ref name="element-attribute" /> + </choice> + </define> + + <define name="element-attribute"> + <element name="attribute"> + <optional> + <attribute name="scope"> <text /> </attribute> + </optional> + <optional> + <attribute name="id"> <text /> </attribute> + </optional> + <optional> + <attribute name="name"> <text /> </attribute> + </optional> + <optional> + <attribute name="value"> <text /> </attribute> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/crm_attribute-2.18.rng b/xml/api/crm_attribute-2.18.rng new file mode 100644 index 0000000..6c040ea --- /dev/null +++ b/xml/api/crm_attribute-2.18.rng @@ -0,0 +1,32 @@ +<?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_attribute"/> + </start> + + <define name="element-crm_attribute"> + <choice> + <zeroOrMore> + <ref name="element-attribute" /> + </zeroOrMore> + </choice> + </define> + + <define name="element-attribute"> + <element name="attribute"> + <optional> + <attribute name="scope"> <text /> </attribute> + </optional> + <optional> + <attribute name="id"> <text /> </attribute> + </optional> + <attribute name="name"> <text /> </attribute> + <attribute name="value"> <text /> </attribute> + <optional> + <attribute name="host"> <text /> </attribute> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/crm_error-2.23.rng b/xml/api/crm_error-2.23.rng new file mode 100644 index 0000000..8ba6e62 --- /dev/null +++ b/xml/api/crm_error-2.23.rng @@ -0,0 +1,24 @@ +<?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_error" /> + </start> + + <define name="element-crm_error"> + <zeroOrMore> + <ref name="element-result-code" /> + </zeroOrMore> + </define> + + <define name="element-result-code"> + <element name="result-code"> + <attribute name="code"> <data type="integer" /> </attribute> + <attribute name="description"> <text /> </attribute> + <optional> + <attribute name="name"> <text /> </attribute> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/crm_mon-2.0.rng b/xml/api/crm_mon-2.0.rng new file mode 100644 index 0000000..c03cd15 --- /dev/null +++ b/xml/api/crm_mon-2.0.rng @@ -0,0 +1,389 @@ +<?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"> + <ref name="element-summary" /> + <ref name="nodes-list" /> + <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"> + <element name="stack"> + <attribute name="type"> <text /> </attribute> + </element> + <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> + <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> + <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> + <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> + </element> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <ref name="element-resource-list" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <ref name="element-full-node" /> + </zeroOrMore> + </element> + </define> + + <define name="node-attributes-list"> + <element name="node_attributes"> + <zeroOrMore> + <ref name="element-node-with-attributes" /> + </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> + <ref name="element-failure" /> + </zeroOrMore> + </element> + </define> + + <define name="fence-event-list"> + <element name="fence_history"> + <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-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-node-with-attributes"> + <element name="node"> + <attribute name="name"> <text /> </attribute> + <zeroOrMore> + <element name="attribute"> + <attribute name="name"> <text /> </attribute> + <attribute name="value"> <text /> </attribute> + <optional> + <attribute name="expected"> <data type="nonNegativeInteger" /> </attribute> + </optional> + </element> + </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-failure"> + <element name="failure"> + <choice> + <attribute name="op_key"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </choice> + <attribute name="node"> <text /> </attribute> + <attribute name="exitstatus"> <text /> </attribute> + <attribute name="exitreason"> <text /> </attribute> + <attribute name="exitcode"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="call"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="status"> <text /> </attribute> + <optional> + <group> + <attribute name="last-rc-change"> <text /> </attribute> + <attribute name="queued"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="exec"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="interval"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="task"> <text /> </attribute> + </group> + </optional> + </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="master_only"> <data type="boolean" /> </attribute> + </element> + </define> + + <define name="element-resource-list"> + <interleave> + <zeroOrMore> + <ref name="element-bundle" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-clone" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-group" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </interleave> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <attribute name="id"> <text/> </attribute> + <attribute name="type"> + <choice> + <value>docker</value> + <value>rkt</value> + <value>podman</value> + </choice> + </attribute> + <attribute name="image"> <text/> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <zeroOrMore> + <element name="replica"> + <attribute name="id"> <data type="nonNegativeInteger" /> </attribute> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"> <text/> </attribute> + <attribute name="multi_state"> <data type="boolean" /> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"> <text/> </attribute> + <attribute name="number_resources"> <data type="nonNegativeInteger" /> </attribute> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-resource"> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="resource_agent"> <text/> </attribute> + <attribute name="role"> <text/> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <attribute name="active"> <data type="boolean" /> </attribute> + <attribute name="orphaned"> <data type="boolean" /> </attribute> + <optional> + <attribute name="blocked"> <data type="boolean" /> </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <attribute name="nodes_running_on"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="pending"> <text/> </attribute> + </optional> + <zeroOrMore> + <!-- crm_mon prints the node only if group-by-node is false --> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="cached"> <data type="boolean" /> </attribute> + </element> + </zeroOrMore> + </element> + </define> +</grammar> diff --git a/xml/api/crm_mon-2.1.rng b/xml/api/crm_mon-2.1.rng new file mode 100644 index 0000000..56a08a4 --- /dev/null +++ b/xml/api/crm_mon-2.1.rng @@ -0,0 +1,403 @@ +<?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> + </element> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <ref name="element-resource-list" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <ref name="element-full-node" /> + </zeroOrMore> + </element> + </define> + + <define name="node-attributes-list"> + <element name="node_attributes"> + <zeroOrMore> + <ref name="element-node-with-attributes" /> + </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> + <ref name="element-failure" /> + </zeroOrMore> + </element> + </define> + + <define name="fence-event-list"> + <element name="fence_history"> + <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-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-node-with-attributes"> + <element name="node"> + <attribute name="name"> <text /> </attribute> + <zeroOrMore> + <element name="attribute"> + <attribute name="name"> <text /> </attribute> + <attribute name="value"> <text /> </attribute> + <optional> + <attribute name="expected"> <data type="nonNegativeInteger" /> </attribute> + </optional> + </element> + </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-failure"> + <element name="failure"> + <choice> + <attribute name="op_key"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </choice> + <attribute name="node"> <text /> </attribute> + <attribute name="exitstatus"> <text /> </attribute> + <attribute name="exitreason"> <text /> </attribute> + <attribute name="exitcode"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="call"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="status"> <text /> </attribute> + <optional> + <group> + <attribute name="last-rc-change"> <text /> </attribute> + <attribute name="queued"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="exec"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="interval"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="task"> <text /> </attribute> + </group> + </optional> + </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="master_only"> <data type="boolean" /> </attribute> + </element> + </define> + + <define name="element-resource-list"> + <interleave> + <zeroOrMore> + <ref name="element-bundle" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-clone" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-group" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </interleave> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <attribute name="id"> <text/> </attribute> + <attribute name="type"> + <choice> + <value>docker</value> + <value>rkt</value> + <value>podman</value> + </choice> + </attribute> + <attribute name="image"> <text/> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <zeroOrMore> + <element name="replica"> + <attribute name="id"> <data type="nonNegativeInteger" /> </attribute> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"> <text/> </attribute> + <attribute name="multi_state"> <data type="boolean" /> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"> <text/> </attribute> + <attribute name="number_resources"> <data type="nonNegativeInteger" /> </attribute> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-resource"> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="resource_agent"> <text/> </attribute> + <attribute name="role"> <text/> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <attribute name="active"> <data type="boolean" /> </attribute> + <attribute name="orphaned"> <data type="boolean" /> </attribute> + <optional> + <attribute name="blocked"> <data type="boolean" /> </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <attribute name="nodes_running_on"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="pending"> <text/> </attribute> + </optional> + <zeroOrMore> + <!-- crm_mon prints the node only if group-by-node is false --> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="cached"> <data type="boolean" /> </attribute> + </element> + </zeroOrMore> + </element> + </define> +</grammar> diff --git a/xml/api/crm_mon-2.12.rng b/xml/api/crm_mon-2.12.rng new file mode 100644 index 0000000..be14412 --- /dev/null +++ b/xml/api/crm_mon-2.12.rng @@ -0,0 +1,181 @@ +<?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> + <externalRef href="node-history-2.12.rng"/> + </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="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-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> diff --git a/xml/api/crm_mon-2.13.rng b/xml/api/crm_mon-2.13.rng new file mode 100644 index 0000000..0c73457 --- /dev/null +++ b/xml/api/crm_mon-2.13.rng @@ -0,0 +1,183 @@ +<?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> + <externalRef href="node-history-2.12.rng"/> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </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="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-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> diff --git a/xml/api/crm_mon-2.15.rng b/xml/api/crm_mon-2.15.rng new file mode 100644 index 0000000..04aed7e --- /dev/null +++ b/xml/api/crm_mon-2.15.rng @@ -0,0 +1,183 @@ +<?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> + <externalRef href="node-history-2.12.rng"/> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </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="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.15.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-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> diff --git a/xml/api/crm_mon-2.19.rng b/xml/api/crm_mon-2.19.rng new file mode 100644 index 0000000..4d01d1c --- /dev/null +++ b/xml/api/crm_mon-2.19.rng @@ -0,0 +1,183 @@ +<?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> + <externalRef href="node-history-2.12.rng"/> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </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.19.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="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.15.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-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> diff --git a/xml/api/crm_mon-2.2.rng b/xml/api/crm_mon-2.2.rng new file mode 100644 index 0000000..03e60d7 --- /dev/null +++ b/xml/api/crm_mon-2.2.rng @@ -0,0 +1,406 @@ +<?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> + </element> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <ref name="element-resource-list" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <ref name="element-full-node" /> + </zeroOrMore> + </element> + </define> + + <define name="node-attributes-list"> + <element name="node_attributes"> + <zeroOrMore> + <ref name="element-node-with-attributes" /> + </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> + <ref name="element-failure" /> + </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-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-node-with-attributes"> + <element name="node"> + <attribute name="name"> <text /> </attribute> + <zeroOrMore> + <element name="attribute"> + <attribute name="name"> <text /> </attribute> + <attribute name="value"> <text /> </attribute> + <optional> + <attribute name="expected"> <data type="nonNegativeInteger" /> </attribute> + </optional> + </element> + </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-failure"> + <element name="failure"> + <choice> + <attribute name="op_key"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </choice> + <attribute name="node"> <text /> </attribute> + <attribute name="exitstatus"> <text /> </attribute> + <attribute name="exitreason"> <text /> </attribute> + <attribute name="exitcode"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="call"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="status"> <text /> </attribute> + <optional> + <group> + <attribute name="last-rc-change"> <text /> </attribute> + <attribute name="queued"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="exec"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="interval"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="task"> <text /> </attribute> + </group> + </optional> + </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="master_only"> <data type="boolean" /> </attribute> + </element> + </define> + + <define name="element-resource-list"> + <interleave> + <zeroOrMore> + <ref name="element-bundle" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-clone" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-group" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </interleave> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <attribute name="id"> <text/> </attribute> + <attribute name="type"> + <choice> + <value>docker</value> + <value>rkt</value> + <value>podman</value> + </choice> + </attribute> + <attribute name="image"> <text/> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <zeroOrMore> + <element name="replica"> + <attribute name="id"> <data type="nonNegativeInteger" /> </attribute> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"> <text/> </attribute> + <attribute name="multi_state"> <data type="boolean" /> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"> <text/> </attribute> + <attribute name="number_resources"> <data type="nonNegativeInteger" /> </attribute> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-resource"> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="resource_agent"> <text/> </attribute> + <attribute name="role"> <text/> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <attribute name="active"> <data type="boolean" /> </attribute> + <attribute name="orphaned"> <data type="boolean" /> </attribute> + <optional> + <attribute name="blocked"> <data type="boolean" /> </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <attribute name="nodes_running_on"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="pending"> <text/> </attribute> + </optional> + <zeroOrMore> + <!-- crm_mon prints the node only if group-by-node is false --> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="cached"> <data type="boolean" /> </attribute> + </element> + </zeroOrMore> + </element> + </define> +</grammar> diff --git a/xml/api/crm_mon-2.21.rng b/xml/api/crm_mon-2.21.rng new file mode 100644 index 0000000..e99bcc3 --- /dev/null +++ b/xml/api/crm_mon-2.21.rng @@ -0,0 +1,186 @@ +<?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> + <externalRef href="node-history-2.12.rng"/> + </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> + <optional> + <attribute name="mixed_version"> <data type="boolean" /> </attribute> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </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.21.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="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.15.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-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> diff --git a/xml/api/crm_mon-2.24.rng b/xml/api/crm_mon-2.24.rng new file mode 100644 index 0000000..b52307a --- /dev/null +++ b/xml/api/crm_mon-2.24.rng @@ -0,0 +1,186 @@ +<?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> + <externalRef href="node-history-2.12.rng"/> + </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> + <optional> + <attribute name="mixed_version"> <data type="boolean" /> </attribute> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </attribute> + </element> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.24.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <externalRef href="nodes-2.24.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="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.15.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-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> diff --git a/xml/api/crm_mon-2.25.rng b/xml/api/crm_mon-2.25.rng new file mode 100644 index 0000000..1e501dd --- /dev/null +++ b/xml/api/crm_mon-2.25.rng @@ -0,0 +1,189 @@ +<?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> + <externalRef href="pacemakerd-health-2.25.rng" /> + </optional> + <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> + <externalRef href="node-history-2.12.rng"/> + </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> + <optional> + <attribute name="mixed_version"> <data type="boolean" /> </attribute> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </attribute> + </element> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.24.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <externalRef href="nodes-2.24.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="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.15.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-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> diff --git a/xml/api/crm_mon-2.26.rng b/xml/api/crm_mon-2.26.rng new file mode 100644 index 0000000..ac6410c --- /dev/null +++ b/xml/api/crm_mon-2.26.rng @@ -0,0 +1,210 @@ +<?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"> + <choice> + <ref name="element-crm-mon-disconnected" /> + <group> + <optional> + <externalRef href="pacemakerd-health-2.25.rng" /> + </optional> + <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> + <externalRef href="node-history-2.12.rng"/> + </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> + </group> + </choice> + </define> + + <define name="element-crm-mon-disconnected"> + <element name="crm-mon-disconnected"> + <optional> + <attribute name="description"> <text /> </attribute> + </optional> + <optional> + <attribute name="pacemakerd-state"> <text /> </attribute> + </optional> + </element> + </define> + + <define name="element-summary"> + <element name="summary"> + <optional> + <element name="stack"> + <attribute name="type"> <text /> </attribute> + <optional> + <attribute name="pacemakerd-state"> + <text /> + </attribute> + </optional> + </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> + <optional> + <attribute name="mixed_version"> <data type="boolean" /> </attribute> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </attribute> + </element> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.24.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <externalRef href="nodes-2.24.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="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.15.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-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> diff --git a/xml/api/crm_mon-2.27.rng b/xml/api/crm_mon-2.27.rng new file mode 100644 index 0000000..38c1ecf --- /dev/null +++ b/xml/api/crm_mon-2.27.rng @@ -0,0 +1,213 @@ +<?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"> + <choice> + <ref name="element-crm-mon-disconnected" /> + <group> + <optional> + <externalRef href="pacemakerd-health-2.25.rng" /> + </optional> + <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> + <externalRef href="node-history-2.12.rng"/> + </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> + </group> + </choice> + </define> + + <define name="element-crm-mon-disconnected"> + <element name="crm-mon-disconnected"> + <optional> + <attribute name="description"> <text /> </attribute> + </optional> + <optional> + <attribute name="pacemakerd-state"> <text /> </attribute> + </optional> + </element> + </define> + + <define name="element-summary"> + <element name="summary"> + <optional> + <element name="stack"> + <attribute name="type"> <text /> </attribute> + <optional> + <attribute name="pacemakerd-state"> + <text /> + </attribute> + </optional> + </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> + <optional> + <attribute name="mixed_version"> <data type="boolean" /> </attribute> + </optional> + </element> + </optional> + <optional> + <element name="last_update"> + <attribute name="time"> <text /> </attribute> + <optional> + <attribute name="origin"> <text /> </attribute> + </optional> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </attribute> + </element> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.24.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <externalRef href="nodes-2.24.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="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.15.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-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> diff --git a/xml/api/crm_mon-2.28.rng b/xml/api/crm_mon-2.28.rng new file mode 100644 index 0000000..45a6059 --- /dev/null +++ b/xml/api/crm_mon-2.28.rng @@ -0,0 +1,213 @@ +<?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"> + <choice> + <ref name="element-crm-mon-disconnected" /> + <group> + <optional> + <externalRef href="pacemakerd-health-2.25.rng" /> + </optional> + <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> + <externalRef href="node-history-2.12.rng"/> + </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> + </group> + </choice> + </define> + + <define name="element-crm-mon-disconnected"> + <element name="crm-mon-disconnected"> + <optional> + <attribute name="description"> <text /> </attribute> + </optional> + <optional> + <attribute name="pacemakerd-state"> <text /> </attribute> + </optional> + </element> + </define> + + <define name="element-summary"> + <element name="summary"> + <optional> + <element name="stack"> + <attribute name="type"> <text /> </attribute> + <optional> + <attribute name="pacemakerd-state"> + <text /> + </attribute> + </optional> + </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> + <optional> + <attribute name="mixed_version"> <data type="boolean" /> </attribute> + </optional> + </element> + </optional> + <optional> + <element name="last_update"> + <attribute name="time"> <text /> </attribute> + <optional> + <attribute name="origin"> <text /> </attribute> + </optional> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </attribute> + </element> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.28.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <externalRef href="nodes-2.28.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="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.15.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-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> diff --git a/xml/api/crm_mon-2.29.rng b/xml/api/crm_mon-2.29.rng new file mode 100644 index 0000000..9cc554c --- /dev/null +++ b/xml/api/crm_mon-2.29.rng @@ -0,0 +1,213 @@ +<?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"> + <choice> + <ref name="element-crm-mon-disconnected" /> + <group> + <optional> + <externalRef href="pacemakerd-health-2.25.rng" /> + </optional> + <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> + <externalRef href="node-history-2.12.rng"/> + </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> + </group> + </choice> + </define> + + <define name="element-crm-mon-disconnected"> + <element name="crm-mon-disconnected"> + <optional> + <attribute name="description"> <text /> </attribute> + </optional> + <optional> + <attribute name="pacemakerd-state"> <text /> </attribute> + </optional> + </element> + </define> + + <define name="element-summary"> + <element name="summary"> + <optional> + <element name="stack"> + <attribute name="type"> <text /> </attribute> + <optional> + <attribute name="pacemakerd-state"> + <text /> + </attribute> + </optional> + </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> + <optional> + <attribute name="mixed_version"> <data type="boolean" /> </attribute> + </optional> + </element> + </optional> + <optional> + <element name="last_update"> + <attribute name="time"> <text /> </attribute> + <optional> + <attribute name="origin"> <text /> </attribute> + </optional> + </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> + <attribute name="stonith-timeout-ms"> <data type="integer" /> </attribute> + <attribute name="priority-fencing-delay-ms"> <data type="integer" /> </attribute> + </element> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.29.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <externalRef href="nodes-2.29.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="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.15.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-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> diff --git a/xml/api/crm_mon-2.3.rng b/xml/api/crm_mon-2.3.rng new file mode 100644 index 0000000..651ae29 --- /dev/null +++ b/xml/api/crm_mon-2.3.rng @@ -0,0 +1,418 @@ +<?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> + <optional> + <attribute name="stop-all-resources"> <data type="boolean" /> </attribute> + </optional> + </element> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <ref name="element-resource-list" /> + </zeroOrMore> + </element> + </define> + + <define name="nodes-list"> + <element name="nodes"> + <zeroOrMore> + <ref name="element-full-node" /> + </zeroOrMore> + </element> + </define> + + <define name="node-attributes-list"> + <element name="node_attributes"> + <zeroOrMore> + <ref name="element-node-with-attributes" /> + </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> + <ref name="element-failure" /> + </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-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-node-with-attributes"> + <element name="node"> + <attribute name="name"> <text /> </attribute> + <zeroOrMore> + <element name="attribute"> + <attribute name="name"> <text /> </attribute> + <attribute name="value"> <text /> </attribute> + <optional> + <attribute name="expected"> <data type="nonNegativeInteger" /> </attribute> + </optional> + </element> + </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-failure"> + <element name="failure"> + <choice> + <attribute name="op_key"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </choice> + <attribute name="node"> <text /> </attribute> + <attribute name="exitstatus"> <text /> </attribute> + <attribute name="exitreason"> <text /> </attribute> + <attribute name="exitcode"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="call"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="status"> <text /> </attribute> + <optional> + <group> + <attribute name="last-rc-change"> <text /> </attribute> + <attribute name="queued"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="exec"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="interval"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="task"> <text /> </attribute> + </group> + </optional> + </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="master_only"> <data type="boolean" /> </attribute> + </element> + </define> + + <define name="element-resource-list"> + <interleave> + <zeroOrMore> + <ref name="element-bundle" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-clone" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-group" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </interleave> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <attribute name="id"> <text/> </attribute> + <attribute name="type"> + <choice> + <value>docker</value> + <value>rkt</value> + <value>podman</value> + </choice> + </attribute> + <attribute name="image"> <text/> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <zeroOrMore> + <element name="replica"> + <attribute name="id"> <data type="nonNegativeInteger" /> </attribute> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"> <text/> </attribute> + <attribute name="multi_state"> <data type="boolean" /> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <optional> + <attribute name="disabled"> <data type="boolean" /> </attribute> + </optional> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"> <text/> </attribute> + <attribute name="number_resources"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + </optional> + <optional> + <attribute name="disabled"> <data type="boolean" /> </attribute> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-resource"> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="resource_agent"> <text/> </attribute> + <attribute name="role"> <text/> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <attribute name="active"> <data type="boolean" /> </attribute> + <attribute name="orphaned"> <data type="boolean" /> </attribute> + <optional> + <attribute name="blocked"> <data type="boolean" /> </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <attribute name="nodes_running_on"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="pending"> <text/> </attribute> + </optional> + <zeroOrMore> + <!-- crm_mon prints the node only if group-by-node is false --> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="cached"> <data type="boolean" /> </attribute> + </element> + </zeroOrMore> + </element> + </define> +</grammar> diff --git a/xml/api/crm_mon-2.4.rng b/xml/api/crm_mon-2.4.rng new file mode 100644 index 0000000..88973a4 --- /dev/null +++ b/xml/api/crm_mon-2.4.rng @@ -0,0 +1,311 @@ +<?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> + <ref name="element-full-node" /> + </zeroOrMore> + </element> + </define> + + <define name="node-attributes-list"> + <element name="node_attributes"> + <zeroOrMore> + <ref name="element-node-with-attributes" /> + </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> + <ref name="element-failure" /> + </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-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <externalRef href="resources-2.4.rng" /> + </element> + </define> + + <define name="element-node-with-attributes"> + <element name="node"> + <attribute name="name"> <text /> </attribute> + <zeroOrMore> + <element name="attribute"> + <attribute name="name"> <text /> </attribute> + <attribute name="value"> <text /> </attribute> + <optional> + <attribute name="expected"> <data type="nonNegativeInteger" /> </attribute> + </optional> + </element> + </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-failure"> + <element name="failure"> + <choice> + <attribute name="op_key"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </choice> + <attribute name="node"> <text /> </attribute> + <attribute name="exitstatus"> <text /> </attribute> + <attribute name="exitreason"> <text /> </attribute> + <attribute name="exitcode"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="call"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="status"> <text /> </attribute> + <optional> + <group> + <attribute name="last-rc-change"> <text /> </attribute> + <attribute name="queued"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="exec"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="interval"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="task"> <text /> </attribute> + </group> + </optional> + </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="master_only"> <data type="boolean" /> </attribute> + </element> + </define> +</grammar> diff --git a/xml/api/crm_mon-2.7.rng b/xml/api/crm_mon-2.7.rng new file mode 100644 index 0000000..8e6792b --- /dev/null +++ b/xml/api/crm_mon-2.7.rng @@ -0,0 +1,311 @@ +<?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> + <ref name="element-full-node" /> + </zeroOrMore> + </element> + </define> + + <define name="node-attributes-list"> + <element name="node_attributes"> + <zeroOrMore> + <ref name="element-node-with-attributes" /> + </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> + <ref name="element-failure" /> + </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-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <externalRef href="resources-2.4.rng" /> + </element> + </define> + + <define name="element-node-with-attributes"> + <element name="node"> + <attribute name="name"> <text /> </attribute> + <zeroOrMore> + <element name="attribute"> + <attribute name="name"> <text /> </attribute> + <attribute name="value"> <text /> </attribute> + <optional> + <attribute name="expected"> <data type="integer" /> </attribute> + </optional> + </element> + </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-failure"> + <element name="failure"> + <choice> + <attribute name="op_key"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </choice> + <attribute name="node"> <text /> </attribute> + <attribute name="exitstatus"> <text /> </attribute> + <attribute name="exitreason"> <text /> </attribute> + <attribute name="exitcode"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="status"> <text /> </attribute> + <optional> + <group> + <attribute name="last-rc-change"> <text /> </attribute> + <attribute name="queued"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="exec"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="interval"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="task"> <text /> </attribute> + </group> + </optional> + </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="master_only"> <data type="boolean" /> </attribute> + </element> + </define> +</grammar> diff --git a/xml/api/crm_mon-2.8.rng b/xml/api/crm_mon-2.8.rng new file mode 100644 index 0000000..2a3f49e --- /dev/null +++ b/xml/api/crm_mon-2.8.rng @@ -0,0 +1,238 @@ +<?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="master_only"> <data type="boolean" /> </attribute> + </element> + </define> +</grammar> diff --git a/xml/api/crm_mon-2.9.rng b/xml/api/crm_mon-2.9.rng new file mode 100644 index 0000000..ffec923 --- /dev/null +++ b/xml/api/crm_mon-2.9.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> diff --git a/xml/api/crm_resource-2.11.rng b/xml/api/crm_resource-2.11.rng new file mode 100644 index 0000000..aaa54d6 --- /dev/null +++ b/xml/api/crm_resource-2.11.rng @@ -0,0 +1,288 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + <ref name="resource-agent-action" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <choice> + <ref name="no-resource-or-uname"/> + <ref name="resource-and-uname"/> + <ref name="no-resource-but-uname"/> + <ref name="resource-but-no-uname"/> + </choice> + </define> + + <define name="no-resource-or-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-and-uname"> + <element name="reason"> + <attribute name="running_on"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="no-resource-but-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <attribute name="host"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-but-no-uname"> + <element name="reason"> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.4.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.4.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="resource-agent-action"> + <element name="resource-agent-action"> + <attribute name="action"> <text/> </attribute> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="class"> <text/> </attribute> + <attribute name="type"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <optional> + <ref name="overrides-list"/> + </optional> + <ref name="agent-status"/> + <optional> + <choice> + <element name="command"> + <text /> + </element> + <externalRef href="command-output-1.0.rng"/> + </choice> + </optional> + </element> + </define> + + <define name="overrides-list"> + <element name="overrides"> + <zeroOrMore> + <element name="override"> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="name"> <text/> </attribute> + <attribute name="value"> <text/> </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <define name="agent-status"> + <element name="agent-status"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <attribute name="message"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.14.rng b/xml/api/crm_resource-2.14.rng new file mode 100644 index 0000000..6c9d538 --- /dev/null +++ b/xml/api/crm_resource-2.14.rng @@ -0,0 +1,297 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + <ref name="resource-agent-action" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <choice> + <ref name="no-resource-or-uname"/> + <ref name="resource-and-uname"/> + <ref name="no-resource-but-uname"/> + <ref name="resource-but-no-uname"/> + </choice> + </define> + + <define name="no-resource-or-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-and-uname"> + <element name="reason"> + <attribute name="running_on"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="no-resource-but-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <attribute name="host"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-but-no-uname"> + <element name="reason"> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.4.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.4.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="resource-agent-action"> + <element name="resource-agent-action"> + <attribute name="action"> <text/> </attribute> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="class"> <text/> </attribute> + <attribute name="type"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <optional> + <ref name="overrides-list"/> + </optional> + <ref name="agent-status"/> + <optional> + <choice> + <element name="command"> + <text /> + </element> + <externalRef href="command-output-1.0.rng"/> + </choice> + </optional> + </element> + </define> + + <define name="overrides-list"> + <element name="overrides"> + <zeroOrMore> + <element name="override"> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="name"> <text/> </attribute> + <attribute name="value"> <text/> </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <define name="agent-status"> + <element name="agent-status"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <attribute name="message"> <text/> </attribute> + </optional> + <optional> + <attribute name="execution_code"> <data type="integer" /> </attribute> + </optional> + <optional> + <attribute name="execution_message"> <text/> </attribute> + </optional> + <optional> + <attribute name="reason"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.20.rng b/xml/api/crm_resource-2.20.rng new file mode 100644 index 0000000..cd74da0 --- /dev/null +++ b/xml/api/crm_resource-2.20.rng @@ -0,0 +1,303 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + <ref name="resource-agent-action" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <choice> + <ref name="no-resource-or-uname"/> + <ref name="resource-and-uname"/> + <ref name="no-resource-but-uname"/> + <ref name="resource-but-no-uname"/> + </choice> + </define> + + <define name="no-resource-or-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-and-uname"> + <element name="reason"> + <attribute name="running_on"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="no-resource-but-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <attribute name="host"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-but-no-uname"> + <element name="reason"> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.4.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.4.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="resource-agent-action"> + <element name="resource-agent-action"> + <attribute name="action"> <text/> </attribute> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="class"> <text/> </attribute> + <attribute name="type"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <optional> + <ref name="overrides-list"/> + </optional> + <ref name="agent-status"/> + <optional> + <choice> + <element name="command"> + <text /> + </element> + <externalRef href="command-output-1.0.rng"/> + </choice> + </optional> + </element> + </define> + + <define name="overrides-list"> + <element name="overrides"> + <zeroOrMore> + <element name="override"> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="name"> <text/> </attribute> + <attribute name="value"> <text/> </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <define name="agent-status"> + <element name="agent-status"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <attribute name="message"> <text/> </attribute> + </optional> + <optional> + <attribute name="execution_code"> <data type="integer" /> </attribute> + </optional> + <optional> + <attribute name="execution_message"> <text/> </attribute> + </optional> + <optional> + <attribute name="reason"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + + <!-- These synonyms for Promoted/Unpromoted are allowed for + backward compatibility with output from older Pacemaker + versions that used them --> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.22.rng b/xml/api/crm_resource-2.22.rng new file mode 100644 index 0000000..8a46675 --- /dev/null +++ b/xml/api/crm_resource-2.22.rng @@ -0,0 +1,288 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + <ref name="resource-agent-action" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <element name="reason"> + <!-- set only when resource and node are both specified --> + <optional> + <attribute name="running_on"> <text/> </attribute> + </optional> + + <!-- set only when only a resource is specified --> + <optional> + <attribute name="running"> <data type="boolean"/> </attribute> + </optional> + + <choice> + <ref name="reasons-with-no-resource"/> + <ref name="resource-check"/> + </choice> + </element> + </define> + + <define name="reasons-with-no-resource"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <optional> + <attribute name="host"> <text/> </attribute> + </optional> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.4.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + <optional> + <attribute name="unhealthy"><value>true</value></attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.4.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="resource-agent-action"> + <element name="resource-agent-action"> + <attribute name="action"> <text/> </attribute> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="class"> <text/> </attribute> + <attribute name="type"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <optional> + <ref name="overrides-list"/> + </optional> + <ref name="agent-status"/> + <optional> + <choice> + <element name="command"> + <text /> + </element> + <externalRef href="command-output-1.0.rng"/> + </choice> + </optional> + </element> + </define> + + <define name="overrides-list"> + <element name="overrides"> + <zeroOrMore> + <element name="override"> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="name"> <text/> </attribute> + <attribute name="value"> <text/> </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <define name="agent-status"> + <element name="agent-status"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <attribute name="message"> <text/> </attribute> + </optional> + <optional> + <attribute name="execution_code"> <data type="integer" /> </attribute> + </optional> + <optional> + <attribute name="execution_message"> <text/> </attribute> + </optional> + <optional> + <attribute name="reason"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + + <!-- These synonyms for Promoted/Unpromoted are allowed for + backward compatibility with output from older Pacemaker + versions that used them --> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.23.rng b/xml/api/crm_resource-2.23.rng new file mode 100644 index 0000000..f841026 --- /dev/null +++ b/xml/api/crm_resource-2.23.rng @@ -0,0 +1,288 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + <ref name="resource-agent-action" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <element name="reason"> + <!-- set only when resource and node are both specified --> + <optional> + <attribute name="running_on"> <text/> </attribute> + </optional> + + <!-- set only when only a resource is specified --> + <optional> + <attribute name="running"> <data type="boolean"/> </attribute> + </optional> + + <choice> + <ref name="reasons-with-no-resource"/> + <ref name="resource-check"/> + </choice> + </element> + </define> + + <define name="reasons-with-no-resource"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <optional> + <attribute name="host"> <text/> </attribute> + </optional> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.4.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + <optional> + <attribute name="unhealthy"><value>true</value></attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.4.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="resource-agent-action"> + <element name="resource-agent-action"> + <attribute name="action"> <text/> </attribute> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="class"> <text/> </attribute> + <attribute name="type"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <optional> + <ref name="overrides-list"/> + </optional> + <ref name="agent-status"/> + <optional> + <element name="command"> + <choice> + <text /> + <externalRef href="subprocess-output-2.23.rng"/> + </choice> + </element> + </optional> + </element> + </define> + + <define name="overrides-list"> + <element name="overrides"> + <zeroOrMore> + <element name="override"> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="name"> <text/> </attribute> + <attribute name="value"> <text/> </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <define name="agent-status"> + <element name="agent-status"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <attribute name="message"> <text/> </attribute> + </optional> + <optional> + <attribute name="execution_code"> <data type="integer" /> </attribute> + </optional> + <optional> + <attribute name="execution_message"> <text/> </attribute> + </optional> + <optional> + <attribute name="reason"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + + <!-- These synonyms for Promoted/Unpromoted are allowed for + backward compatibility with output from older Pacemaker + versions that used them --> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.24.rng b/xml/api/crm_resource-2.24.rng new file mode 100644 index 0000000..6a3334c --- /dev/null +++ b/xml/api/crm_resource-2.24.rng @@ -0,0 +1,288 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + <ref name="resource-agent-action" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <element name="reason"> + <!-- set only when resource and node are both specified --> + <optional> + <attribute name="running_on"> <text/> </attribute> + </optional> + + <!-- set only when only a resource is specified --> + <optional> + <attribute name="running"> <data type="boolean"/> </attribute> + </optional> + + <choice> + <ref name="reasons-with-no-resource"/> + <ref name="resource-check"/> + </choice> + </element> + </define> + + <define name="reasons-with-no-resource"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <optional> + <attribute name="host"> <text/> </attribute> + </optional> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.24.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + <optional> + <attribute name="unhealthy"><value>true</value></attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.24.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="resource-agent-action"> + <element name="resource-agent-action"> + <attribute name="action"> <text/> </attribute> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="class"> <text/> </attribute> + <attribute name="type"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <optional> + <ref name="overrides-list"/> + </optional> + <ref name="agent-status"/> + <optional> + <element name="command"> + <choice> + <text /> + <externalRef href="subprocess-output-2.23.rng"/> + </choice> + </element> + </optional> + </element> + </define> + + <define name="overrides-list"> + <element name="overrides"> + <zeroOrMore> + <element name="override"> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="name"> <text/> </attribute> + <attribute name="value"> <text/> </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <define name="agent-status"> + <element name="agent-status"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <attribute name="message"> <text/> </attribute> + </optional> + <optional> + <attribute name="execution_code"> <data type="integer" /> </attribute> + </optional> + <optional> + <attribute name="execution_message"> <text/> </attribute> + </optional> + <optional> + <attribute name="reason"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + + <!-- These synonyms for Promoted/Unpromoted are allowed for + backward compatibility with output from older Pacemaker + versions that used them --> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.28.rng b/xml/api/crm_resource-2.28.rng new file mode 100644 index 0000000..901b81d --- /dev/null +++ b/xml/api/crm_resource-2.28.rng @@ -0,0 +1,288 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + <ref name="resource-agent-action" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <element name="reason"> + <!-- set only when resource and node are both specified --> + <optional> + <attribute name="running_on"> <text/> </attribute> + </optional> + + <!-- set only when only a resource is specified --> + <optional> + <attribute name="running"> <data type="boolean"/> </attribute> + </optional> + + <choice> + <ref name="reasons-with-no-resource"/> + <ref name="resource-check"/> + </choice> + </element> + </define> + + <define name="reasons-with-no-resource"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <optional> + <attribute name="host"> <text/> </attribute> + </optional> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.28.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + <optional> + <attribute name="unhealthy"><value>true</value></attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.28.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="resource-agent-action"> + <element name="resource-agent-action"> + <attribute name="action"> <text/> </attribute> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="class"> <text/> </attribute> + <attribute name="type"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <optional> + <ref name="overrides-list"/> + </optional> + <ref name="agent-status"/> + <optional> + <element name="command"> + <choice> + <text /> + <externalRef href="subprocess-output-2.23.rng"/> + </choice> + </element> + </optional> + </element> + </define> + + <define name="overrides-list"> + <element name="overrides"> + <zeroOrMore> + <element name="override"> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="name"> <text/> </attribute> + <attribute name="value"> <text/> </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <define name="agent-status"> + <element name="agent-status"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <attribute name="message"> <text/> </attribute> + </optional> + <optional> + <attribute name="execution_code"> <data type="integer" /> </attribute> + </optional> + <optional> + <attribute name="execution_message"> <text/> </attribute> + </optional> + <optional> + <attribute name="reason"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + + <!-- These synonyms for Promoted/Unpromoted are allowed for + backward compatibility with output from older Pacemaker + versions that used them --> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.29.rng b/xml/api/crm_resource-2.29.rng new file mode 100644 index 0000000..d95fd56 --- /dev/null +++ b/xml/api/crm_resource-2.29.rng @@ -0,0 +1,288 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + <ref name="resource-agent-action" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <element name="reason"> + <!-- set only when resource and node are both specified --> + <optional> + <attribute name="running_on"> <text/> </attribute> + </optional> + + <!-- set only when only a resource is specified --> + <optional> + <attribute name="running"> <data type="boolean"/> </attribute> + </optional> + + <choice> + <ref name="reasons-with-no-resource"/> + <ref name="resource-check"/> + </choice> + </element> + </define> + + <define name="reasons-with-no-resource"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <optional> + <attribute name="host"> <text/> </attribute> + </optional> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.29.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + <optional> + <attribute name="unhealthy"><value>true</value></attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.29.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="resource-agent-action"> + <element name="resource-agent-action"> + <attribute name="action"> <text/> </attribute> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="class"> <text/> </attribute> + <attribute name="type"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <optional> + <ref name="overrides-list"/> + </optional> + <ref name="agent-status"/> + <optional> + <element name="command"> + <choice> + <text /> + <externalRef href="subprocess-output-2.23.rng"/> + </choice> + </element> + </optional> + </element> + </define> + + <define name="overrides-list"> + <element name="overrides"> + <zeroOrMore> + <element name="override"> + <optional> + <attribute name="rsc"> <text/> </attribute> + </optional> + <attribute name="name"> <text/> </attribute> + <attribute name="value"> <text/> </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <define name="agent-status"> + <element name="agent-status"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <attribute name="message"> <text/> </attribute> + </optional> + <optional> + <attribute name="execution_code"> <data type="integer" /> </attribute> + </optional> + <optional> + <attribute name="execution_message"> <text/> </attribute> + </optional> + <optional> + <attribute name="reason"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + + <!-- These synonyms for Promoted/Unpromoted are allowed for + backward compatibility with output from older Pacemaker + versions that used them --> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.4.rng b/xml/api/crm_resource-2.4.rng new file mode 100644 index 0000000..1bcb969 --- /dev/null +++ b/xml/api/crm_resource-2.4.rng @@ -0,0 +1,255 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="colocations-list"> + <element name="colocations"> + <oneOrMore> + <ref name="element-colocation-list"/> + </oneOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <optional> + <ref name="colocations-list"/> + </optional> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <ref name="locations-list"/> + </element> + <optional> + <ref name="colocations-list"/> + </optional> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="locations-list"> + <element name="locations"> + <zeroOrMore> + <element name="location"> + <attribute name="host"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="score"> <text/> </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <choice> + <ref name="no-resource-or-uname"/> + <ref name="resource-and-uname"/> + <ref name="no-resource-but-uname"/> + <ref name="resource-but-no-uname"/> + </choice> + </define> + + <define name="no-resource-or-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-and-uname"> + <element name="reason"> + <attribute name="running_on"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="no-resource-but-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <attribute name="host"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-but-no-uname"> + <element name="reason"> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.4.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.4.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="element-colocation-list"> + <optional> + <element name="colocation"> + <attribute name="peer"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </element> + </optional> + <optional> + <ref name="colocations-list" /> + </optional> + <choice> + <element name="colocation"> + <attribute name="peer"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="score"> <text/> </attribute> + <attribute name="dependends"> + <choice> + <value>needs</value> + <value>with</value> + </choice> + </attribute> + <attribute name="role"> <text/> </attribute> + </element> + <element name="colocation"> + <attribute name="peer"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="score"> <text/> </attribute> + </element> + </choice> + <ref name="locations-list" /> + <optional> + <ref name="colocations-list" /> + </optional> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.6.rng b/xml/api/crm_resource-2.6.rng new file mode 100644 index 0000000..b49e24c --- /dev/null +++ b/xml/api/crm_resource-2.6.rng @@ -0,0 +1,238 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <choice> + <ref name="no-resource-or-uname"/> + <ref name="resource-and-uname"/> + <ref name="no-resource-but-uname"/> + <ref name="resource-but-no-uname"/> + </choice> + </define> + + <define name="no-resource-or-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-and-uname"> + <element name="reason"> + <attribute name="running_on"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="no-resource-but-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <attribute name="host"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-but-no-uname"> + <element name="reason"> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.4.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.4.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_resource-2.7.rng b/xml/api/crm_resource-2.7.rng new file mode 100644 index 0000000..8e386db --- /dev/null +++ b/xml/api/crm_resource-2.7.rng @@ -0,0 +1,238 @@ +<?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-resource"/> + </start> + + <define name="element-crm-resource"> + <choice> + <ref name="agents-list" /> + <ref name="alternatives-list" /> + <ref name="constraints-list" /> + <externalRef href="generic-list-2.4.rng"/> + <element name="metadata"> <text/> </element> + <ref name="locate-list" /> + <ref name="operations-list" /> + <ref name="providers-list" /> + <ref name="reasons-list" /> + <ref name="resource-check" /> + <ref name="resource-config" /> + <ref name="resources-list" /> + </choice> + </define> + + <define name="agents-list"> + <element name="agents"> + <attribute name="standard"> <text/> </attribute> + <optional> + <attribute name="provider"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="agent"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="alternatives-list"> + <element name="providers"> + <attribute name="for"> <text/> </attribute> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="constraints-list"> + <element name="constraints"> + <interleave> + <zeroOrMore> + <ref name="rsc-location" /> + </zeroOrMore> + <zeroOrMore> + <ref name="rsc-colocation" /> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="locate-list"> + <element name="nodes"> + <attribute name="resource"> <text/> </attribute> + <zeroOrMore> + <element name="node"> + <optional> + <attribute name="state"><value>promoted</value></attribute> + </optional> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="rsc-location"> + <element name="rsc_location"> + <attribute name="node"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <externalRef href="../score.rng"/> + </element> + </define> + + <define name="operations-list"> + <element name="operations"> + <oneOrMore> + <ref name="element-operation-list" /> + </oneOrMore> + </element> + </define> + + <define name="providers-list"> + <element name="providers"> + <attribute name="standard"> <value>ocf</value> </attribute> + <optional> + <attribute name="agent"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="provider"> <text/> </element> + </zeroOrMore> + </element> + </define> + + <define name="reasons-list"> + <choice> + <ref name="no-resource-or-uname"/> + <ref name="resource-and-uname"/> + <ref name="no-resource-but-uname"/> + <ref name="resource-but-no-uname"/> + </choice> + </define> + + <define name="no-resource-or-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-and-uname"> + <element name="reason"> + <attribute name="running_on"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="no-resource-but-uname"> + <element name="reason"> + <element name="resources"> + <zeroOrMore> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="running"> <data type="boolean"/> </attribute> + <attribute name="host"> <text/> </attribute> + <ref name="resource-check"/> + </element> + </zeroOrMore> + </element> + </element> + </define> + + <define name="resource-but-no-uname"> + <element name="reason"> + <attribute name="running"> <data type="boolean"/> </attribute> + <ref name="resource-check"/> + </element> + </define> + + <define name="resource-config"> + <element name="resource_config"> + <externalRef href="resources-2.4.rng" /> + <element name="xml"> <text/> </element> + </element> + </define> + + <define name="resource-check"> + <element name="check"> + <attribute name="id"> <text/> </attribute> + <optional> + <choice> + <attribute name="remain_stopped"><value>true</value></attribute> + <attribute name="promotable"><value>false</value></attribute> + </choice> + </optional> + <optional> + <attribute name="unmanaged"><value>true</value></attribute> + </optional> + <optional> + <attribute name="locked-to"> <text/> </attribute> + </optional> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.4.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="rsc-colocation"> + <element name="rsc_colocation"> + <attribute name="id"> <text/> </attribute> + <attribute name="rsc"> <text/> </attribute> + <attribute name="with-rsc"> <text/> </attribute> + <externalRef href="../score.rng"/> + <optional> + <attribute name="node-attribute"> <text/> </attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-operation-list"> + <element name="operation"> + <optional> + <group> + <attribute name="rsc"> <text/> </attribute> + <attribute name="agent"> <text/> </attribute> + </group> + </optional> + <attribute name="op"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="last-rc-change"> <text/> </attribute> + <attribute name="exec-time"> <data type="nonNegativeInteger" /> </attribute> + </optional> + <attribute name="status"> <text/> </attribute> + </element> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> +</grammar> diff --git a/xml/api/crm_rule-2.16.rng b/xml/api/crm_rule-2.16.rng new file mode 100644 index 0000000..d3a5956 --- /dev/null +++ b/xml/api/crm_rule-2.16.rng @@ -0,0 +1,21 @@ +<?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_rule"/> + </start> + + <define name="element-crm_rule"> + <zeroOrMore> + <ref name="element-rule-check" /> + </zeroOrMore> + </define> + + <define name="element-rule-check"> + <element name="rule-check"> + <attribute name="rule-id"> <text /> </attribute> + <attribute name="rc"> <data type="nonNegativeInteger" /> </attribute> + </element> + </define> +</grammar> diff --git a/xml/api/crm_shadow-2.30.rng b/xml/api/crm_shadow-2.30.rng new file mode 100644 index 0000000..f654995 --- /dev/null +++ b/xml/api/crm_shadow-2.30.rng @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <!-- Output of the crm_shadow command --> + <start> + <ref name="element-crm-shadow" /> + </start> + + <define name="element-crm-shadow"> + <optional> + <choice> + <externalRef href="instruction-2.30.rng" /> + <ref name="element-shadow" /> + </choice> + </optional> + </define> + + <define name="element-shadow"> + <element name="shadow"> + <attribute name="instance"> + <text/> + </attribute> + <optional> + <attribute name="file"> + <text/> + </attribute> + </optional> + <optional> + <element name="content"> + <!-- CDATA block containing shadow CIB XML --> + <text/> + </element> + </optional> + <optional> + <element name="xml-patchset"> + <!-- + CDATA block containing the XML patchset (diff) of the + shadow CIB versus the active CIB + --> + <text/> + </element> + </optional> + </element> + </define> + +</grammar> diff --git a/xml/api/crm_simulate-2.12.rng b/xml/api/crm_simulate-2.12.rng new file mode 100644 index 0000000..f90bd36 --- /dev/null +++ b/xml/api/crm_simulate-2.12.rng @@ -0,0 +1,338 @@ +<?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> + <externalRef href="node-history-2.12.rng" /> + </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> diff --git a/xml/api/crm_simulate-2.19.rng b/xml/api/crm_simulate-2.19.rng new file mode 100644 index 0000000..f37a909 --- /dev/null +++ b/xml/api/crm_simulate-2.19.rng @@ -0,0 +1,338 @@ +<?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> + <externalRef href="node-history-2.12.rng" /> + </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.19.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> diff --git a/xml/api/crm_simulate-2.21.rng b/xml/api/crm_simulate-2.21.rng new file mode 100644 index 0000000..75a9b39 --- /dev/null +++ b/xml/api/crm_simulate-2.21.rng @@ -0,0 +1,338 @@ +<?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> + <externalRef href="node-history-2.12.rng" /> + </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.21.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> diff --git a/xml/api/crm_simulate-2.24.rng b/xml/api/crm_simulate-2.24.rng new file mode 100644 index 0000000..5be0afa --- /dev/null +++ b/xml/api/crm_simulate-2.24.rng @@ -0,0 +1,338 @@ +<?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> + <externalRef href="node-history-2.12.rng" /> + </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.24.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.24.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> diff --git a/xml/api/crm_simulate-2.28.rng b/xml/api/crm_simulate-2.28.rng new file mode 100644 index 0000000..58be93d --- /dev/null +++ b/xml/api/crm_simulate-2.28.rng @@ -0,0 +1,338 @@ +<?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> + <externalRef href="node-history-2.12.rng" /> + </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.28.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.28.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> diff --git a/xml/api/crm_simulate-2.29.rng b/xml/api/crm_simulate-2.29.rng new file mode 100644 index 0000000..48cf942 --- /dev/null +++ b/xml/api/crm_simulate-2.29.rng @@ -0,0 +1,338 @@ +<?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> + <externalRef href="node-history-2.12.rng" /> + </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.29.rng" /> + </zeroOrMore> + </element> + </define> + + <define name="resources-list"> + <element name="resources"> + <zeroOrMore> + <externalRef href="resources-2.29.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> diff --git a/xml/api/crm_simulate-2.8.rng b/xml/api/crm_simulate-2.8.rng new file mode 100644 index 0000000..9a7612d --- /dev/null +++ b/xml/api/crm_simulate-2.8.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> diff --git a/xml/api/crmadmin-2.25.rng b/xml/api/crmadmin-2.25.rng new file mode 100644 index 0000000..973f6d4 --- /dev/null +++ b/xml/api/crmadmin-2.25.rng @@ -0,0 +1,61 @@ +<?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-crmadmin"/> + </start> + + <define name="element-crmadmin"> + <optional> + <ref name="element-status" /> + </optional> + <optional> + <externalRef href="pacemakerd-health-2.25.rng" /> + </optional> + <optional> + <ref name="element-dc" /> + </optional> + <optional> + <ref name="crmadmin-nodes-list" /> + </optional> + </define> + + <define name="element-status"> + <element name="crmd"> + <attribute name="node_name"> <text /> </attribute> + <attribute name="state"> <text /> </attribute> + <attribute name="result"> <text /> </attribute> + </element> + </define> + + <define name="element-dc"> + <element name="dc"> + <attribute name="node_name"> <text /> </attribute> + </element> + </define> + + <define name="crmadmin-nodes-list"> + <element name="nodes"> + <zeroOrMore> + <ref name="element-crmadmin-node" /> + </zeroOrMore> + </element> + </define> + + <define name="element-crmadmin-node"> + <element name="node"> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </element> + </define> +</grammar> diff --git a/xml/api/crmadmin-2.4.rng b/xml/api/crmadmin-2.4.rng new file mode 100644 index 0000000..34c9ca4 --- /dev/null +++ b/xml/api/crmadmin-2.4.rng @@ -0,0 +1,68 @@ +<?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-crmadmin"/> + </start> + + <define name="element-crmadmin"> + <optional> + <ref name="element-status" /> + </optional> + <optional> + <ref name="element-pacemakerd" /> + </optional> + <optional> + <ref name="element-dc" /> + </optional> + <optional> + <ref name="crmadmin-nodes-list" /> + </optional> + </define> + + <define name="element-status"> + <element name="crmd"> + <attribute name="node_name"> <text /> </attribute> + <attribute name="state"> <text /> </attribute> + <attribute name="result"> <text /> </attribute> + </element> + </define> + + <define name="element-pacemakerd"> + <element name="pacemakerd"> + <attribute name="state"> <text /> </attribute> + <attribute name="last_updated"> <text /> </attribute> + </element> + </define> + + <define name="element-dc"> + <element name="dc"> + <attribute name="node_name"> <text /> </attribute> + </element> + </define> + + <define name="crmadmin-nodes-list"> + <element name="nodes"> + <zeroOrMore> + <ref name="element-crmadmin-node" /> + </zeroOrMore> + </element> + </define> + + <define name="element-crmadmin-node"> + <element name="node"> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </element> + </define> +</grammar> diff --git a/xml/api/diff-2.30.rng b/xml/api/diff-2.30.rng new file mode 100644 index 0000000..eb130ec --- /dev/null +++ b/xml/api/diff-2.30.rng @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <!-- + CIB XML patchset + + Note: This schema supports only v2-format patchsets. It does not and will + not support the v1 format. If a newer XML patchset format is created in the + future, then this schema should be updated accoridngly, or a new schema + should be created. + --> + <start> + <ref name="element-diff" /> + </start> + + <define name="element-diff"> + <element name="diff"> + <attribute name="format"> <data type="integer" /> </attribute> + <element name="version"> + <element name="source"> + <ref name="attributes-patchset-version" /> + </element> + <element name="target"> + <ref name="attributes-patchset-version" /> + </element> + </element> + <oneOrMore> + <ref name="element-change" /> + </oneOrMore> + </element> + </define> + + <define name="attributes-patchset-version"> + <attribute name="admin_epoch"> <data type="integer" /> </attribute> + <attribute name="epoch"> <data type="integer" /> </attribute> + <attribute name="num_updates"> <data type="integer" /> </attribute> + </define> + + <define name="element-change"> + <choice> + <ref name="element-change-create" /> + <ref name="element-change-delete" /> + <ref name="element-change-modify" /> + <ref name="element-change-move" /> + </choice> + </define> + + <define name="element-change-create"> + <element name="change"> + <attribute name="operation"> <value>create</value> </attribute> + <attribute name="path"> <text/> </attribute> + <attribute name="position"> <data type="integer" /> </attribute> + + <!-- + Copy of the newly created node. To avoid maintenance headaches + like forgetting to update this schema when new CIB element types + are added, we'll simply allow any element here. + --> + <choice> + <externalRef href="any-element-2.30.rng" /> + <text/> + </choice> + </element> + </define> + + <define name="element-change-delete"> + <element name="change"> + <attribute name="operation"> <value>delete</value> </attribute> + <attribute name="path"> <text/> </attribute> + <optional> + <attribute name="position"> <data type="integer" /> </attribute> + </optional> + </element> + </define> + + <define name="element-change-modify"> + <element name="change"> + <attribute name="operation"> <value>modify</value> </attribute> + <attribute name="path"> <text/> </attribute> + <ref name="element-change-list" /> + <ref name="element-change-result" /> + </element> + </define> + + <define name="element-change-move"> + <element name="change"> + <attribute name="operation"> <value>move</value> </attribute> + <attribute name="path"> <text/> </attribute> + <attribute name="position"> <data type="integer" /> </attribute> + </element> + </define> + + <!-- List of modified attributes --> + <define name="element-change-list"> + <element name="change-list"> + <oneOrMore> + <ref name="element-change-attr" /> + </oneOrMore> + </element> + </define> + + <!-- Attribute that has been modified ((re-)set or unset) --> + <define name="element-change-attr"> + <element name="change-attr"> + <attribute name="name"> <text/> </attribute> + <choice> + <group> + <attribute name="operation"> <value>set</value> </attribute> + <attribute name="value"> <text/> </attribute> + </group> + <attribute name="operation"> <value>unset</value> </attribute> + </choice> + </element> + </define> + + <!-- Result of a modification --> + <define name="element-change-result"> + <element name="change-result"> + <!-- The modified element, without children --> + <element> + <anyName /> + <zeroOrMore> + <attribute> <anyName /> <text/> </attribute> + </zeroOrMore> + </element> + </element> + </define> + +</grammar> diff --git a/xml/api/digests-2.6.rng b/xml/api/digests-2.6.rng new file mode 100644 index 0000000..7e843d4 --- /dev/null +++ b/xml/api/digests-2.6.rng @@ -0,0 +1,33 @@ +<?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-digests"/> + </start> + + <define name="element-digests"> + <attribute name="resource"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="task"> <text/> </attribute> + <attribute name="interval"> <text/> </attribute> + <zeroOrMore> + <ref name="element-digest"/> + </zeroOrMore> + </define> + + <define name="element-digest"> + <attribute name="type"> <text/> </attribute> + <attribute name="hash"> <text/> </attribute> + <optional> + <element name="parameters"> + <zeroOrMore> + <attribute> + <anyName/> + <text/> + </attribute> + </zeroOrMore> + </element> + </optional> + </define> +</grammar> diff --git a/xml/api/digests-2.9.rng b/xml/api/digests-2.9.rng new file mode 100644 index 0000000..3d00628 --- /dev/null +++ b/xml/api/digests-2.9.rng @@ -0,0 +1,37 @@ +<?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-digests"/> + </start> + + <define name="element-digests"> + <element name="digests"> + <attribute name="resource"> <text/> </attribute> + <attribute name="node"> <text/> </attribute> + <attribute name="task"> <text/> </attribute> + <attribute name="interval"> <text/> </attribute> + <zeroOrMore> + <ref name="element-digest"/> + </zeroOrMore> + </element> + </define> + + <define name="element-digest"> + <element name="digest"> + <attribute name="type"> <text/> </attribute> + <attribute name="hash"> <text/> </attribute> + <optional> + <element name="parameters"> + <zeroOrMore> + <attribute> + <anyName/> + <text/> + </attribute> + </zeroOrMore> + </element> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/failure-2.8.rng b/xml/api/failure-2.8.rng new file mode 100644 index 0000000..a36d2ea --- /dev/null +++ b/xml/api/failure-2.8.rng @@ -0,0 +1,33 @@ +<?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-failure"/> + </start> + + <define name="element-failure"> + <element name="failure"> + <choice> + <attribute name="op_key"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + </choice> + <attribute name="node"> <text /> </attribute> + <attribute name="exitstatus"> <text /> </attribute> + <attribute name="exitreason"> <text /> </attribute> + <attribute name="exitcode"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="call"> <data type="integer" /> </attribute> + <attribute name="status"> <text /> </attribute> + <optional> + <group> + <attribute name="last-rc-change"> <text /> </attribute> + <attribute name="queued"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="exec"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="interval"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="task"> <text /> </attribute> + </group> + </optional> + </element> + </define> +</grammar> + diff --git a/xml/api/fence-event-2.0.rng b/xml/api/fence-event-2.0.rng new file mode 100644 index 0000000..e54687c --- /dev/null +++ b/xml/api/fence-event-2.0.rng @@ -0,0 +1,33 @@ +<?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="fencing-history-event"/> + </start> + + <define name="fencing-history-event"> + <element name="fence_event"> + <attribute name="status"> + <choice> + <value>failed</value> + <value>success</value> + <value>pending</value> + </choice> + </attribute> + <optional> + <attribute name="extended-status"> <text /> </attribute> + </optional> + <optional> + <attribute name="delegate"> <text /> </attribute> + </optional> + <attribute name="action"> <text /> </attribute> + <attribute name="target"> <text /> </attribute> + <attribute name="client"> <text /> </attribute> + <attribute name="origin"> <text /> </attribute> + <optional> + <attribute name="completed"> <text /> </attribute> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/fence-event-2.15.rng b/xml/api/fence-event-2.15.rng new file mode 100644 index 0000000..8e000ca --- /dev/null +++ b/xml/api/fence-event-2.15.rng @@ -0,0 +1,36 @@ +<?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="fencing-history-event"/> + </start> + + <define name="fencing-history-event"> + <element name="fence_event"> + <attribute name="status"> + <choice> + <value>failed</value> + <value>success</value> + <value>pending</value> + </choice> + </attribute> + <optional> + <attribute name="extended-status"> <text /> </attribute> + </optional> + <optional> + <attribute name="exit-reason"> <text /> </attribute> + </optional> + <optional> + <attribute name="delegate"> <text /> </attribute> + </optional> + <attribute name="action"> <text /> </attribute> + <attribute name="target"> <text /> </attribute> + <attribute name="client"> <text /> </attribute> + <attribute name="origin"> <text /> </attribute> + <optional> + <attribute name="completed"> <text /> </attribute> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/generic-list-2.4.rng b/xml/api/generic-list-2.4.rng new file mode 100644 index 0000000..fee93a9 --- /dev/null +++ b/xml/api/generic-list-2.4.rng @@ -0,0 +1,21 @@ +<?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="generic-list"/> + </start> + + <define name="generic-list"> + <element name="list"> + <attribute name="name"> <text /> </attribute> + <attribute name="count"> <data type="nonNegativeInteger" /> </attribute> + <choice> + <empty/> + <oneOrMore> + <externalRef href="item-1.1.rng"/> + </oneOrMore> + </choice> + </element> + </define> +</grammar> diff --git a/xml/api/instruction-2.30.rng b/xml/api/instruction-2.30.rng new file mode 100644 index 0000000..22f1856 --- /dev/null +++ b/xml/api/instruction-2.30.rng @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <!-- An instruction to the user --> + <start> + <ref name="element-instruction" /> + </start> + + <define name="element-instruction"> + <element name="instruction"> + <text/> + </element> + </define> + +</grammar> diff --git a/xml/api/item-1.1.rng b/xml/api/item-1.1.rng new file mode 100644 index 0000000..1a065ca --- /dev/null +++ b/xml/api/item-1.1.rng @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <!-- list_item() method --> + <start> + <ref name="element-item"/> + </start> + + <define name="element-item"> + <element name="item"> + <optional> + <attribute name="name"> <text /> </attribute> + </optional> + <data type="string"/> + </element> + </define> + +</grammar> diff --git a/xml/api/node-attrs-2.8.rng b/xml/api/node-attrs-2.8.rng new file mode 100644 index 0000000..754ddb9 --- /dev/null +++ b/xml/api/node-attrs-2.8.rng @@ -0,0 +1,24 @@ +<?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-node-with-attributes"/> + </start> + + <define name="element-node-with-attributes"> + <element name="node"> + <attribute name="name"> <text /> </attribute> + <zeroOrMore> + <element name="attribute"> + <attribute name="name"> <text /> </attribute> + <attribute name="value"> <text /> </attribute> + <optional> + <attribute name="expected"> <data type="integer" /> </attribute> + </optional> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> 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> diff --git a/xml/api/nodes-2.19.rng b/xml/api/nodes-2.19.rng new file mode 100644 index 0000000..df4c77f --- /dev/null +++ b/xml/api/nodes-2.19.rng @@ -0,0 +1,51 @@ +<?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-full-node"/> + </start> + + <define name="element-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <optional> + <attribute name="health"> + <choice> + <value>red</value> + <value>yellow</value> + <value>green</value> + </choice> + </attribute> + </optional> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <externalRef href="resources-2.4.rng" /> + </element> + </define> +</grammar> diff --git a/xml/api/nodes-2.21.rng b/xml/api/nodes-2.21.rng new file mode 100644 index 0000000..7e236ba --- /dev/null +++ b/xml/api/nodes-2.21.rng @@ -0,0 +1,54 @@ +<?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-full-node"/> + </start> + + <define name="element-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <optional> + <attribute name="health"> + <choice> + <value>red</value> + <value>yellow</value> + <value>green</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="feature_set"> <text/> </attribute> + </optional> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <externalRef href="resources-2.4.rng" /> + </element> + </define> +</grammar> diff --git a/xml/api/nodes-2.24.rng b/xml/api/nodes-2.24.rng new file mode 100644 index 0000000..9686344 --- /dev/null +++ b/xml/api/nodes-2.24.rng @@ -0,0 +1,54 @@ +<?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-full-node"/> + </start> + + <define name="element-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <optional> + <attribute name="health"> + <choice> + <value>red</value> + <value>yellow</value> + <value>green</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="feature_set"> <text/> </attribute> + </optional> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <externalRef href="resources-2.24.rng" /> + </element> + </define> +</grammar> diff --git a/xml/api/nodes-2.28.rng b/xml/api/nodes-2.28.rng new file mode 100644 index 0000000..19b5c09 --- /dev/null +++ b/xml/api/nodes-2.28.rng @@ -0,0 +1,54 @@ +<?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-full-node"/> + </start> + + <define name="element-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <optional> + <attribute name="health"> + <choice> + <value>red</value> + <value>yellow</value> + <value>green</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="feature_set"> <text/> </attribute> + </optional> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <externalRef href="resources-2.28.rng" /> + </element> + </define> +</grammar> diff --git a/xml/api/nodes-2.29.rng b/xml/api/nodes-2.29.rng new file mode 100644 index 0000000..7dd1798 --- /dev/null +++ b/xml/api/nodes-2.29.rng @@ -0,0 +1,54 @@ +<?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-full-node"/> + </start> + + <define name="element-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <optional> + <attribute name="health"> + <choice> + <value>red</value> + <value>yellow</value> + <value>green</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="feature_set"> <text/> </attribute> + </optional> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <externalRef href="resources-2.29.rng" /> + </element> + </define> +</grammar> diff --git a/xml/api/nodes-2.8.rng b/xml/api/nodes-2.8.rng new file mode 100644 index 0000000..7ef7578 --- /dev/null +++ b/xml/api/nodes-2.8.rng @@ -0,0 +1,42 @@ +<?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-full-node"/> + </start> + + <define name="element-full-node"> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="online"> <data type="boolean" /> </attribute> + <attribute name="standby"> <data type="boolean" /> </attribute> + <attribute name="standby_onfail"> <data type="boolean" /> </attribute> + <attribute name="maintenance"> <data type="boolean" /> </attribute> + <attribute name="pending"> <data type="boolean" /> </attribute> + <attribute name="unclean"> <data type="boolean" /> </attribute> + <attribute name="shutdown"> <data type="boolean" /> </attribute> + <attribute name="expected_up"> <data type="boolean" /> </attribute> + <attribute name="is_dc"> <data type="boolean" /> </attribute> + <attribute name="resources_running"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>member</value> + <value>remote</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <!-- for virtualized pacemaker_remote nodes, crm_mon 1.1.13 uses + "container_id" while later versions use "id_as_resource" --> + <choice> + <attribute name="container_id"> <text/> </attribute> + <attribute name="id_as_resource"> <text/> </attribute> + </choice> + </optional> + <externalRef href="resources-2.4.rng" /> + </element> + </define> +</grammar> diff --git a/xml/api/pacemakerd-2.10.rng b/xml/api/pacemakerd-2.10.rng new file mode 100644 index 0000000..41a11e7 --- /dev/null +++ b/xml/api/pacemakerd-2.10.rng @@ -0,0 +1,28 @@ +<?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-pacemakerd"/> + </start> + + <define name="element-pacemakerd"> + <element name="pacemakerd"> + <attribute name="version"> <text /> </attribute> + <attribute name="build"> <text /> </attribute> + <attribute name="feature_set"> <text /> </attribute> + + <optional> + <ref name="feature-list" /> + </optional> + </element> + </define> + + <define name="feature-list"> + <element name="features"> + <oneOrMore> + <element name="feature"> <text/> </element> + </oneOrMore> + </element> + </define> +</grammar> diff --git a/xml/api/pacemakerd-health-2.25.rng b/xml/api/pacemakerd-health-2.25.rng new file mode 100644 index 0000000..2089b25 --- /dev/null +++ b/xml/api/pacemakerd-health-2.25.rng @@ -0,0 +1,20 @@ +<?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-pacemakerd-health"/> + </start> + + <define name="element-pacemakerd-health"> + <element name="pacemakerd"> + <optional> + <attribute name="sys_from"> <text /> </attribute> + </optional> + <attribute name="state"> <text /> </attribute> + <optional> + <attribute name="last_updated"> <text /> </attribute> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/resources-2.24.rng b/xml/api/resources-2.24.rng new file mode 100644 index 0000000..f8ae6eb --- /dev/null +++ b/xml/api/resources-2.24.rng @@ -0,0 +1,112 @@ +<?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-resource-list"/> + </start> + + <define name="element-resource-list"> + <interleave> + <zeroOrMore> + <ref name="element-bundle" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-clone" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-group" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </interleave> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <attribute name="id"> <text/> </attribute> + <attribute name="type"> + <choice> + <value>docker</value> + <value>rkt</value> + <value>podman</value> + </choice> + </attribute> + <attribute name="image"> <text/> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <zeroOrMore> + <element name="replica"> + <attribute name="id"> <data type="nonNegativeInteger" /> </attribute> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"> <text/> </attribute> + <attribute name="multi_state"> <data type="boolean" /> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="disabled"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"> <text/> </attribute> + <attribute name="number_resources"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="disabled"> <data type="boolean" /> </attribute> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-resource"> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="resource_agent"> <text/> </attribute> + <attribute name="role"> <text/> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <attribute name="active"> <data type="boolean" /> </attribute> + <attribute name="orphaned"> <data type="boolean" /> </attribute> + <optional> + <attribute name="blocked"> <data type="boolean" /> </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <attribute name="nodes_running_on"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="pending"> <text/> </attribute> + </optional> + <optional> + <attribute name="locked_to"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="cached"> <data type="boolean" /> </attribute> + </element> + </zeroOrMore> + <optional> + <element name="xml"> <text/> </element> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/resources-2.28.rng b/xml/api/resources-2.28.rng new file mode 100644 index 0000000..3a79bfd --- /dev/null +++ b/xml/api/resources-2.28.rng @@ -0,0 +1,132 @@ +<?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-resource-list"/> + </start> + + <define name="element-resource-list"> + <interleave> + <zeroOrMore> + <ref name="element-bundle" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-clone" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-group" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </interleave> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <attribute name="id"> <text/> </attribute> + <attribute name="type"> + <choice> + <value>docker</value> + <value>rkt</value> + <value>podman</value> + </choice> + </attribute> + <attribute name="image"> <text/> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <optional> + <attribute name="maintenance"> + <data type="boolean" /> + </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <zeroOrMore> + <element name="replica"> + <attribute name="id"> <data type="nonNegativeInteger" /> </attribute> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"> <text/> </attribute> + <attribute name="multi_state"> <data type="boolean" /> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <optional> + <attribute name="maintenance"> + <data type="boolean" /> + </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="disabled"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"> <text/> </attribute> + <attribute name="number_resources"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="maintenance"> + <data type="boolean" /> + </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="disabled"> <data type="boolean" /> </attribute> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-resource"> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="resource_agent"> <text/> </attribute> + <attribute name="role"> <text/> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <attribute name="active"> <data type="boolean" /> </attribute> + <attribute name="orphaned"> <data type="boolean" /> </attribute> + <optional> + <attribute name="blocked"> <data type="boolean" /> </attribute> + </optional> + <optional> + <attribute name="maintenance"> + <data type="boolean" /> + </attribute> + </optional> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <attribute name="nodes_running_on"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="pending"> <text/> </attribute> + </optional> + <optional> + <attribute name="locked_to"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="cached"> <data type="boolean" /> </attribute> + </element> + </zeroOrMore> + <optional> + <element name="xml"> <text/> </element> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/resources-2.29.rng b/xml/api/resources-2.29.rng new file mode 100644 index 0000000..f4214a7 --- /dev/null +++ b/xml/api/resources-2.29.rng @@ -0,0 +1,152 @@ +<?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-resource-list"/> + </start> + + <define name="element-resource-list"> + <interleave> + <zeroOrMore> + <ref name="element-bundle" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-clone" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-group" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </interleave> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <attribute name="id"> <text/> </attribute> + <attribute name="type"> + <choice> + <value>docker</value> + <value>rkt</value> + <value>podman</value> + </choice> + </attribute> + <attribute name="image"> <text/> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <optional> + <attribute name="maintenance"> + <data type="boolean" /> + </attribute> + </optional> + <optional> + <attribute name="description"> + <text/> + </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <zeroOrMore> + <element name="replica"> + <attribute name="id"> <data type="nonNegativeInteger" /> </attribute> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"> <text/> </attribute> + <attribute name="multi_state"> <data type="boolean" /> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <optional> + <attribute name="maintenance"> + <data type="boolean" /> + </attribute> + </optional> + <optional> + <attribute name="description"> + <text/> + </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="disabled"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"> <text/> </attribute> + <attribute name="number_resources"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="maintenance"> + <data type="boolean" /> + </attribute> + </optional> + <optional> + <attribute name="description"> + <text/> + </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="disabled"> <data type="boolean" /> </attribute> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-resource"> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="resource_agent"> <text/> </attribute> + <attribute name="role"> <text/> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <attribute name="active"> <data type="boolean" /> </attribute> + <attribute name="orphaned"> <data type="boolean" /> </attribute> + <optional> + <attribute name="blocked"> <data type="boolean" /> </attribute> + </optional> + <optional> + <attribute name="maintenance"> + <data type="boolean" /> + </attribute> + </optional> + <optional> + <attribute name="description"> + <text/> + </attribute> + </optional> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <attribute name="nodes_running_on"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="pending"> <text/> </attribute> + </optional> + <optional> + <attribute name="locked_to"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="cached"> <data type="boolean" /> </attribute> + </element> + </zeroOrMore> + <optional> + <element name="xml"> <text/> </element> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/resources-2.4.rng b/xml/api/resources-2.4.rng new file mode 100644 index 0000000..e279583 --- /dev/null +++ b/xml/api/resources-2.4.rng @@ -0,0 +1,109 @@ +<?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-resource-list"/> + </start> + + <define name="element-resource-list"> + <interleave> + <zeroOrMore> + <ref name="element-bundle" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-clone" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-group" /> + </zeroOrMore> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </interleave> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <attribute name="id"> <text/> </attribute> + <attribute name="type"> + <choice> + <value>docker</value> + <value>rkt</value> + <value>podman</value> + </choice> + </attribute> + <attribute name="image"> <text/> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <zeroOrMore> + <element name="replica"> + <attribute name="id"> <data type="nonNegativeInteger" /> </attribute> + <zeroOrMore> + <ref name="element-resource" /> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"> <text/> </attribute> + <attribute name="multi_state"> <data type="boolean" /> </attribute> + <attribute name="unique"> <data type="boolean" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="disabled"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"> <text/> </attribute> + <attribute name="number_resources"> <data type="nonNegativeInteger" /> </attribute> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="disabled"> <data type="boolean" /> </attribute> + <ref name="element-resource-list" /> + </element> + </define> + + <define name="element-resource"> + <element name="resource"> + <attribute name="id"> <text/> </attribute> + <attribute name="resource_agent"> <text/> </attribute> + <attribute name="role"> <text/> </attribute> + <optional> + <attribute name="target_role"> <text/> </attribute> + </optional> + <attribute name="active"> <data type="boolean" /> </attribute> + <attribute name="orphaned"> <data type="boolean" /> </attribute> + <optional> + <attribute name="blocked"> <data type="boolean" /> </attribute> + </optional> + <attribute name="managed"> <data type="boolean" /> </attribute> + <attribute name="failed"> <data type="boolean" /> </attribute> + <attribute name="failure_ignored"> <data type="boolean" /> </attribute> + <attribute name="nodes_running_on"> <data type="nonNegativeInteger" /> </attribute> + <optional> + <attribute name="pending"> <text/> </attribute> + </optional> + <zeroOrMore> + <element name="node"> + <attribute name="name"> <text/> </attribute> + <attribute name="id"> <text/> </attribute> + <attribute name="cached"> <data type="boolean" /> </attribute> + </element> + </zeroOrMore> + <optional> + <element name="xml"> <text/> </element> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/status-2.0.rng b/xml/api/status-2.0.rng new file mode 100644 index 0000000..865ac08 --- /dev/null +++ b/xml/api/status-2.0.rng @@ -0,0 +1,25 @@ +<?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-status"/> + </start> + + <define name="element-status"> + <element name="status"> + <attribute name="code"> <data type="integer" /> </attribute> + <attribute name="message"> <text /> </attribute> + <optional> + <element name="errors"> + <oneOrMore> + <element name="error"> + <text /> + </element> + </oneOrMore> + </element> + </optional> + </element> + </define> + +</grammar> diff --git a/xml/api/stonith_admin-1.0.rng b/xml/api/stonith_admin-1.0.rng new file mode 100644 index 0000000..dd52a63 --- /dev/null +++ b/xml/api/stonith_admin-1.0.rng @@ -0,0 +1,92 @@ +<?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-stonith-admin"/> + </start> + + <define name="element-stonith-admin"> + <choice> + <ref name="stonith-admin-list" /> + <ref name="element-last-fenced" /> + <ref name="element-validation" /> + <element name="metadata"> <text /> </element> + </choice> + </define> + + <define name="stonith-admin-list"> + <element name="list"> + <attribute name="name"> <text /> </attribute> + <attribute name="count"> <data type="nonNegativeInteger" /> </attribute> + <choice> + <zeroOrMore> + <ref name="fencing-history-event" /> + </zeroOrMore> + <zeroOrMore> + <ref name="fencing-target" /> + </zeroOrMore> + <zeroOrMore> + <ref name="device" /> + </zeroOrMore> + </choice> + </element> + </define> + + <define name="device"> + <element name="item"> + <attribute name="name"> <value>device</value> </attribute> + <data type="NCName" /> + </element> + </define> + + <define name="fencing-target"> + <element name="target"> + <attribute name="hostname"> <text /> </attribute> + <attribute name="uuid"> <text /> </attribute> + <attribute name="status"> <text /> </attribute> + </element> + </define> + + <define name="element-last-fenced"> + <element name="last-fenced"> + <attribute name="target"> <text /> </attribute> + <attribute name="when"> <text /> </attribute> + </element> + </define> + + <define name="element-validation"> + <element name="validate"> + <attribute name="agent"> <text /> </attribute> + <attribute name="valid"> <data type="boolean" /> </attribute> + <optional> + <externalRef href="command-output-1.0.rng" /> + </optional> + </element> + </define> + + <define name="fencing-history-event"> + <element name="fence_event"> + <attribute name="status"> + <choice> + <value>failed</value> + <value>success</value> + <value>pending</value> + </choice> + </attribute> + <optional> + <attribute name="extended-status"> <text /> </attribute> + </optional> + <optional> + <attribute name="delegate"> <text /> </attribute> + </optional> + <attribute name="action"> <text /> </attribute> + <attribute name="target"> <text /> </attribute> + <attribute name="client"> <text /> </attribute> + <attribute name="origin"> <text /> </attribute> + <optional> + <attribute name="completed"> <text /> </attribute> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/stonith_admin-1.1.rng b/xml/api/stonith_admin-1.1.rng new file mode 100644 index 0000000..997670f --- /dev/null +++ b/xml/api/stonith_admin-1.1.rng @@ -0,0 +1,75 @@ +<?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-stonith-admin"/> + </start> + + <define name="element-stonith-admin"> + <choice> + <ref name="stonith-admin-list" /> + <ref name="element-last-fenced" /> + <ref name="element-validation" /> + <element name="metadata"> <text /> </element> + </choice> + </define> + + <define name="stonith-admin-list"> + <element name="list"> + <attribute name="name"> <text /> </attribute> + <attribute name="count"> <data type="nonNegativeInteger" /> </attribute> + <choice> + <empty/> + <oneOrMore> + <externalRef href="item-1.1.rng"/> + </oneOrMore> + <oneOrMore> + <ref name="fencing-history-event" /> + </oneOrMore> + </choice> + </element> + </define> + + <define name="element-last-fenced"> + <element name="last-fenced"> + <attribute name="target"> <text /> </attribute> + <attribute name="when"> <text /> </attribute> + </element> + </define> + + <define name="element-validation"> + <element name="validate"> + <attribute name="agent"> <text /> </attribute> + <attribute name="valid"> <data type="boolean" /> </attribute> + <optional> + <externalRef href="command-output-1.0.rng" /> + </optional> + </element> + </define> + + <define name="fencing-history-event"> + <element name="fence_event"> + <attribute name="status"> + <choice> + <value>failed</value> + <value>success</value> + <value>pending</value> + </choice> + </attribute> + <optional> + <attribute name="extended-status"> <text /> </attribute> + </optional> + <optional> + <attribute name="delegate"> <text /> </attribute> + </optional> + <attribute name="action"> <text /> </attribute> + <attribute name="target"> <text /> </attribute> + <attribute name="client"> <text /> </attribute> + <attribute name="origin"> <text /> </attribute> + <optional> + <attribute name="completed"> <text /> </attribute> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/stonith_admin-2.0.rng b/xml/api/stonith_admin-2.0.rng new file mode 100644 index 0000000..260417c --- /dev/null +++ b/xml/api/stonith_admin-2.0.rng @@ -0,0 +1,50 @@ +<?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-stonith-admin"/> + </start> + + <define name="element-stonith-admin"> + <choice> + <ref name="stonith-admin-list" /> + <ref name="element-last-fenced" /> + <ref name="element-validation" /> + <element name="metadata"> <text /> </element> + </choice> + </define> + + <define name="stonith-admin-list"> + <element name="list"> + <attribute name="name"> <text /> </attribute> + <attribute name="count"> <data type="nonNegativeInteger" /> </attribute> + <choice> + <empty/> + <oneOrMore> + <externalRef href="item-1.1.rng"/> + </oneOrMore> + <oneOrMore> + <externalRef href="fence-event-2.0.rng"/> + </oneOrMore> + </choice> + </element> + </define> + + <define name="element-last-fenced"> + <element name="last-fenced"> + <attribute name="target"> <text /> </attribute> + <attribute name="when"> <text /> </attribute> + </element> + </define> + + <define name="element-validation"> + <element name="validate"> + <attribute name="agent"> <text /> </attribute> + <attribute name="valid"> <data type="boolean" /> </attribute> + <optional> + <externalRef href="command-output-1.0.rng" /> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/stonith_admin-2.1.rng b/xml/api/stonith_admin-2.1.rng new file mode 100644 index 0000000..23e6a11 --- /dev/null +++ b/xml/api/stonith_admin-2.1.rng @@ -0,0 +1,52 @@ +<?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-stonith-admin"/> + </start> + + <define name="element-stonith-admin"> + <choice> + <ref name="stonith-admin-list" /> + <ref name="element-last-fenced" /> + <ref name="element-validation" /> + <element name="metadata"> <text /> </element> + </choice> + </define> + + <define name="stonith-admin-list"> + <optional> + <element name="list"> + <attribute name="name"> <text /> </attribute> + <attribute name="count"> <data type="nonNegativeInteger" /> </attribute> + <choice> + <empty/> + <oneOrMore> + <externalRef href="item-1.1.rng"/> + </oneOrMore> + <oneOrMore> + <externalRef href="fence-event-2.0.rng"/> + </oneOrMore> + </choice> + </element> + </optional> + </define> + + <define name="element-last-fenced"> + <element name="last-fenced"> + <attribute name="target"> <text /> </attribute> + <attribute name="when"> <text /> </attribute> + </element> + </define> + + <define name="element-validation"> + <element name="validate"> + <attribute name="agent"> <text /> </attribute> + <attribute name="valid"> <data type="boolean" /> </attribute> + <optional> + <externalRef href="command-output-1.0.rng" /> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/stonith_admin-2.15.rng b/xml/api/stonith_admin-2.15.rng new file mode 100644 index 0000000..b55fae9 --- /dev/null +++ b/xml/api/stonith_admin-2.15.rng @@ -0,0 +1,52 @@ +<?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-stonith-admin"/> + </start> + + <define name="element-stonith-admin"> + <choice> + <ref name="stonith-admin-list" /> + <ref name="element-last-fenced" /> + <ref name="element-validation" /> + <element name="metadata"> <text /> </element> + </choice> + </define> + + <define name="stonith-admin-list"> + <optional> + <element name="list"> + <attribute name="name"> <text /> </attribute> + <attribute name="count"> <data type="nonNegativeInteger" /> </attribute> + <choice> + <empty/> + <oneOrMore> + <externalRef href="item-1.1.rng"/> + </oneOrMore> + <oneOrMore> + <externalRef href="fence-event-2.15.rng"/> + </oneOrMore> + </choice> + </element> + </optional> + </define> + + <define name="element-last-fenced"> + <element name="last-fenced"> + <attribute name="target"> <text /> </attribute> + <attribute name="when"> <text /> </attribute> + </element> + </define> + + <define name="element-validation"> + <element name="validate"> + <attribute name="agent"> <text /> </attribute> + <attribute name="valid"> <data type="boolean" /> </attribute> + <optional> + <externalRef href="command-output-1.0.rng" /> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/stonith_admin-2.23.rng b/xml/api/stonith_admin-2.23.rng new file mode 100644 index 0000000..f3fab68 --- /dev/null +++ b/xml/api/stonith_admin-2.23.rng @@ -0,0 +1,52 @@ +<?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-stonith-admin"/> + </start> + + <define name="element-stonith-admin"> + <choice> + <ref name="stonith-admin-list" /> + <ref name="element-last-fenced" /> + <ref name="element-validation" /> + <element name="metadata"> <text /> </element> + </choice> + </define> + + <define name="stonith-admin-list"> + <optional> + <element name="list"> + <attribute name="name"> <text /> </attribute> + <attribute name="count"> <data type="nonNegativeInteger" /> </attribute> + <choice> + <empty/> + <oneOrMore> + <externalRef href="item-1.1.rng"/> + </oneOrMore> + <oneOrMore> + <externalRef href="fence-event-2.15.rng"/> + </oneOrMore> + </choice> + </element> + </optional> + </define> + + <define name="element-last-fenced"> + <element name="last-fenced"> + <attribute name="target"> <text /> </attribute> + <attribute name="when"> <text /> </attribute> + </element> + </define> + + <define name="element-validation"> + <element name="validate"> + <attribute name="agent"> <text /> </attribute> + <attribute name="valid"> <data type="boolean" /> </attribute> + <optional> + <externalRef href="command-output-2.23.rng" /> + </optional> + </element> + </define> +</grammar> diff --git a/xml/api/subprocess-output-2.23.rng b/xml/api/subprocess-output-2.23.rng new file mode 100644 index 0000000..2f7a8e7 --- /dev/null +++ b/xml/api/subprocess-output-2.23.rng @@ -0,0 +1,24 @@ +<?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="subprocess-output" /> + </start> + + <define name="subprocess-output"> + <attribute name="code"> <data type="integer" /> </attribute> + <optional> + <element name="output"> + <attribute name="source"><value>stdout</value></attribute> + <text /> + </element> + </optional> + <optional> + <element name="output"> + <attribute name="source"><value>stderr</value></attribute> + <text /> + </element> + </optional> + </define> +</grammar> diff --git a/xml/api/version-2.0.rng b/xml/api/version-2.0.rng new file mode 100644 index 0000000..56c810b --- /dev/null +++ b/xml/api/version-2.0.rng @@ -0,0 +1,19 @@ +<?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-version"/> + </start> + + <define name="element-version"> + <element name="version"> + <attribute name="program"> <text /> </attribute> + <attribute name="version"> <text /> </attribute> + <attribute name="author"> <text /> </attribute> + <attribute name="build"> <text /> </attribute> + <attribute name="features"> <text /> </attribute> + </element> + </define> + +</grammar> diff --git a/xml/assets/upgrade-2.10-htmldiff.xsl b/xml/assets/upgrade-2.10-htmldiff.xsl new file mode 100644 index 0000000..175bdb2 --- /dev/null +++ b/xml/assets/upgrade-2.10-htmldiff.xsl @@ -0,0 +1,358 @@ +<!-- + Copyright 2018 Red Hat, Inc. + Author: Jan Pokorny <jpokorny@redhat.com> + Part of pacemaker project + SPDX-License-Identifier: GPL-2.0-or-later + --> +<xsl:stylesheet version="1.0" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:cibtr="http://clusterlabs.org/ns/pacemaker/cibtr-2" + xmlns:exsl="http://exslt.org/common"> +<!-- NOTE: this is an exception from rule forbidding EXSLT's usage --> + +<xsl:include href="../upgrade-2.10-roundtrip.xsl"/> + +<!-- + we are embedding files from 3rd party project so as to reproduce the content + of XML into HTML-formatted presentation form; alternatively: + * from mozilla/firefox: + - view-source.xsl by Keith Visco (example transformation for transformiix) + https://dxr.mozilla.org/mozilla/source/extensions/transformiix/source/examples + - XMLPrettyPrint.xsl by Jonas Sicking + https://dxr.mozilla.org/mozilla-central/source/dom/xml/resources + https://hg.mozilla.org/mozilla-central/file/9b2a99adc05e/content/xml/document/resources/XMLPrettyPrint.xsl + or possibly its readily sanitized version from rdf-viewer project + https://github.com/marianafranco/rdf-viewer + * custom stylesheet to be written + --> +<xsl:param name="highlight-namespace" select="''"/> +<!-- +<xsl:include href="https://raw.githubusercontent.com/Boldewyn/view-source/master/library.xsl"/> +<xsl:include href="https://raw.githubusercontent.com/Boldewyn/view-source/master/original.xsl"/> + --> +<xsl:include href="view-source-library.xsl"/> +<xsl:include href="view-source-original.xsl"/> + +<xsl:output method="xml" encoding="UTF-8" + omit-xml-declaration="yes" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> + +<!-- B: identity mode --> +<xsl:template match="@*|node()" mode="identity"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" mode="identity"/> + </xsl:copy> +</xsl:template> + +<!-- used in test files to allow in-browser on-the-fly checking --> +<xsl:template match="processing-instruction()[ + name() = 'xml-stylesheet' + and + count(..|/) = 1 + ]" + mode="identity"/> +<!-- E: identity mode --> + +<xsl:template match="/"> + <xsl:variable name="before-upgrade"> + <xsl:apply-templates select="." mode="identity"/> + </xsl:variable> + <xsl:variable name="after-upgrade"> + <xsl:apply-templates select="." mode="cibtr:roundtrip"/> + </xsl:variable> + + <html> + <head> + <title> + <xsl:text>upgrade-2.10 on-the-fly in-browser transformation</xsl:text> + </title> + <style> + ol.count,.possibly-revealed { display: none; } + li.delete { color: red; } + li.delete em { background-color: #FFE4E1; } + li.insert { color: green; } + li.insert em { background-color: #FAFAD2; } + .count,.data { font-family: monospace; + background-color: #F8F8FF; + border: 1px solid #DCDCDC; } + .err_warning { color: red; background-color: #FFE4E1; } + .err_info { color: green; background-color: #FAFAD2; } + .err_debug { } + </style> + <script type="text/javascript"> + var global = { prettydiff: {} }, /* for diffview.js */ + diffview_source = new String("../assets/diffview.js"); + + /* add location-based file detail to the title */ + var split_url = document.URL.split('/'), + basename = new String(split_url[split_url.length - 1]), + /* see whether there's 'test-\d+' in URL as a discriminator */ + is_test = split_url.some(function(item, index, array) { + if (index < array.length - 1 && item.match(/test-\d+/)) + return true; + return false; + }); + + window.addEventListener("DOMContentLoaded", function(event) { + /* update title + headline */ + var basename_title = new String(basename + " upgrade"); + document.getElementById("headline").innerText = basename_title; + document.title = basename_title + " [" + document.title + "]"; + + /* add location-based file detail to the acknowledgement's text */ + document.getElementById("acknowledgement") + .innerHTML = document.getElementById("acknowledgement").innerHTML + .replace("@basename@", basename); + + /* make expand/collapse buttons udner debugging section work */ + document.querySelectorAll("#original, #transformed").forEach( + function(item) { + item.querySelector(".expand").addEventListener("click", + function(event) { + item.querySelectorAll(".possibly-revealed").forEach( + function(item) { + item.classList.replace("possibly-revealed", "revealed"); + } + ); + this.classList.add("possibly-revealed"); + event.preventDefault(); + }); + item.querySelector(".collapse").addEventListener("click", + function(event) { + item.querySelectorAll(".revealed").forEach( + function(item) { + item.classList.replace("revealed", "possibly-revealed"); + } + ); + item.querySelector(".expand").classList.remove("possibly-revealed"); + event.preventDefault(); + }); + } + ); + + if (is_test) { + var xhr1 = new XMLHttpRequest(), + xhr2 = new XMLHttpRequest(), + basename_split = basename.split('.'); + + /* fetch expected out-of-band messages */ + xhr1.onload = function() { + var formatted = this.responseText.replace(/^(WARNING|INFO|DEBUG)(: .*)$/gm, + function(match, label, rest) { + return '<span class="err_' + label.toLowerCase() + '"><em>' + + label + '</em>' + rest + '</span><br/>'; + }); + document.getElementById("expected-messages").innerHTML = formatted; + document.querySelectorAll(["#expected-messages", + "#expected-messages-ext", + "#navigation"]).forEach( + function(item) { + item.classList.remove("possibly-revealed"); + } + ); + }; + xhr1.open("GET", basename_split.splice(0, basename_split.length - 1) + .join('.') + ".ref.err"); + xhr1.responseType = "text"; + xhr1.send(); + + /* fetch previous/next pointers */ + xhr2.onload = function() { + var prev_link, next_link, + found = false; + Array.prototype.every.call( + this.responseXML.getElementsByTagName("a"), + function(item) { + if (item.href.endsWith(basename_split[basename_split.length - 1])) { + if (item.href.endsWith(basename)) + found = true; + else if (!found) + prev_link = item; + else if (next_link !== undefined) + return false; + else + next_link = item; + } + return true; + } + ); + if (prev_link !== undefined) + document.getElementById("navigation-prev").href = prev_link.href; + if (next_link !== undefined) + document.getElementById("navigation-next").href = next_link.href; + }; + xhr2.open("GET", "."); + xhr2.responseType = "document"; + xhr2.send(); + } + }); + + window.addEventListener("load", function(event) { + /* trigger diff'ing */ + document + .getElementById("output") + .innerHTML = global.prettydiff.diffview({ + source: document.getElementById("original-placeholder").innerText, + sourcelabel: "Differences: original", + diff: document.getElementById("transformed-placeholder").innerText, + difflabel: "transformed (some whitespace stripped)", + diffview: "inline", + lang: "text" + })[0]; + + /* add proper location of diffview.js */ + var diffview_link = document.getElementById("diffview-link"); + if (diffview_link.host != document.location.host) { + diffview_link.href = diffview_source; + diffview_link.parentElement.querySelector(".possibly-revealed") + .classList.remove("possibly-revealed"); + diffview_link.parentElement.querySelector(".revealed") + .classList.replace("revealed", "possibly-revealed"); + } + }); + + /* bind left/right arrows */ + window.addEventListener("keydown", function(event) { + switch (event.keyCode) { + case 37: + document.location = document.getElementById("navigation-prev").href; + break; + case 39: + document.location = document.getElementById("navigation-next").href; + break; + } + }); + </script> + <script type="text/javascript" src="../assets/diffview.js"/> + <!-- fallback to externally fetched js, without any guarantees, + safety ones or otherwise --> + <script type="text/javascript"> + if (typeof global.prettydiff.diffview == "undefined") { + diffview_source = new String("https://raw.githubusercontent.com/prettydiff/prettydiff/2.2.8/lib/diffview.js"); + document.write(unescape('%3Cscript type="text/javascript" src=' + diffview_source + '/%3E')); + } + </script> + </head> + <body> + <h1 id="headline">test</h1> + <p> + <strong>Using <a href="../upgrade-2.10.xsl">upgrade-2.10</a> on-the-fly in-browser transformation</strong> + <span id="navigation" class="possibly-revealed"> + [ + <a id="navigation-prev" href="#">previous</a> + and + <a id="navigation-next" href="#">next</a>, or use arrows + ] + </span> + </p> + <p id="output"> + Differences highlight view to be loaded here. + </p> + <h3>Diagnostics</h3> + <p> + Open <a href="https://webmasters.stackexchange.com/a/77337">JS console</a> + (e.g. <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>J</kbd>, focusing JS + log combo) + <span id="expected-messages-ext" class="possibly-revealed"> + to check the actual messages from the in-browser transformation match the baseline: + </span> + </p> + <p id="expected-messages" class="data possibly-revealed"> + Expected diagnostic messages to be loaded here. + </p> + <h3>Debugging</h3> + <p> + These are raw data (beware, already chewed with the + <a href="../assets/view-source-original.xsl">view-source</a> + transformation, hence not very suitable for copying) entering + the differential generating processs: + </p> + <p id="original"> + <span> + <a class="expand" href="">original+</a> + <a class="collapse possibly-revealed" href="">original-</a> + </span> + <br/> + <pre id="original-placeholder" class="data possibly-revealed"> + <xsl:apply-templates select="exsl:node-set($before-upgrade)/node()" mode="original"/> + </pre> + </p> + <p id="transformed"> + <span> + <a class="expand" href="">transformed+</a> + <a class="collapse possibly-revealed" href="">transformed-</a> + </span> + <br/> + <pre id="transformed-placeholder" class="data possibly-revealed"> + <xsl:apply-templates select="exsl:node-set($after-upgrade)/node()" mode="original"/> + </pre> + </p> + <hr/> + <p id="acknowledgement"> + This generated page is based on the externally provided pacemaker XML + configuration file (CIB), <span class="data">@basename@</span>, which is + the primary object of interest here. + But the rendered page wouldn't be possible without the actual + transformations and other auxiliary files that come with these notices: + <br/> + <ul> + <li id="ack-diffview"> + <a href="../assets/diffview.js" id="diffview-link">diffview.js</a> + <p class="data revealed"> + This file was obtained from <a href="https://github.com/prettydiff/prettydiff">prettydiff/prettydiff</a> project:<br/> + <a href="https://raw.githubusercontent.com/prettydiff/prettydiff/2.2.8/lib/diffview.js">diffview.js</a><br/> + <br/> + Licensing governed with:<br/> + <a href="https://github.com/prettydiff/prettydiff/blob/2.2.8/license.txt">license.txt</a><br/> + <br/> + > Rights holder Austin Cheney and Pretty Diff<br/> + > <br/> + > Pretty Diff project, as of version 2.1.17 and all following versions<br/> + > unless otherwise changed, is licensed with a Creative Commons 1.0<br/> + > Universal license (CC0). + </p> + <p class="data possibly-revealed"> + This file is being served directly from <a href="https://raw.githubusercontent.com/prettydiff/prettydiff/2.2.8/lib/diffview.js"> + GitHub hosted location</a>, hence refer to <a href="https://raw.githubusercontent.com/prettydiff/prettydiff/2.2.8"> + respective repo tree</a> + </p> + </li> + <li id="ack-view-source"> + <a href="../assets/view-source-library.xsl">library.xsl</a> + and + <a href="../assets/view-source-original.xsl">original.xsl</a> + <p class="data"> + This file was obtained from <a href="https://github.com/Boldewyn/view-source">Boldewyn/view-source</a> project:<br/> + <a href="https://raw.githubusercontent.com/Boldewyn/view-source/f425605366b9f5a52e6a71632785d6e4543c705e/library.xsl">library.xsl</a><br/> + <a href="https://raw.githubusercontent.com/Boldewyn/view-source/f425605366b9f5a52e6a71632785d6e4543c705e/original.xsl">original.xsl</a><br/> + <br/> + Licensing governed with:<br/> + <a href="https://github.com/Boldewyn/view-source/blob/f425605366b9f5a52e6a71632785d6e4543c705e/README">README</a><br/> + <br/> + > The stylesheet is published under an MIT-style license and the GPL v2.<br/> + > Choose at your liking. + </p> + </li> + <li id="ack-upgrade"> + <a href="../assets/upgrade-2.10-htmldiff.xsl">upgrade-2.10-htmldiff.xsl</a> + (master template for this report) and + <a href="../upgrade-2.10.xsl">upgrade-2.10.xsl</a> + (actual upgrade engine) + <p class="data"> + Copyright 2018 <a href="https://redhat.com">Red Hat, Inc.</a><br/> + Author: <a href="https://wiki.clusterlabs.org/wiki/User:Jpokorny">Jan Pokorny</a> + <<a href="mailto:jpokorny@redhat.com">jpokorny@redhat.com</a>><br/> + <a href="https://github.com/ClusterLabs/pacemaker/tree/master/xml">Part</a> of + <a href="https://wiki.clusterlabs.org/wiki/Pacemaker">pacemaker</a> project<br/> + <a href="https://spdx.org/sites/cpstandard/files/pages/files/using_spdx_license_list_short_identifiers.pdf#page=5">SPDX-License-Identifier</a>: + <a href="https://spdx.org/licenses/GPL-2.0-or-later.html">GPL-2.0-or-later</a> + </p> + </li> + </ul> + </p> + </body> + </html> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/assets/view-source-library.xsl b/xml/assets/view-source-library.xsl new file mode 100644 index 0000000..8ac0dc2 --- /dev/null +++ b/xml/assets/view-source-library.xsl @@ -0,0 +1,222 @@ +<?xml version="1.0" ?> +<!-- + This file was obtained from https://github.com/Boldewyn/view-source project: + https://raw.githubusercontent.com/Boldewyn/view-source/f425605366b9f5a52e6a71632785d6e4543c705e/library.xsl + + Licensing governed with: + https://github.com/Boldewyn/view-source/blob/f425605366b9f5a52e6a71632785d6e4543c705e/README + + > The stylesheet is published under an MIT-style license and the GPL v2. + > Choose at your liking. + + --> +<t:stylesheet version="1.0" + xmlns:t="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/1999/xhtml"> + + <t:variable name="ns" xmlns=""> + <empty></empty> + <xml>http://www.w3.org/XML/1998/namespace</xml> + <xmlns>http://www.w3.org/2000/xmlns/</xmlns> + <xhtml>http://www.w3.org/1999/xhtml</xhtml> + <svg>http://www.w3.org/2000/svg</svg> + <mathml>http://www.w3.org/1998/Math/MathML</mathml> + <xslt>http://www.w3.org/1999/XSL/Transform</xslt> + <fo>http://www.w3.org/1999/XSL/Format</fo> + <smil>http://www.w3.org/2005/SMIL21/Language</smil> + <xlink>http://www.w3.org/1999/xlink</xlink> + <xsd>http://www.w3.org/2001/XMLSchema</xsd> + <xsd-inst>http://www.w3.org/2001/XMLSchema-instance</xsd-inst> + <xforms>http://www.w3.org/2001/xforms</xforms> + <xinclude>http://www.w3.org/2001/XInclude</xinclude> + <xul>http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</xul> + <rdf>http://www.w3.org/1999/02/22-rdf-syntax-ns#</rdf> + </t:variable> + + <!-- + format text, so that newlines get indented correctly + --> + <t:template name="format-text"> + <t:param name="text" select="." /> + <t:param name="indent" /> + <t:choose> + <t:when test="contains($text, '
')"> + <t:value-of select="normalize-space(substring-before($text, '
'))" /> + <t:text>
</t:text> + <t:value-of select="$indent" /> + <t:call-template name="format-text"> + <t:with-param name="text" select="substring-after($text, '
')" /> + <t:with-param name="indent" select="$indent " /> + </t:call-template> + </t:when> + <t:otherwise> + <t:value-of select="normalize-space($text)" /> + </t:otherwise> + </t:choose> + </t:template> + + <!-- + HTML entity quote stuff + --> + <t:template name="quote"> + <t:param name="text" /> + <t:call-template name="replace"> + <t:with-param name="text"> + <t:call-template name="replace"> + <t:with-param name="text"> + <t:call-template name="replace"> + <t:with-param name="text"> + <t:call-template name="replace"> + <t:with-param name="text"> + <t:call-template name="replace"> + <t:with-param name="text"> + <t:value-of select="$text" /> + </t:with-param> + <t:with-param name="from" select="'&'" /> + <t:with-param name="to" select="'&amp;'" /> + </t:call-template> + </t:with-param> + <t:with-param name="from" select='"'"' /> + <t:with-param name="to" select="'&apos;'" /> + </t:call-template> + </t:with-param> + <t:with-param name="from" select="'"'" /> + <t:with-param name="to" select="'&quot;'" /> + </t:call-template> + </t:with-param> + <t:with-param name="from" select="'>'" /> + <t:with-param name="to" select="'&gt;'" /> + </t:call-template> + </t:with-param> + <t:with-param name="from" select="'<'" /> + <t:with-param name="to" select="'&lt;'" /> + </t:call-template> + </t:template> + + <!-- + replace a string with another + --> + <t:template name="replace"> + <t:param name="text" /> + <t:param name="from" /> + <t:param name="to" /> + <t:choose> + <t:when test="not($from)"> + <t:value-of select="$text" /> + </t:when> + <t:when test="contains($text, $from)"> + <t:value-of select="substring-before($text, $from)" /> + <t:value-of select="$to" /> + <t:call-template name="replace"> + <t:with-param name="text" select="substring-after($text, $from)" /> + <t:with-param name="from" select="$from" /> + <t:with-param name="to" select="$to" /> + </t:call-template> + </t:when> + <t:otherwise> + <t:value-of select="$text" /> + </t:otherwise> + </t:choose> + </t:template> + + <!-- + parse the value of an attribute (find links and make them clickable) + --> + <t:template name="parse-attval"> + <t:param name="att" select="." /> + <t:choose> + <!-- FIXME: element{xhtml} / @attr{obscure-ns} 'href' gets linkified --> + <t:when test="(namespace-uri($att/..) = document('')//t:variable[@name = 'ns']/xml/text() and ( local-name($att) = 'base' )) or + (namespace-uri($att/..) = document('')//t:variable[@name = 'ns']/xhtml/text() and ( local-name($att) = 'src' or local-name($att) = 'href' )) or + (namespace-uri($att/..) = document('')//t:variable[@name = 'ns']/svg/text() and ( local-name($att) = 'src' )) or + (namespace-uri($att/..) = document('')//t:variable[@name = 'ns']/xslt/text() and ( local-name($att) = 'href' )) or + (namespace-uri($att/..) = document('')//t:variable[@name = 'ns']/smil/text() and ( local-name($att) = 'src' or local-name($att) = 'href' )) or + (namespace-uri($att) = document('')//t:variable[@name = 'ns']/xlink/text() and ( local-name($att) = 'href' or local-name($att) = 'role' )) or + contains(substring($att, 1, 7), 'http://') or + contains(substring($att, 1, 8), 'https://') or + contains(substring($att, 1, 7), 'file://') or + contains(substring($att, 1, 7), 'mailto:') or + contains(substring($att, 1, 6), 'ftp://') or + contains(substring($att, 1, 7), 'ftps://') or + contains(substring($att, 1, 5), 'news:') or + contains(substring($att, 1, 4), 'urn:') or + contains(substring($att, 1, 5), 'ldap:') or + contains(substring($att, 1, 5), 'data:')"> + <a> + <t:attribute name="href"> + <t:value-of select="$att" /> + </t:attribute> + <t:call-template name="quote"> + <t:with-param name="text" select="$att" /> + </t:call-template> + </a> + </t:when> + <t:otherwise> + <t:call-template name="quote"> + <t:with-param name="text" select="$att" /> + </t:call-template> + </t:otherwise> + </t:choose> + </t:template> + + <!-- + print the name of a node plus the namespace URI in a title attribute + --> + <t:template name="print-name"> + <t:param name="node" select="." /> + <span class="label"> + <t:if test="namespace-uri($node)"> + <t:attribute name="title"> + <t:value-of select="namespace-uri($node)" /> + </t:attribute> + </t:if> + <t:choose> + <t:when test="name($node) != local-name($node)"> + <span class="nsprefix"> + <t:value-of select="substring-before(name($node), ':')" /> + </span> + <span class="nscolon syntax"> + <t:text>:</t:text> + </span> + <span class="local-name"> + <t:value-of select="local-name($node)" /> + </span> + </t:when> + <t:otherwise> + <t:value-of select="name($node)" /> + </t:otherwise> + </t:choose> + </span> + </t:template> + + <!-- + check the used language against a list of known ones + --> + <t:template name="detect-lang"> + <t:param name="node" select="." /> + <t:if test="namespace-uri($node) = $highlight-namespace"> + <t:text>highlight </t:text> + </t:if> + <t:value-of select="local-name(document('')//t:variable[@name = 'ns']/*[text() = namespace-uri($node)])" /> + </t:template> + + <t:key name="kElemByNSURI" + match="*[namespace::*[not(. = ../../namespace::*)]]" + use="namespace::*[not(. = ../../namespace::*)]" /> + + <!-- + get a list of all namespaces used in the document + --> + <t:template name="get-namespace-nodes"> + <script type="text/javascript"> + var namespaces = [ + <t:for-each select="//namespace::*[not(. = ../../namespace::*)] + [count(..|key('kElemByNSURI',.)[1])=1]"> + <t:value-of select="concat('"',.,'",')"/> + </t:for-each> + 'DUMMY' + ]; + </script> + </t:template> + +</t:stylesheet> diff --git a/xml/assets/view-source-original.xsl b/xml/assets/view-source-original.xsl new file mode 100644 index 0000000..327e0d3 --- /dev/null +++ b/xml/assets/view-source-original.xsl @@ -0,0 +1,103 @@ +<?xml version="1.0" ?> +<!-- + This file was obtained from https://github.com/Boldewyn/view-source project: + https://raw.githubusercontent.com/Boldewyn/view-source/f425605366b9f5a52e6a71632785d6e4543c705e/original.xsl + + Licensing governed with: + https://github.com/Boldewyn/view-source/blob/f425605366b9f5a52e6a71632785d6e4543c705e/README + + > The stylesheet is published under an MIT-style license and the GPL v2. + > Choose at your liking. + + --> +<t:stylesheet version="1.0" + xmlns:t="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/1999/xhtml"> + + <!-- Elements (original) --> + <t:template match="*" mode="original"> + <t:variable name="lang"> + <t:call-template name="detect-lang" /> + </t:variable> + <t:choose> + <t:when test="node()"> + <span class="{$lang} element"> + <span class="tag start"> + <t:text><</t:text> + <t:call-template name="print-name" /> + <t:for-each select="@*"> + <t:apply-templates select="." mode="original" /> + </t:for-each> + <t:text>></t:text> + </span> + <t:apply-templates mode="original" /> + <span class="tag end"> + <t:text></</t:text> + <t:value-of select="name(.)"/> + <t:text>></t:text> + </span> + </span> + </t:when> + <t:otherwise> + <span class="{$lang} element empty"> + <span class="tag empty"> + <t:text><</t:text> + <t:call-template name="print-name" /> + <t:for-each select="@*"> + <t:apply-templates select="." mode="original" /> + </t:for-each> + <t:text> /></t:text> + </span> + </span> + </t:otherwise> + </t:choose> + </t:template> + + <!-- Attributes (original) --> + <t:template match="@*" mode="original"> + <t:variable name="lang"> + <t:call-template name="detect-lang" /> + </t:variable> + <t:text> </t:text> + <span class="{$lang} attribute"> + <t:call-template name="print-name" /> + <t:text>="</t:text> + <span class="attribute-value"> + <t:call-template name="parse-attval" /> + </span> + <t:text>"</t:text> + </span> + </t:template> + + <!-- Processing Instructions (original) --> + <t:template match="processing-instruction()" mode="original"> + <span class="processing-instruction"> + <t:text><?</t:text> + <t:value-of select="name(.)" /> + <t:text> </t:text> + <t:value-of select="." /> + <t:text>?></t:text> + </span> + </t:template> + + <!-- Comments (original) --> + <t:template match="comment()" mode="original"> + <span class="comment"> + <t:text><!--</t:text> + <t:call-template name="quote"> + <t:with-param name="text" select="." /> + </t:call-template> + <t:text>--></t:text> + </span> + </t:template> + + <!-- Text (original) --> + <t:template match="text()" mode="original"> + <span class="text"> + <t:call-template name="quote"> + <t:with-param name="text" select="." /> + </t:call-template> + </span> + </t:template> + +</t:stylesheet> diff --git a/xml/base/access-render-2.xsl b/xml/base/access-render-2.xsl new file mode 100644 index 0000000..a0c370a --- /dev/null +++ b/xml/base/access-render-2.xsl @@ -0,0 +1,258 @@ +<!-- + Copyright 2019 the Pacemaker project contributors + + The version control history for this file may have further details. + + Licensed under the GNU General Public License version 2 or later (GPLv2+). + --> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:accessrender="http://clusterlabs.org/ns/pacemaker/access/render/2" + xmlns:accessrendercfg="http://clusterlabs.org/ns/pacemaker/access/render/cfg"> + +<xsl:output method="text" encoding="UTF-8"/> + +<!-- + see https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bith; + note that we need to retain XML 1.0 (as opposed to 1.1, which in turn + is not supported in libxml) compatibility in this very template, meaning + we cannot output a superset of what's expressible in the template itself + (escaped or not), hence we are forced to work that around for \x1b (ESC, + unavoidable for ANSI colorized output) character with encoding it in some + way (here using "\x1b" literal notation) and requiring a trivial + "xsltproc ... | sed 's/\\x1b/\x1b/'" postprocessing; + the above, however, only applies when used directly (which may be the + reason to pay attention to this comment to begin with), but fortunately + it is conveniently avoidable when XSLT triggered programatically (see + pcmk__acl_evaled_render), since libxslt allows for passing raw (further + unchecked) parameter strings, in which case the actual content of those + parameters is decoded on the fly, meaning that this file is still open + to compilation-free customizations if there's an irresistible need... +--> +<xsl:param name="accessrendercfg:c-writable"><!-- green -->\x1b[32m</xsl:param> +<xsl:param name="accessrendercfg:c-readable"><!-- blue -->\x1b[34m</xsl:param> +<xsl:param name="accessrendercfg:c-denied"><!-- red -->\x1b[31m</xsl:param> +<xsl:param name="accessrendercfg:c-reset"><!-- reset -->\x1b[0m</xsl:param> + +<xsl:param name="accessrender:extra-spacing"> + <xsl:value-of select="'no'"/> +</xsl:param> +<xsl:param name="accessrender:self-reproducing-prefix"> + <xsl:value-of select="''"/> +</xsl:param> + +<xsl:variable name="accessrender:ns-writable" select="'http://clusterlabs.org/ns/pacemaker/access/writable'"/> +<xsl:variable name="accessrender:ns-readable" select="'http://clusterlabs.org/ns/pacemaker/access/readable'"/> +<xsl:variable name="accessrender:ns-denied" select="'http://clusterlabs.org/ns/pacemaker/access/denied'"/> + +<!-- + + accessrender:interpolate-annotation named template + + --> + +<xsl:template name="accessrender:interpolate-annotation"> + <xsl:choose> + <xsl:when test="namespace-uri() = $accessrender:ns-writable"> + <xsl:value-of select="$accessrendercfg:c-writable"/> + </xsl:when> + <xsl:when test="namespace-uri() = $accessrender:ns-readable"> + <xsl:value-of select="$accessrendercfg:c-readable"/> + </xsl:when> + <xsl:when test="namespace-uri() = $accessrender:ns-denied"> + <xsl:value-of select="$accessrendercfg:c-denied"/> + </xsl:when> + </xsl:choose> +</xsl:template> + +<!-- + + accessrender:namespaces mode + + --> + +<xsl:template match="*" mode="accessrender:namespaces"> + <!-- assume c-writable is representative of others (c-readable, c-denied) --> + <xsl:if test="concat( + substring-before($accessrendercfg:c-writable, ':'), + ':' + ) = $accessrendercfg:c-writable"> + <xsl:if test="//*[namespace-uri() = $accessrender:ns-writable] + or + //@*[namespace-uri() = $accessrender:ns-writable]"> + <xsl:value-of select="concat(' xmlns:', + substring-before($accessrendercfg:c-writable, ':'), + '="', $accessrender:ns-writable, '"')"/> + </xsl:if> + <xsl:if test="//*[namespace-uri() = $accessrender:ns-readable] + or + //@*[namespace-uri() = $accessrender:ns-readable]"> + <xsl:value-of select="concat(' xmlns:', + substring-before($accessrendercfg:c-readable, ':'), + '="', $accessrender:ns-readable, '"')"/> + </xsl:if> + <xsl:if test="//*[namespace-uri() = $accessrender:ns-denied] + or + //@*[namespace-uri() = $accessrender:ns-denied]"> + <xsl:value-of select="concat(' xmlns:', + substring-before($accessrendercfg:c-denied, ':'), + '="', $accessrender:ns-denied, '"')"/> + </xsl:if> + </xsl:if> +</xsl:template> + +<!-- + + accessrender:proceed mode + + --> + +<xsl:template match="*" mode="accessrender:proceed"> + <xsl:variable name="whitespace-before"> + <!-- ensure newline also for the root element --> + <xsl:choose> + <xsl:when test="preceding-sibling::text()[last()] != ''"> + <xsl:value-of select="preceding-sibling::text()[last()]"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="'
'"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="extra-annotation"> + <xsl:if test="namespace-uri() != namespace-uri(..) + or + $accessrendercfg:c-reset != ''"> + <xsl:call-template name="accessrender:interpolate-annotation"/> + </xsl:if> + </xsl:variable> + <!-- tag opening --> + <xsl:choose> + <!-- special-casing based on $extra-annotation ending with colon --> + <xsl:when test="$accessrender:self-reproducing-prefix != '' + and + concat( + substring-before($extra-annotation, ':'), + ':' + ) = $extra-annotation"> + <xsl:value-of select="concat('<', $extra-annotation, local-name())"/> + </xsl:when> + <xsl:when test="$accessrender:extra-spacing = 'yes' + and + $extra-annotation != ''"> + <xsl:value-of select="concat( + preceding-sibling::text()[last()], + $extra-annotation, + $whitespace-before, + '<', + local-name() + )"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat($extra-annotation, '<', local-name())"/> + </xsl:otherwise> + </xsl:choose> + + <xsl:apply-templates mode="accessrender:proceed" select="@*"/> + + <!-- for root and true XML output, figure out the namespaces used --> + <xsl:if test=". = /* + and + $accessrender:self-reproducing-prefix != ''"> + <xsl:apply-templates mode="accessrender:namespaces" select="."/> + </xsl:if> + + <!-- tag closing --> + <xsl:choose> + <xsl:when test="*|comment()|processing-instruction()"> + <xsl:value-of select="'>'"/> + <xsl:apply-templates mode="accessrender:proceed" select="node()"/> + <xsl:choose> + <!-- special-casing based on $extra-annotation ending with colon --> + <xsl:when test="$accessrender:self-reproducing-prefix != '' + and + concat( + substring-before($extra-annotation, ':'), + ':' + ) = $extra-annotation"> + <xsl:value-of select="concat( + '</', + $extra-annotation, + local-name(), '>' + )"/> + </xsl:when> + <xsl:otherwise> + <xsl:if test="$accessrender:extra-spacing = 'no'"> + <xsl:value-of select="$extra-annotation"/> + </xsl:if> + <xsl:value-of select="concat( + '</', + local-name(), + '>' + )"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="'/>'"/> + <xsl:apply-templates mode="accessrender:proceed" select="node()"/> + </xsl:otherwise> + </xsl:choose> + <!-- do not taint any subsequent terminal session --> + <xsl:value-of select="$accessrendercfg:c-reset"/> +</xsl:template> + +<xsl:template match="@*" mode="accessrender:proceed"> + <!-- XXX especially "text" output untest{ed,able} since no support for + attribute granularity for now --> + <xsl:variable name="extra-annotation"> + <xsl:if test="namespace-uri() != namespace-uri(..)"> + <xsl:call-template name="accessrender:interpolate-annotation"/> + </xsl:if> + </xsl:variable> + <xsl:choose> + <xsl:when test="namespace-uri() != namespace-uri(..) + and + $accessrender:self-reproducing-prefix != ''"> + <xsl:value-of select="' '"/> + <xsl:choose> + <xsl:when test="concat( + substring-before($extra-annotation, ':'), + ':' + ) = $extra-annotation"> + <xsl:value-of select="substring-before($extra-annotation, ':')"/> + </xsl:when> + </xsl:choose> + <xsl:value-of select="concat(':', local-name(), '="', ., '"')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat(' ', local-name(), '="', ., '"')"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="comment()|processing-instruction()|text()" mode="accessrender:proceed"> + <xsl:choose> + <xsl:when test="self::comment()"> + <xsl:value-of select="'<!-- '"/> + </xsl:when> + <xsl:when test="self::processing-instruction()"> + <xsl:value-of select="'<? '"/> + </xsl:when> + </xsl:choose> + <xsl:value-of select="."/> + <xsl:choose> + <xsl:when test="self::comment()"> + <xsl:value-of select="' -->
'"/> + </xsl:when> + <xsl:when test="self::processing-instruction()"> + <xsl:value-of select="'?>'
"/> + </xsl:when> + </xsl:choose> +</xsl:template> + +<!-- mode-less, easy to override kick-off --> +<xsl:template match="/"> + <xsl:apply-templates mode="accessrender:proceed" select="@*|node()"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/best-match.sh b/xml/best-match.sh new file mode 100755 index 0000000..580c29f --- /dev/null +++ b/xml/best-match.sh @@ -0,0 +1,98 @@ +#!/bin/sh +# +# Find the (sub-)schema that best matches a desired version. +# +# Version numbers are assumed to be in the format X.Y, +# where X and Y are integers, and Y is no more than 3 digits, +# or the special value "next". +# + +# (Sub-)schema name (e.g. "resources") +base="$1"; shift + +# Desired version (e.g. "1.0" or "next") +target="$1"; shift + +# If not empty, append the best match as an XML externalRef to this file +# (otherwise, just echo the best match). Using readlink allows building +# from a different directory. +destination="$(readlink -f "$1")"; shift + +# Arbitrary text to print before XML (generally spaces to indent) +prefix="$1"; shift + +# Allow building from a different directory +cd "$(dirname $0)" + +list_candidates() { + ls -1 "${1}.rng" "${1}"-[0-9]*.rng 2>/dev/null +} + +version_from_filename() { + vff_filename="$1" + + case "$vff_filename" in + *-*.rng) + echo "$vff_filename" | sed -e 's/.*-\(.*\).rng/\1/' + ;; + *) + # special case for bare ${base}.rng, no -0.1's around anyway + echo 0.1 + ;; + esac +} + +filename_from_version() { + ffv_version="$1" + ffv_base="$2" + + if [ "$ffv_version" = "0.1" ]; then + echo "${ffv_base}.rng" + else + echo "${ffv_base}-${ffv_version}.rng" + fi +} + +# Convert version string (e.g. 2.10) into integer (e.g. 2010) for comparisons +int_version() { + echo "$1" | awk -F. '{ printf("%d%03d\n", $1,$2); }'; +} + +best="0.0" +for rng in $(list_candidates "${base}"); do + case ${rng} in + ${base}-${target}.rng) + # We found exactly what was requested + best=${target} + break + ;; + *-next.rng) + # "Next" schemas cannot be a best match unless directly requested + ;; + *) + v=$(version_from_filename "${rng}") + if [ $(int_version "${v}") -gt $(int_version "${best}") ]; then + # This version beats the previous best match + + if [ "${target}" = "next" ]; then + best=${v} + elif [ $(int_version "${v}") -lt $(int_version "${target}") ]; then + # This value is best only if it's still less than the target + best=${v} + fi + fi + ;; + esac +done + +if [ "$best" != "0.0" ]; then + found=$(filename_from_version "$best" "$base") + if [ -z "$destination" ]; then + echo "$(basename $found)" + else + echo "${prefix}<externalRef href=\"$(basename $found)\"/>" >> "$destination" + fi + exit 0 +fi + +exit 1 diff --git a/xml/cib-1.0.rng b/xml/cib-1.0.rng new file mode 100644 index 0000000..b05413d --- /dev/null +++ b/xml/cib-1.0.rng @@ -0,0 +1,33 @@ +<?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="attribute-options"/> + </start> + + <define name="attribute-options"> + <externalRef href="versions.rng"/> + <optional> + <attribute name="crm_feature_set"><text/></attribute> + </optional> + <optional> + <attribute name="remote-tls-port"><data type="nonNegativeInteger"/></attribute> + </optional> + <optional> + <attribute name="remote-clear-port"><data type="nonNegativeInteger"/></attribute> + </optional> + <optional> + <attribute name="have-quorum"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="dc-uuid"><text/></attribute> + </optional> + <optional> + <attribute name="cib-last-written"><text/></attribute> + </optional> + <optional> + <attribute name="no-quorum-panic"><data type="boolean"/></attribute> + </optional> + </define> + +</grammar> diff --git a/xml/cib-1.2.rng b/xml/cib-1.2.rng new file mode 100644 index 0000000..7ae03eb --- /dev/null +++ b/xml/cib-1.2.rng @@ -0,0 +1,45 @@ +<?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="attribute-options"/> + </start> + + <define name="attribute-options"> + <externalRef href="versions.rng"/> + <optional> + <attribute name="crm_feature_set"><text/></attribute> + </optional> + <optional> + <attribute name="remote-tls-port"><data type="nonNegativeInteger"/></attribute> + </optional> + <optional> + <attribute name="remote-clear-port"><data type="nonNegativeInteger"/></attribute> + </optional> + <optional> + <attribute name="have-quorum"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="dc-uuid"><text/></attribute> + </optional> + <optional> + <attribute name="cib-last-written"><text/></attribute> + </optional> + <optional> + <attribute name="no-quorum-panic"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="update-origin"><text/></attribute> + </optional> + <optional> + <attribute name="update-client"><text/></attribute> + </optional> + <optional> + <attribute name="update-user"><text/></attribute> + </optional> + <optional> + <attribute name="execution-date"><text/></attribute> + </optional> + </define> + +</grammar> diff --git a/xml/cibtr-2.rng b/xml/cibtr-2.rng new file mode 100644 index 0000000..36e8328 --- /dev/null +++ b/xml/cibtr-2.rng @@ -0,0 +1,211 @@ +<!-- + Copyright 2018 Red Hat, Inc. + Author: Jan Pokorny <jpokorny@redhat.com> + Part of pacemaker project + SPDX-License-Identifier: GPL-2.0-or-later + --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + xmlns:cibtr="http://clusterlabs.org/ns/pacemaker/cibtr-2" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="cibtr-2"/> + </start> + + <define name="cibtr-2"> + <element name="cibtr:map"> + <zeroOrMore> + <ref name="cibtr-2.table"/> + </zeroOrMore> + </element> + </define> + + <define name="cibtr-2.table"> + <element name="cibtr:table"> + <attribute name="for"> + <data type="ID"/> + </attribute> + <attribute name="msg-prefix"> + <data type="string"/> + </attribute> + <choice> + <zeroOrMore> + <ref name="cibtr-2.replace.nonwhereaware"/> + </zeroOrMore> + <group> + <attribute name="where-cases"> + <!-- pipe-delimited enumeration--> + <data type="string"> + <param name="minLength">1</param> + </data> + </attribute> + <!-- cannot arrange this as an interleave of + cibtr-2.replace.whereaware+ and + cibtr-2.replace.nonwhereaware* because of + http://relaxng.org/spec-20011203.html#attribute-restrictions --> + <zeroOrMore> + <ref name="cibtr-2.replace.whereaware"/> + </zeroOrMore> + </group> + </choice> + </element> + </define> + + <!-- leaf attributes --> + + <define name="cibtr-2.replace.attr-in-case-of"> + <attribute name="in-case-of"> + <!-- pipe-delimited enumeration--> + <data type="string"/> + </attribute> + </define> + + <define name="cibtr-2.replace.attr-in-case-of-droppable-prefix"> + <attribute name="in-case-of-droppable-prefix"> + <!-- just a single argument taken verbatim --> + <data type="string"> + <param name="minLength">1</param> + </data> + </attribute> + </define> + + <define name="cibtr-2.replace.attr-msg-extra"> + <attribute name="msg-extra"> + <data type="string"> + <param name="minLength">1</param> + </data> + </attribute> + </define> + + <define name="cibtr-2.replace.attr-msg-severity"> + <attribute name="msg-severity"> + <choice> + <value>WARNING</value> + <value>INFO</value> + <value>DEBUG</value> + </choice> + </attribute> + </define> + + <define name="cibtr-2.replace.attr-redefined-as"> + <attribute name="redefined-as"> + <data type="string"> + <param name="minLength">1</param> + </data> + </attribute> + </define> + + <define name="cibtr-2.replace.attr-what"> + <attribute name="what"> + <data type="NCName"/> + </attribute> + </define> + + <define name="cibtr-2.replace.attr-where"> + <attribute name="where"> + <data type="NCName"/> + </attribute> + </define> + + <define name="cibtr-2.replace.attr-with-possibly"> + <attribute name="with"> + <choice> + <data type="NCName"/> + <empty/> + </choice> + </attribute> + </define> + + <define name="cibtr-2.replace.attr-with-surely"> + <attribute name="with"> + <choice> + <data type="NCName"/> + </choice> + </attribute> + </define> + + <define name="cibtr-2.replace.attrs-common"> + <ref name="cibtr-2.replace.attr-what"/> + <optional> + <ref name="cibtr-2.replace.attr-msg-extra"/> + </optional> + <optional> + <ref name="cibtr-2.replace.attr-msg-severity"/> + </optional> + </define> + + <define name="cibtr-2.replace.attrs-redefined-as-in-case-of"> + <ref name="cibtr-2.replace.attr-redefined-as"/> + <!-- can be combined with in-case-of, but cannot be combined + with in-case-of-droppable-prefix --> + <optional> + <ref name="cibtr-2.replace.attr-in-case-of"/> + </optional> + </define> + + <!-- leaf production using the above attribute definitions --> + + <define name="cibtr-2.replace.nonwhereaware"> + <element name="cibtr:replace"> + <ref name="cibtr-2.replace.attrs-common"/> + <choice> + <group> + <ref name="cibtr-2.replace.attr-with-possibly"/> + <optional> + <choice> + <ref name="cibtr-2.replace.attrs-redefined-as-in-case-of"/> + <ref name="cibtr-2.replace.attr-in-case-of"/> + </choice> + </optional> + </group> + <group> + <ref name="cibtr-2.replace.attr-with-surely"/> + <optional> + <choice> + <ref name="cibtr-2.replace.attrs-redefined-as-in-case-of"/> + <ref name="cibtr-2.replace.attr-in-case-of"/> + <ref name="cibtr-2.replace.attr-in-case-of-droppable-prefix"/> + </choice> + </optional> + </group> + </choice> + </element> + </define> + + <define name="cibtr-2.replace.whereaware"> + <element name="cibtr:replace"> + <ref name="cibtr-2.replace.attrs-common"/> + <!-- cf. comment at cibtr-2.table --> + <choice> + <group> + <ref name="cibtr-2.replace.attr-with-surely"/> + <ref name="cibtr-2.replace.attr-where"/> + <optional> + <choice> + <ref name="cibtr-2.replace.attrs-redefined-as-in-case-of"/> + <ref name="cibtr-2.replace.attr-in-case-of"/> + <ref name="cibtr-2.replace.attr-in-case-of-droppable-prefix"/> + </choice> + </optional> + </group> + <group> + <ref name="cibtr-2.replace.attr-with-surely"/> + <optional> + <ref name="cibtr-2.replace.attr-where"/> + </optional> + <choice> + <ref name="cibtr-2.replace.attrs-redefined-as-in-case-of"/> + <ref name="cibtr-2.replace.attr-in-case-of"/> + <ref name="cibtr-2.replace.attr-in-case-of-droppable-prefix"/> + </choice> + </group> + <group> + <ref name="cibtr-2.replace.attr-with-possibly"/> + <optional> + <ref name="cibtr-2.replace.attr-in-case-of"/> + </optional> + </group> + </choice> + </element> + </define> + +</grammar> diff --git a/xml/constraints-1.0.rng b/xml/constraints-1.0.rng new file mode 100644 index 0000000..ce273a3 --- /dev/null +++ b/xml/constraints-1.0.rng @@ -0,0 +1,182 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="rsc"><data type="IDREF"/></attribute> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + <attribute name="score-attribute-mangle"><text/></attribute> + </choice> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-1.2.rng b/xml/constraints-1.2.rng new file mode 100644 index 0000000..bff62db --- /dev/null +++ b/xml/constraints-1.2.rng @@ -0,0 +1,228 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + <attribute name="score-attribute-mangle"><text/></attribute> + </choice> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-2.1.rng b/xml/constraints-2.1.rng new file mode 100644 index 0000000..8bed941 --- /dev/null +++ b/xml/constraints-2.1.rng @@ -0,0 +1,236 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + <attribute name="score-attribute-mangle"><text/></attribute> + </choice> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-2.2.rng b/xml/constraints-2.2.rng new file mode 100644 index 0000000..98491ac --- /dev/null +++ b/xml/constraints-2.2.rng @@ -0,0 +1,249 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + <attribute name="score-attribute-mangle"><text/></attribute> + </choice> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-2.3.rng b/xml/constraints-2.3.rng new file mode 100644 index 0000000..17f7afa --- /dev/null +++ b/xml/constraints-2.3.rng @@ -0,0 +1,252 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + <attribute name="score-attribute-mangle"><text/></attribute> + </choice> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-2.6.rng b/xml/constraints-2.6.rng new file mode 100644 index 0000000..185db4a --- /dev/null +++ b/xml/constraints-2.6.rng @@ -0,0 +1,255 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="rsc-pattern"><text/></attribute> + </choice> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + <attribute name="score-attribute-mangle"><text/></attribute> + </choice> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-2.9.rng b/xml/constraints-2.9.rng new file mode 100644 index 0000000..d2c05a0 --- /dev/null +++ b/xml/constraints-2.9.rng @@ -0,0 +1,255 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="rsc-pattern"><text/></attribute> + </choice> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule-2.9.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + <attribute name="score-attribute-mangle"><text/></attribute> + </choice> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule-2.9.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-3.0.rng b/xml/constraints-3.0.rng new file mode 100644 index 0000000..11f4a0f --- /dev/null +++ b/xml/constraints-3.0.rng @@ -0,0 +1,256 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="rsc-pattern"><text/></attribute> + </choice> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule-2.9.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <externalRef href="score.rng"/> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule-2.9.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-3.5.rng b/xml/constraints-3.5.rng new file mode 100644 index 0000000..b0d94e4 --- /dev/null +++ b/xml/constraints-3.5.rng @@ -0,0 +1,256 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="rsc-pattern"><text/></attribute> + </choice> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule-3.5.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <externalRef href="score.rng"/> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule-3.5.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-3.6.rng b/xml/constraints-3.6.rng new file mode 100644 index 0000000..fece6b0 --- /dev/null +++ b/xml/constraints-3.6.rng @@ -0,0 +1,259 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="rsc-pattern"><text/></attribute> + </choice> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule-3.5.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <externalRef href="score.rng"/> + </optional> + <optional> + <attribute name="influence"><text/></attribute> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule-3.5.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-3.7.rng b/xml/constraints-3.7.rng new file mode 100644 index 0000000..e8c667e --- /dev/null +++ b/xml/constraints-3.7.rng @@ -0,0 +1,261 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="rsc-pattern"><text/></attribute> + </choice> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <externalRef href="rule-3.5.rng"/> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <externalRef href="score.rng"/> + </optional> + <optional> + <attribute name="influence"><text/></attribute> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <externalRef href="rule-3.5.rng"/> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-3.9.rng b/xml/constraints-3.9.rng new file mode 100644 index 0000000..9f0fa8b --- /dev/null +++ b/xml/constraints-3.9.rng @@ -0,0 +1,273 @@ +<?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-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="rsc-pattern"><text/></attribute> + </choice> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <grammar> + <include href="rule-3.9.rng"> + <start> + <ref name="element-rule-location"/> + </start> + </include> + </grammar> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <externalRef href="score.rng"/> + </optional> + <optional> + <attribute name="influence"><text/></attribute> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <grammar> + <include href="rule-3.9.rng"> + <start> + <ref name="element-rule-location"/> + </start> + </include> + </grammar> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/constraints-next.rng b/xml/constraints-next.rng new file mode 100644 index 0000000..58fd27f --- /dev/null +++ b/xml/constraints-next.rng @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + @COMPAT: The constraints-next schema is deprecated since 2.1.5 and will be + removed in a future release. +--> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-constraints"/> + </start> + + <define name="element-constraints"> + <element name="constraints"> + <zeroOrMore> + <choice> + <ref name="element-location"/> + <ref name="element-colocation"/> + <ref name="element-order"/> + <ref name="element-rsc_ticket"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-location"> + <element name="rsc_location"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="rsc-pattern"><text/></attribute> + </choice> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + </choice> + <choice> + <group> + <externalRef href="score.rng"/> + <attribute name="node"><text/></attribute> + </group> + <oneOrMore> + <grammar> + <include href="rule-3.9.rng"> + <start> + <ref name="element-rule-location"/> + </start> + </include> + </grammar> + </oneOrMore> + </choice> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="resource-discovery"> + <ref name="attribute-discovery"/> + </attribute> + </optional> + </element> + </define> + + <define name="element-resource-set"> + <element name="resource_set"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="sequential"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="ordering"> + <choice> + <value>group</value> + <value>listed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <oneOrMore> + <element name="resource_ref"> + <attribute name="id"><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="element-colocation"> + <element name="rsc_colocation"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <externalRef href="score.rng"/> + </optional> + <optional> + <attribute name="influence"><text/></attribute> + </optional> + <optional> + <ref name="element-lifetime"/> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <attribute name="with-rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="node-attribute"><text/></attribute> + </optional> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="with-rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + <optional> + <attribute name="rsc-instance"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="with-rsc-instance"><data type="integer"/></attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-order"> + <element name="rsc_order"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <ref name="element-lifetime"/> + </optional> + <optional> + <attribute name="symmetrical"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="require-all"><data type="boolean"/></attribute> + </optional> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="kind"> + <ref name="order-types"/> + </attribute> + </choice> + </optional> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="first"><data type="IDREF"/></attribute> + <attribute name="then"><data type="IDREF"/></attribute> + <optional> + <attribute name="first-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="then-action"> + <ref name="attribute-actions"/> + </attribute> + </optional> + <optional> + <attribute name="first-instance"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="then-instance"><data type="integer"/></attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="element-rsc_ticket"> + <element name="rsc_ticket"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <oneOrMore> + <ref name="element-resource-set"/> + </oneOrMore> + <group> + <attribute name="rsc"><data type="IDREF"/></attribute> + <optional> + <attribute name="rsc-role"> + <ref name="attribute-roles"/> + </attribute> + </optional> + </group> + </choice> + <attribute name="ticket"><text/></attribute> + <optional> + <attribute name="loss-policy"> + <choice> + <value>stop</value> + <value>demote</value> + <value>fence</value> + <value>freeze</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="attribute-discovery"> + <choice> + <value>always</value> + <value>never</value> + <value>exclusive</value> + </choice> + </define> + + <define name="attribute-actions"> + <choice> + <value>start</value> + <value>promote</value> + <value>demote</value> + <value>stop</value> + </choice> + </define> + + <define name="attribute-roles"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + <value>Master</value> + <value>Slave</value> + </choice> + </define> + + <define name="order-types"> + <choice> + <value>Optional</value> + <value>Mandatory</value> + <value>Serialize</value> + </choice> + </define> + + <define name="element-lifetime"> + <element name="lifetime"> + <oneOrMore> + <grammar> + <include href="rule-3.9.rng"> + <start> + <ref name="element-rule-location"/> + </start> + </include> + </grammar> + </oneOrMore> + </element> + </define> + +</grammar> diff --git a/xml/context-of.xsl b/xml/context-of.xsl new file mode 100644 index 0000000..96b8c17 --- /dev/null +++ b/xml/context-of.xsl @@ -0,0 +1,83 @@ +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:output method="text"/> +<xsl:param name="goal-name" select="'id'"/> +<xsl:param name="goal-value" select="'GOAL'"/> +<xsl:param name="style" select="'rng'"/> +<xsl:param name="skip" select="0"/> + +<xsl:template match="/"> + <xsl:choose> + <xsl:when test="not(.//@*[ + name() = $goal-name + and + . = $goal-value + ])"> + <xsl:message terminate="yes">NOTFOUND</xsl:message> + </xsl:when> + <xsl:when test="$style = 'xml'"> + <xsl:call-template name="xpath-xml-elem"> + <xsl:with-param name="terminal-elem" + select=".//@*[ + name() = $goal-name + and + . = $goal-value + ]/.."/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$style = 'rng'"> + <xsl:call-template name="xpath-rng-elem"> + <xsl:with-param name="terminal-elem" + select=".//@*[ + name() = $goal-name + and + . = $goal-value + ]/.."/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes">BADSTYLE</xsl:message> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="xpath-xml-elem"> + <xsl:param name="terminal-elem"/> + <xsl:variable name="TotalCount" + select="count($terminal-elem/ancestor-or-self::*)"/> + <xsl:for-each select="$terminal-elem/ancestor-or-self::*"> + <xsl:if test="$TotalCount - position() >= $skip"> + <xsl:value-of select="concat('/', name())"/> + </xsl:if> + </xsl:for-each> + <xsl:value-of select="'
'"/> +</xsl:template> + +<xsl:template name="xpath-rng-elem"> + <xsl:param name="terminal-elem"/> + <xsl:variable name="TotalCount" + select="count($terminal-elem/ancestor-or-self::*)"/> + <xsl:for-each select="$terminal-elem/ancestor-or-self::*"> + <xsl:if test="$TotalCount - position() >= $skip"> + <xsl:choose> + <xsl:when test="name() = 'attribute'"> + <xsl:value-of select="concat('/@', @name)"/> + </xsl:when> + <xsl:when test="name() = 'define'"> + <xsl:value-of select="concat('/<', @name, '>')"/> + </xsl:when> + <xsl:when test="name() = 'element'"> + <xsl:value-of select="concat('/', @name)"/> + </xsl:when> + <xsl:when test="name() = 'grammar'"> + <xsl:if test="$TotalCount < 3"> + <xsl:value-of select="concat('<', name(), '>')"/> + </xsl:if> + </xsl:when> + </xsl:choose> + </xsl:if> + </xsl:for-each> + <xsl:value-of select="'
'"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/crm.xsl b/xml/crm.xsl new file mode 100644 index 0000000..25bfbaf --- /dev/null +++ b/xml/crm.xsl @@ -0,0 +1,176 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- Edited with XML Spy v2007 (http://www.altova.com) --> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/> + +<xsl:template match="cib"> + <h2>Cluster Configuration: <xsl:value-of select="@admin_epoch"/>.<xsl:value-of select="@epoch"/>.<xsl:value-of select="@num_updates"/></h2> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="cluster_property_set"> + <li> + Property Set: <xsl:value-of select="@id"/> + <xsl:apply-templates/> + </li> +</xsl:template> + +<xsl:template match="node"> + <li> + <b>Node <xsl:value-of select="@uname"/></b> (<xsl:value-of select="@id"/>) + <xsl:apply-templates select="node()"/> + </li> +</xsl:template> + +<xsl:template match="primitive"> + <li> + <b>Resource + <xsl:value-of select="@class"/>::<xsl:value-of select="@type"/>:<xsl:value-of select="@id"/> + </b> + <ul> + <xsl:apply-templates select="node()"/> + Preferred Locations: + <xsl:call-template name="location_prefs"> + <xsl:with-param name="resource" select="@id"/> + </xsl:call-template> + </ul> + </li> +</xsl:template> + +<xsl:template name="location_prefs"> + <xsl:parameter name="resource"/> + <xsl:for-each select="/cib/configuration/constraints/rsc_location"> + <xsl:if test="@rsc = $resource"> + <xsl:apply-templates/> + </xsl:if> + <xsl:text> </xsl:text> + </xsl:for-each> +</xsl:template> + +<xsl:template match="group"> + <li> + <h4>Resource Group <xsl:value-of select="@id"/></h4> + <ul><xsl:apply-templates/></ul> + </li> +</xsl:template> + +<xsl:template match="clone"> + <li> + <h4>Cloned Resource <xsl:value-of select="@id"/></h4> + <ul><xsl:apply-templates/></ul> + </li> +</xsl:template> + +<xsl:template match="op"> + <li> + <xsl:value-of select="@name"/>: + interval=<xsl:value-of select="@interval"/> + timeout=<xsl:value-of select="@timeout"/> + </li> +</xsl:template> + +<xsl:template match="instance_attributes"> + Options: <xsl:value-of select="@id"/> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="rsc_location"> + Location: <xsl:value-of select="@rsc"/> + <ul><xsl:apply-templates/></ul> +</xsl:template> + +<xsl:template match="rule"> + <ul><xsl:apply-templates/></ul> +</xsl:template> + +<xsl:template match="expression"> + <li> + <xsl:value-of select="@attribute"/> + <xsl:text> </xsl:text> + <xsl:value-of select="@operation"/> + <xsl:text> </xsl:text> + <xsl:value-of select="@value"/> + <xsl:text> </xsl:text> + (score=<xsl:value-of select="../@score"/>) + <xsl:apply-templates/> + </li> +</xsl:template> + +<xsl:template match="attributes/nvpair"> + <li> + <xsl:value-of select="@name"/>="<xsl:value-of select="@value"/>" + </li> +</xsl:template> + +<xsl:template match="crm_config"> + <h3>Cluster Options</h3> + <ul><xsl:apply-templates/></ul> +</xsl:template> + +<xsl:template match="nodes"> + <h3>Available Nodes</h3> + <ul> + <xsl:apply-templates/> + </ul> +</xsl:template> + +<xsl:template match="resources"> + <h3>Configured Resources</h3> + <ul> + <xsl:apply-templates/> + </ul> +</xsl:template> + +<xsl:template match="constraints"> + <h3>Inter-Resource Relationships</h3> + <xsl:apply-templates select="rsc_colocation"/> + <xsl:apply-templates select="rsc_order"/> +</xsl:template> + +<xsl:template match="configuration"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="attributes"> + <ul> + <xsl:apply-templates/> + </ul> +</xsl:template> + +<xsl:template match="operations"> + Operations: + <ul> + <xsl:apply-templates/> + </ul> +</xsl:template> + +<xsl:template match="status"/> + +<xsl:template match="/"> + <html> + <body> + <xsl:apply-templates/> + </body> + </html> +</xsl:template> + +<xsl:template match="*"> + <div> + <ul> + <font color="#777777">Unknown Object: </font> + <xsl:value-of select="name()"/> + <p><xsl:apply-templates select="@*"/></p> + <xsl:apply-templates select="node()" /> + </ul> + </div> +</xsl:template> + +<xsl:template match="@*"> + <xsl:value-of select="name()"/> + <xsl:text>=</xsl:text> + <xsl:value-of select="."/> + <xsl:text> </xsl:text> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/fencing-1.2.rng b/xml/fencing-1.2.rng new file mode 100644 index 0000000..4dc72d6 --- /dev/null +++ b/xml/fencing-1.2.rng @@ -0,0 +1,34 @@ +<?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> + <optional> + <ref name="element-stonith"/> + </optional> + </start> + + <define name="element-stonith"> + <element name="fencing-topology"> + <zeroOrMore> + <ref name="element-level"/> + </zeroOrMore> + </element> + </define> + + <define name="element-level"> + <element name="fencing-level"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="target"><text/></attribute> + <attribute name="target-pattern"><text/></attribute> + </choice> + <attribute name="index"><data type="positiveInteger"/></attribute> + <attribute name="devices"> + <data type="string"> + <param name="pattern">([a-zA-Z0-9_\.\-]+)(,[a-zA-Z0-9_\.\-]+)*</param> + </data> + </attribute> + </element> + </define> + +</grammar> diff --git a/xml/fencing-2.4.rng b/xml/fencing-2.4.rng new file mode 100644 index 0000000..e01f2f4 --- /dev/null +++ b/xml/fencing-2.4.rng @@ -0,0 +1,38 @@ +<?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> + <optional> + <ref name="element-stonith"/> + </optional> + </start> + + <define name="element-stonith"> + <element name="fencing-topology"> + <zeroOrMore> + <ref name="element-level"/> + </zeroOrMore> + </element> + </define> + + <define name="element-level"> + <element name="fencing-level"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="target"><text/></attribute> + <attribute name="target-pattern"><text/></attribute> + <group> + <attribute name="target-attribute"><text/></attribute> + <attribute name="target-value"><text/></attribute> + </group> + </choice> + <attribute name="index"><data type="positiveInteger"/></attribute> + <attribute name="devices"> + <data type="string"> + <param name="pattern">([a-zA-Z0-9_\.\-]+)(,[a-zA-Z0-9_\.\-]+)*</param> + </data> + </attribute> + </element> + </define> + +</grammar> diff --git a/xml/nodes-1.0.rng b/xml/nodes-1.0.rng new file mode 100644 index 0000000..82153ab --- /dev/null +++ b/xml/nodes-1.0.rng @@ -0,0 +1,34 @@ +<?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-nodes"/> + </start> + + <define name="element-nodes"> + <element name="nodes"> + <zeroOrMore> + <element name="node"> + <attribute name="id"><text/></attribute> + <attribute name="uname"><text/></attribute> + <attribute name="type"> + <choice> + <value>normal</value> + <value>member</value> + <value>ping</value> + </choice> + </attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <zeroOrMore> + <element name="instance_attributes"> + <externalRef href="nvset.rng"/> + </element> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/nodes-1.2.rng b/xml/nodes-1.2.rng new file mode 100644 index 0000000..d8e9399 --- /dev/null +++ b/xml/nodes-1.2.rng @@ -0,0 +1,44 @@ +<?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-nodes"/> + </start> + + <define name="element-nodes"> + <element name="nodes"> + <zeroOrMore> + <element name="node"> + <attribute name="id"><text/></attribute> + <attribute name="uname"><text/></attribute> + <optional> + <attribute name="type"> + <choice> + <value>normal</value> + <value>member</value> + <value>ping</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <zeroOrMore> + <choice> + <element name="instance_attributes"> + <externalRef href="nvset.rng"/> + </element> + <element name="utilization"> + <externalRef href="nvset.rng"/> + </element> + </choice> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/nodes-1.3.rng b/xml/nodes-1.3.rng new file mode 100644 index 0000000..9403860 --- /dev/null +++ b/xml/nodes-1.3.rng @@ -0,0 +1,45 @@ +<?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-nodes"/> + </start> + + <define name="element-nodes"> + <element name="nodes"> + <zeroOrMore> + <element name="node"> + <attribute name="id"><text/></attribute> + <attribute name="uname"><text/></attribute> + <optional> + <attribute name="type"> + <choice> + <value>normal</value> + <value>member</value> + <value>ping</value> + <value>remote</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <zeroOrMore> + <choice> + <element name="instance_attributes"> + <externalRef href="nvset-1.3.rng"/> + </element> + <element name="utilization"> + <externalRef href="nvset-1.3.rng"/> + </element> + </choice> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/nodes-2.9.rng b/xml/nodes-2.9.rng new file mode 100644 index 0000000..85a8670 --- /dev/null +++ b/xml/nodes-2.9.rng @@ -0,0 +1,45 @@ +<?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-nodes"/> + </start> + + <define name="element-nodes"> + <element name="nodes"> + <zeroOrMore> + <element name="node"> + <attribute name="id"><text/></attribute> + <attribute name="uname"><text/></attribute> + <optional> + <attribute name="type"> + <choice> + <value>normal</value> + <value>member</value> + <value>ping</value> + <value>remote</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <zeroOrMore> + <choice> + <element name="instance_attributes"> + <externalRef href="nvset-2.9.rng"/> + </element> + <element name="utilization"> + <externalRef href="nvset-2.9.rng"/> + </element> + </choice> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/nodes-3.0.rng b/xml/nodes-3.0.rng new file mode 100644 index 0000000..5a213c4 --- /dev/null +++ b/xml/nodes-3.0.rng @@ -0,0 +1,44 @@ +<?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-nodes"/> + </start> + + <define name="element-nodes"> + <element name="nodes"> + <zeroOrMore> + <element name="node"> + <attribute name="id"><text/></attribute> + <attribute name="uname"><text/></attribute> + <optional> + <attribute name="type"> + <choice> + <value>member</value> + <value>ping</value> + <value>remote</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <zeroOrMore> + <choice> + <element name="instance_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + <element name="utilization"> + <externalRef href="nvset-3.0.rng"/> + </element> + </choice> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/nodes-3.4.rng b/xml/nodes-3.4.rng new file mode 100644 index 0000000..0132c72 --- /dev/null +++ b/xml/nodes-3.4.rng @@ -0,0 +1,44 @@ +<?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-nodes"/> + </start> + + <define name="element-nodes"> + <element name="nodes"> + <zeroOrMore> + <element name="node"> + <attribute name="id"><text/></attribute> + <attribute name="uname"><text/></attribute> + <optional> + <attribute name="type"> + <choice> + <value>member</value> + <value>ping</value> + <value>remote</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <zeroOrMore> + <choice> + <element name="instance_attributes"> + <externalRef href="nvset-3.4.rng"/> + </element> + <element name="utilization"> + <externalRef href="nvset-3.4.rng"/> + </element> + </choice> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/nodes-3.5.rng b/xml/nodes-3.5.rng new file mode 100644 index 0000000..e7a9409 --- /dev/null +++ b/xml/nodes-3.5.rng @@ -0,0 +1,44 @@ +<?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-nodes"/> + </start> + + <define name="element-nodes"> + <element name="nodes"> + <zeroOrMore> + <element name="node"> + <attribute name="id"><text/></attribute> + <attribute name="uname"><text/></attribute> + <optional> + <attribute name="type"> + <choice> + <value>member</value> + <value>ping</value> + <value>remote</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <zeroOrMore> + <choice> + <element name="instance_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + <element name="utilization"> + <externalRef href="nvset-3.5.rng"/> + </element> + </choice> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/nodes-3.9.rng b/xml/nodes-3.9.rng new file mode 100644 index 0000000..9454ee3 --- /dev/null +++ b/xml/nodes-3.9.rng @@ -0,0 +1,44 @@ +<?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-nodes"/> + </start> + + <define name="element-nodes"> + <element name="nodes"> + <zeroOrMore> + <element name="node"> + <attribute name="id"><text/></attribute> + <attribute name="uname"><text/></attribute> + <optional> + <attribute name="type"> + <choice> + <value>member</value> + <value>ping</value> + <value>remote</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <externalRef href="score.rng"/> + </optional> + <zeroOrMore> + <choice> + <element name="instance_attributes"> + <externalRef href="nvset-3.9.rng"/> + </element> + <element name="utilization"> + <externalRef href="nvset-3.9.rng"/> + </element> + </choice> + </zeroOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/nvset-1.3.rng b/xml/nvset-1.3.rng new file mode 100644 index 0000000..9f0de23 --- /dev/null +++ b/xml/nvset-1.3.rng @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- types: http://www.w3.org/TR/xmlschema-2/#dateTime --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-nvset"/> + </start> + + <define name="element-nvset"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <interleave> + <optional> + <externalRef href="rule.rng"/> + </optional> + <zeroOrMore> + <element name="nvpair"> + <choice> + <group> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <optional> + <attribute name="name"><text/></attribute> + </optional> + </group> + <group> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </group> + </choice> + </element> + </zeroOrMore> + <optional> + <externalRef href="score.rng"/> + </optional> + </interleave> + </group> + </choice> + </define> + +</grammar> diff --git a/xml/nvset-2.9.rng b/xml/nvset-2.9.rng new file mode 100644 index 0000000..0d43be5 --- /dev/null +++ b/xml/nvset-2.9.rng @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- types: http://www.w3.org/TR/xmlschema-2/#dateTime --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-nvset"/> + </start> + + <define name="element-nvset"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <interleave> + <optional> + <externalRef href="rule-2.9.rng"/> + </optional> + <zeroOrMore> + <element name="nvpair"> + <choice> + <group> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <optional> + <attribute name="name"><text/></attribute> + </optional> + </group> + <group> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </group> + </choice> + </element> + </zeroOrMore> + <optional> + <externalRef href="score.rng"/> + </optional> + </interleave> + </group> + </choice> + </define> + +</grammar> diff --git a/xml/nvset-3.0.rng b/xml/nvset-3.0.rng new file mode 100644 index 0000000..7555dcb --- /dev/null +++ b/xml/nvset-3.0.rng @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- just as nvset-2.9.rng, but allows for instantiated @name restrictions --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-nvset"/> + </start> + + <!-- nvpair/@name: + * generic string by default, parent grammar may want to prohibit + enumerated names --> + <define name="element-nvset.name"> + <attribute name="name"> + <text/> + </attribute> + </define> + + <!-- nvpair/@name: + * defer element-nvset.name grammar item + nvpair/@value: + generic string by default, parent grammar may want to restrict + enumerated pairs (i.e. related to @name) at once --> + <define name="element-nvset.name-value"> + <ref name="element-nvset.name"/> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </define> + + <define name="element-nvset"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <interleave> + <optional> + <externalRef href="rule-2.9.rng"/> + </optional> + <zeroOrMore> + <element name="nvpair"> + <choice> + <group> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <optional> + <attribute name="name"><text/></attribute> + </optional> + </group> + <group> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-nvset.name-value"/> + </group> + </choice> + </element> + </zeroOrMore> + <optional> + <externalRef href="score.rng"/> + </optional> + </interleave> + </group> + </choice> + </define> + +</grammar> diff --git a/xml/nvset-3.4.rng b/xml/nvset-3.4.rng new file mode 100644 index 0000000..91a7d23 --- /dev/null +++ b/xml/nvset-3.4.rng @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- just as nvset-2.9.rng, but allows for instantiated @name restrictions --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-nvset"/> + </start> + + <!-- nvpair/@name: + * generic string by default, parent grammar may want to prohibit + enumerated names --> + <define name="element-nvset.name"> + <attribute name="name"> + <text/> + </attribute> + </define> + + <!-- nvpair/@name: + * defer element-nvset.name grammar item + nvpair/@value: + generic string by default, parent grammar may want to restrict + enumerated pairs (i.e. related to @name) at once --> + <define name="element-nvset.name-value"> + <ref name="element-nvset.name"/> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </define> + + <define name="element-nvset"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <interleave> + <optional> + <externalRef href="rule-3.4.rng"/> + </optional> + <zeroOrMore> + <element name="nvpair"> + <choice> + <group> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <optional> + <attribute name="name"><text/></attribute> + </optional> + </group> + <group> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-nvset.name-value"/> + </group> + </choice> + </element> + </zeroOrMore> + <optional> + <externalRef href="score.rng"/> + </optional> + </interleave> + </group> + </choice> + </define> + +</grammar> diff --git a/xml/nvset-3.5.rng b/xml/nvset-3.5.rng new file mode 100644 index 0000000..92225f9 --- /dev/null +++ b/xml/nvset-3.5.rng @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- just as nvset-2.9.rng, but allows for instantiated @name restrictions --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-nvset"/> + </start> + + <!-- nvpair/@name: + * generic string by default, parent grammar may want to prohibit + enumerated names --> + <define name="element-nvset.name"> + <attribute name="name"> + <text/> + </attribute> + </define> + + <!-- nvpair/@name: + * defer element-nvset.name grammar item + nvpair/@value: + generic string by default, parent grammar may want to restrict + enumerated pairs (i.e. related to @name) at once --> + <define name="element-nvset.name-value"> + <ref name="element-nvset.name"/> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </define> + + <define name="element-nvset"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <interleave> + <optional> + <externalRef href="rule-3.5.rng"/> + </optional> + <zeroOrMore> + <element name="nvpair"> + <choice> + <group> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <optional> + <attribute name="name"><text/></attribute> + </optional> + </group> + <group> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-nvset.name-value"/> + </group> + </choice> + </element> + </zeroOrMore> + <optional> + <externalRef href="score.rng"/> + </optional> + </interleave> + </group> + </choice> + </define> + +</grammar> diff --git a/xml/nvset-3.9.rng b/xml/nvset-3.9.rng new file mode 100644 index 0000000..96383bc --- /dev/null +++ b/xml/nvset-3.9.rng @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- just as nvset-2.9.rng, but allows for instantiated @name restrictions --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-nvset"/> + </start> + + <!-- nvpair/@name: + * generic string by default, parent grammar may want to prohibit + enumerated names --> + <define name="element-nvset.name"> + <attribute name="name"> + <text/> + </attribute> + </define> + + <!-- nvpair/@name: + * defer element-nvset.name grammar item + nvpair/@value: + generic string by default, parent grammar may want to restrict + enumerated pairs (i.e. related to @name) at once --> + <define name="element-nvset.name-value"> + <ref name="element-nvset.name"/> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </define> + + <!-- Allow easy redefinition in parent grammars --> + <define name="element-nvset.rule"> + <externalRef href="rule-3.9.rng"/> + </define> + + <define name="element-nvset"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <interleave> + <optional> + <ref name="element-nvset.rule"/> + </optional> + <zeroOrMore> + <element name="nvpair"> + <choice> + <group> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <optional> + <attribute name="name"><text/></attribute> + </optional> + </group> + <group> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-nvset.name-value"/> + </group> + </choice> + </element> + </zeroOrMore> + <optional> + <externalRef href="score.rng"/> + </optional> + </interleave> + </group> + </choice> + </define> + +</grammar> diff --git a/xml/nvset.rng b/xml/nvset.rng new file mode 100644 index 0000000..62eaa47 --- /dev/null +++ b/xml/nvset.rng @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- types: http://www.w3.org/TR/xmlschema-2/#dateTime --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-nvset"/> + </start> + + <define name="element-nvset"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <interleave> + <optional> + <externalRef href="rule.rng"/> + </optional> + <zeroOrMore> + <element name="nvpair"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </element> + </zeroOrMore> + <optional> + <externalRef href="score.rng"/> + </optional> + </interleave> + </group> + </choice> + </define> + +</grammar> diff --git a/xml/ocf-meta2man.xsl b/xml/ocf-meta2man.xsl new file mode 100644 index 0000000..67f5dbb --- /dev/null +++ b/xml/ocf-meta2man.xsl @@ -0,0 +1,224 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:output indent="yes" + doctype-public="-//OASIS//DTD DocBook XML V4.4//EN" + doctype-system="docbookx.dtd"/> + + <!--<xsl:strip-space elements="longdesc shortdesc"/>--> + + + <!-- --> + <xsl:param name="man.name">NA</xsl:param> + + <!-- --> + <xsl:param name="man.vol">7</xsl:param> + + <!-- --> + <xsl:param name="variable.prefix"> </xsl:param> + + <!-- --> + <xsl:param name="command.prefix"> </xsl:param> + + <!-- Separator between different action/@name --> + <xsl:param name="separator"> | </xsl:param> + + <xsl:template match="/"> + <refentry> + <xsl:apply-templates mode="root"/> + </refentry> + </xsl:template> + + <xsl:template match="resource-agent" mode="root"> + <xsl:param name="this" select="self::resource-agent"/> + <info> + <author> + <personname> + <firstname>Andrew</firstname> + <surname>Beekhof</surname> + <email>andrew@beekhof.net</email> + </personname> + </author> + </info> + <refmeta> + <refentrytitle><xsl:value-of select="concat($command.prefix, @name)"/></refentrytitle> + <manvolnum><xsl:value-of select="$man.vol"/></manvolnum> + <refmiscinfo> + <source></source> + <manual>Pacemaker Configuration</manual> + </refmiscinfo> + </refmeta> + <refnamediv> + <refname> + <xsl:choose> + <xsl:when test="$man.name = 'NA'"> + <xsl:value-of select="concat($command.prefix, @name)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$man.name"/> + </xsl:otherwise> + </xsl:choose> + </refname> + <refpurpose><xsl:apply-templates select="shortdesc"/></refpurpose> + </refnamediv> + <xsl:apply-templates select="$this" mode="synopsis"/> + <xsl:apply-templates select="$this" mode="description"/> + <xsl:apply-templates select="$this" mode="parameters"/> + </xsl:template> + + + <!-- Empty Templates --> + <xsl:template match="node()" mode="root"/> + + <xsl:template match="*" mode="synopsis"/> + <xsl:template match="*" mode="description"/> + <xsl:template match="*" mode="parameters"/> + + <!-- Mode synopsis --> + <xsl:template match="resource-agent" mode="synopsis"> + <xsl:text> </xsl:text> + <refsect1><xsl:text> </xsl:text> + <title>Synopsis</title> + <xsl:text> </xsl:text> + <para> + <xsl:apply-templates select="parameters/parameter" mode="synopsis"/> + <xsl:text> </xsl:text> + <literal/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="actions" mode="synopsis"> + <xsl:with-param name="name" select="@name"/> + </xsl:apply-templates> + </para> + <xsl:text> </xsl:text> + </refsect1> + </xsl:template> + + <xsl:template match="parameters/parameter" mode="synopsis"> + <xsl:if test="not(@unique='1')"> + <xsl:text>[</xsl:text> + </xsl:if> + + <command><xsl:value-of select="concat($variable.prefix, @name)"/></command> + <xsl:text>=</xsl:text> + <xsl:value-of select="content/@type"/> + + <xsl:if test="not(@unique='1')"> + <xsl:text>]</xsl:text> + </xsl:if> + + <xsl:text> </xsl:text> + </xsl:template> + + + <xsl:template match="actions" mode="synopsis"> + <xsl:param name="name"/> + + <command><xsl:value-of select="$name"/></command> + <xsl:text> [</xsl:text> + <xsl:apply-templates select="action" mode="synopsis"/> + <xsl:text>]</xsl:text> + </xsl:template> + + + <xsl:template match="action" mode="synopsis"> + <xsl:value-of select="@name"/> + <xsl:if test="following-sibling::action"> + <xsl:value-of select="$separator"/> + </xsl:if> + </xsl:template> + + + <!-- Mode Description --> + <xsl:template match="resource-agent" mode="description"> + <xsl:text> </xsl:text> + <refsect1><xsl:text> </xsl:text> + <title>Description</title> + <xsl:apply-templates mode="description"/> + </refsect1> + <xsl:text> </xsl:text> + </xsl:template> + + <xsl:template match="longdesc" mode="description"> + <para> + <xsl:apply-templates mode="description"/> + </para> + </xsl:template> + + + <!-- Mode Parameters --> + <xsl:template match="resource-agent" mode="parameters"> + <xsl:text> </xsl:text> + <refsect1><xsl:text> </xsl:text> + <title>Supported Parameters</title> + <xsl:apply-templates mode="parameters"/> + </refsect1> + <xsl:text> </xsl:text> + </xsl:template> + + <xsl:template match="resource-agent/shortdesc|resource-agent/longdesc" mode="parameters"/> + + <xsl:template match="parameters" mode="parameters"> + <variablelist> + <xsl:apply-templates mode="parameters"/> + </variablelist> + </xsl:template> + + + <xsl:template match="parameter" mode="parameters"> + <varlistentry> + <term> + <command><xsl:value-of select="concat($variable.prefix, @name)"/></command> + <xsl:text> = </xsl:text> + <xsl:value-of select="content/@type"/> + <xsl:if test="content/@default"> + <xsl:text> [</xsl:text> + <xsl:value-of select="content/@default"/> + <xsl:text>]</xsl:text> + </xsl:if> + </term> + <xsl:text> </xsl:text> + <xsl:choose> + <xsl:when test="longdesc/text() = shortdesc/text()"> + <listitem> + <para> + <xsl:value-of select="shortdesc/text()"/> + </para> + </listitem> + </xsl:when> + <xsl:otherwise> + <listitem> + <para> + <xsl:value-of select="shortdesc/text()"/> + </para> + <para> + <xsl:value-of select="longdesc/text()"/> + </para> + </listitem> + </xsl:otherwise> + </xsl:choose> + <!--xsl:if test="longdesc"> + <xsl:if test="longdesc != shortdesc"> + <listitem> + <xsl:text> </xsl:text> + <xsl:apply-templates select="longdesc" mode="parameters"/> + </listitem> + </xsl:if> + </xsl:if--> + <xsl:text> </xsl:text> + </varlistentry> + </xsl:template> + + + <xsl:template match="longdesc" mode="parameters"> + <para> + <xsl:apply-templates select="text()" mode="parameters"/> + </para> + </xsl:template> + + + <xsl:template match="shortdesc" mode="parameters"> + <xsl:apply-templates select="text()" mode="parameters"/> + </xsl:template> + +</xsl:stylesheet> diff --git a/xml/options-1.0.rng b/xml/options-1.0.rng new file mode 100644 index 0000000..b9e7ffe --- /dev/null +++ b/xml/options-1.0.rng @@ -0,0 +1,34 @@ +<?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> + <interleave> + <element name="crm_config"> + <zeroOrMore> + <element name="cluster_property_set"> + <externalRef href="nvset.rng"/> + </element> + </zeroOrMore> + </element> + <optional> + <element name="rsc_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <externalRef href="nvset.rng"/> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="op_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <externalRef href="nvset.rng"/> + </element> + </zeroOrMore> + </element> + </optional> + </interleave> + </start> + +</grammar> diff --git a/xml/options-3.0.rng b/xml/options-3.0.rng new file mode 100644 index 0000000..c01cb06 --- /dev/null +++ b/xml/options-3.0.rng @@ -0,0 +1,111 @@ +<?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="options"/> + </start> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="cluster-properties" + --> + <define name="cluster_property_set.nvpair.name-value-unsupported"> + <choice> + <group> + <attribute name="name"> + <value type="string">cluster-infrastructure</value> + </attribute> + <attribute name="value"> + <data type="string"> + <except> + <choice> + <value>heartbeat</value> + <value>openais</value> + <value>classic openais</value> + <value>classic openais (with plugin)</value> + <value>cman</value> + </choice> + </except> + </data> + </attribute> + </group> + <group> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>cluster-infrastructure</value> + <value>cluster_recheck_interval</value> + <value>dc_deadtime</value> + <value>default-action-timeout</value> + <value>default_action_timeout</value> + <value>default-migration-threshold</value> + <value>default_migration_threshold</value> + <value>default-resource-failure-stickiness</value> + <value>default_resource_failure_stickiness</value> + <value>default-resource-stickiness</value> + <value>default_resource_stickiness</value> + <value>election_timeout</value> + <value>expected-quorum-votes</value> + <value>is-managed-default</value> + <value>is_managed_default</value> + <value>no_quorum_policy</value> + <value>notification-agent</value> + <value>notification-recipient</value> + <value>remove_after_stop</value> + <value>shutdown_escalation</value> + <value>startup_fencing</value> + <value>stonith_action</value> + <value>stonith_enabled</value> + <value>stop_orphan_actions</value> + <value>stop_orphan_resources</value> + <value>symmetric_cluster</value> + <value>transition_idle_timeout</value> + </choice> + </except> + </data> + </attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </group> + </choice> + </define> + + <define name="options"> + <interleave> + <element name="crm_config"> + <zeroOrMore> + <element name="cluster_property_set"> + <grammar> + <include href="nvset-3.0.rng"> + <define name="element-nvset.name-value"> + <parentRef name="cluster_property_set.nvpair.name-value-unsupported"/> + </define> + </include> + </grammar> + </element> + </zeroOrMore> + </element> + <optional> + <element name="rsc_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="op_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + </zeroOrMore> + </element> + </optional> + </interleave> + </define> + +</grammar> diff --git a/xml/options-3.4.rng b/xml/options-3.4.rng new file mode 100644 index 0000000..22330d8 --- /dev/null +++ b/xml/options-3.4.rng @@ -0,0 +1,111 @@ +<?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="options"/> + </start> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="cluster-properties" + --> + <define name="cluster_property_set.nvpair.name-value-unsupported"> + <choice> + <group> + <attribute name="name"> + <value type="string">cluster-infrastructure</value> + </attribute> + <attribute name="value"> + <data type="string"> + <except> + <choice> + <value>heartbeat</value> + <value>openais</value> + <value>classic openais</value> + <value>classic openais (with plugin)</value> + <value>cman</value> + </choice> + </except> + </data> + </attribute> + </group> + <group> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>cluster-infrastructure</value> + <value>cluster_recheck_interval</value> + <value>dc_deadtime</value> + <value>default-action-timeout</value> + <value>default_action_timeout</value> + <value>default-migration-threshold</value> + <value>default_migration_threshold</value> + <value>default-resource-failure-stickiness</value> + <value>default_resource_failure_stickiness</value> + <value>default-resource-stickiness</value> + <value>default_resource_stickiness</value> + <value>election_timeout</value> + <value>expected-quorum-votes</value> + <value>is-managed-default</value> + <value>is_managed_default</value> + <value>no_quorum_policy</value> + <value>notification-agent</value> + <value>notification-recipient</value> + <value>remove_after_stop</value> + <value>shutdown_escalation</value> + <value>startup_fencing</value> + <value>stonith_action</value> + <value>stonith_enabled</value> + <value>stop_orphan_actions</value> + <value>stop_orphan_resources</value> + <value>symmetric_cluster</value> + <value>transition_idle_timeout</value> + </choice> + </except> + </data> + </attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </group> + </choice> + </define> + + <define name="options"> + <interleave> + <element name="crm_config"> + <zeroOrMore> + <element name="cluster_property_set"> + <grammar> + <include href="nvset-3.4.rng"> + <define name="element-nvset.name-value"> + <parentRef name="cluster_property_set.nvpair.name-value-unsupported"/> + </define> + </include> + </grammar> + </element> + </zeroOrMore> + </element> + <optional> + <element name="rsc_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <externalRef href="nvset-3.4.rng"/> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="op_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <externalRef href="nvset-3.4.rng"/> + </element> + </zeroOrMore> + </element> + </optional> + </interleave> + </define> + +</grammar> diff --git a/xml/options-3.5.rng b/xml/options-3.5.rng new file mode 100644 index 0000000..ffcebb7 --- /dev/null +++ b/xml/options-3.5.rng @@ -0,0 +1,111 @@ +<?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="options"/> + </start> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="cluster-properties" + --> + <define name="cluster_property_set.nvpair.name-value-unsupported"> + <choice> + <group> + <attribute name="name"> + <value type="string">cluster-infrastructure</value> + </attribute> + <attribute name="value"> + <data type="string"> + <except> + <choice> + <value>heartbeat</value> + <value>openais</value> + <value>classic openais</value> + <value>classic openais (with plugin)</value> + <value>cman</value> + </choice> + </except> + </data> + </attribute> + </group> + <group> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>cluster-infrastructure</value> + <value>cluster_recheck_interval</value> + <value>dc_deadtime</value> + <value>default-action-timeout</value> + <value>default_action_timeout</value> + <value>default-migration-threshold</value> + <value>default_migration_threshold</value> + <value>default-resource-failure-stickiness</value> + <value>default_resource_failure_stickiness</value> + <value>default-resource-stickiness</value> + <value>default_resource_stickiness</value> + <value>election_timeout</value> + <value>expected-quorum-votes</value> + <value>is-managed-default</value> + <value>is_managed_default</value> + <value>no_quorum_policy</value> + <value>notification-agent</value> + <value>notification-recipient</value> + <value>remove_after_stop</value> + <value>shutdown_escalation</value> + <value>startup_fencing</value> + <value>stonith_action</value> + <value>stonith_enabled</value> + <value>stop_orphan_actions</value> + <value>stop_orphan_resources</value> + <value>symmetric_cluster</value> + <value>transition_idle_timeout</value> + </choice> + </except> + </data> + </attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </group> + </choice> + </define> + + <define name="options"> + <interleave> + <element name="crm_config"> + <zeroOrMore> + <element name="cluster_property_set"> + <grammar> + <include href="nvset-3.5.rng"> + <define name="element-nvset.name-value"> + <parentRef name="cluster_property_set.nvpair.name-value-unsupported"/> + </define> + </include> + </grammar> + </element> + </zeroOrMore> + </element> + <optional> + <element name="rsc_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="op_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + </zeroOrMore> + </element> + </optional> + </interleave> + </define> + +</grammar> diff --git a/xml/options-3.9.rng b/xml/options-3.9.rng new file mode 100644 index 0000000..b1302b9 --- /dev/null +++ b/xml/options-3.9.rng @@ -0,0 +1,133 @@ +<?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="options"/> + </start> + + <!-- + Include rule definitions so that we can override element-nvset.rule based on + context + --> + <include href="rule-3.9.rng"> + <start combine="choice"> + <notAllowed/> + </start> + </include> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="cluster-properties" + --> + <define name="cluster_property_set.nvpair.name-value-unsupported"> + <choice> + <group> + <attribute name="name"> + <value type="string">cluster-infrastructure</value> + </attribute> + <attribute name="value"> + <data type="string"> + <except> + <choice> + <value>heartbeat</value> + <value>openais</value> + <value>classic openais</value> + <value>classic openais (with plugin)</value> + <value>cman</value> + </choice> + </except> + </data> + </attribute> + </group> + <group> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>cluster-infrastructure</value> + <value>cluster_recheck_interval</value> + <value>dc_deadtime</value> + <value>default-action-timeout</value> + <value>default_action_timeout</value> + <value>default-migration-threshold</value> + <value>default_migration_threshold</value> + <value>default-resource-failure-stickiness</value> + <value>default_resource_failure_stickiness</value> + <value>default-resource-stickiness</value> + <value>default_resource_stickiness</value> + <value>election_timeout</value> + <value>expected-quorum-votes</value> + <value>is-managed-default</value> + <value>is_managed_default</value> + <value>no_quorum_policy</value> + <value>notification-agent</value> + <value>notification-recipient</value> + <value>remove_after_stop</value> + <value>shutdown_escalation</value> + <value>startup_fencing</value> + <value>stonith_action</value> + <value>stonith_enabled</value> + <value>stop_orphan_actions</value> + <value>stop_orphan_resources</value> + <value>symmetric_cluster</value> + <value>transition_idle_timeout</value> + </choice> + </except> + </data> + </attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + </group> + </choice> + </define> + + <define name="options"> + <interleave> + <element name="crm_config"> + <zeroOrMore> + <element name="cluster_property_set"> + <grammar> + <include href="nvset-3.9.rng"> + <define name="element-nvset.name-value"> + <parentRef name="cluster_property_set.nvpair.name-value-unsupported"/> + </define> + </include> + </grammar> + </element> + </zeroOrMore> + </element> + <optional> + <element name="rsc_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.9.rng"> + <define name="element-nvset.rule"> + <parentRef name="element-rule-rsc_defaults"/> + </define> + </include> + </grammar> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="op_defaults"> + <zeroOrMore> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.9.rng"> + <define name="element-nvset.rule"> + <parentRef name="element-rule-op_defaults"/> + </define> + </include> + </grammar> + </element> + </zeroOrMore> + </element> + </optional> + </interleave> + </define> + +</grammar> diff --git a/xml/pacemaker-schemas.pc.in b/xml/pacemaker-schemas.pc.in new file mode 100644 index 0000000..64e5240 --- /dev/null +++ b/xml/pacemaker-schemas.pc.in @@ -0,0 +1,12 @@ +# compatible with pacemaker-cib.pc:schemadir +schemadir=@CRM_SCHEMA_DIRECTORY@ + +# where machine-friendly API interchange format is formalized as schemas +schemadir4api=${schemadir}/api + +Name: Pacemaker Schemas & Transformations +Version: @PACKAGE_VERSION@ +Description: XML validation & transformation variables per Pacemaker build +URL: @PACKAGE_URL@ + +# no linker/compiler properties to associate diff --git a/xml/regression.sh b/xml/regression.sh new file mode 100755 index 0000000..7269779 --- /dev/null +++ b/xml/regression.sh @@ -0,0 +1,782 @@ +#!/bin/sh +# +# Copyright 2018-2020 the Pacemaker project contributors +# +# The version control history for this file may have further details. +# +# This source code is licensed under the GNU General Public License version 2 +# or later (GPLv2+) WITHOUT ANY WARRANTY. + +set -eu +test -d assets && test -d test-2 \ + || { echo 'Run me from source-tree-like location'; exit 1; } +# $1=reference (can be '-' for stdin), $2=investigated +# alt.: wdiff, colordiff, ... +DIFF=${DIFF:-diff} +DIFFOPTS=${DIFFOPTS--u} +DIFFPAGER=${DIFFPAGER:-less -LRX} +# $1=schema, $2=validated +# alt.: jing -i +RNGVALIDATOR=${RNGVALIDATOR:-xmllint --noout --relaxng} +# $1=stylesheet, $2=source +# alt.: Xalan, saxon, sabcmd/Sablotron (note: only validates reliably with -B) +_xalan_wrapper() { + { ${_XSLTPROCESSOR} "$2" "$1" 2>&1 >&3 \ + | sed -e '/^Source tree node.*$/d' \ + -e 's|^XSLT message: \(.*\) (Occurred.*)|\1|'; } 3>&- 3>&1 >&2 +} +# Sablotron doesn't translate '-' file specification to stdin +# and limits the length of the output message +_sabcmd_wrapper() { + _sabw_sheet=${1:?} + _sabw_source=${2:?} + test "${_sabw_sheet}" != - || _sabw_sheet=/dev/stdin + test "${_sabw_source}" != - || _sabw_source=/dev/stdin + { ${_XSLTPROCESSOR} "${_sabw_sheet}" "${_sabw_source}" 2>&1 >&3 \ + | sed -e '/^Warning \[code:89\]/d' \ + -e 's|^ xsl:message (\(.*\))$|\1|'; } 3>&- 3>&1 >&2 +} +# filtered out message: https://bugzilla.redhat.com/show_bug.cgi?id=1577367 +_saxon_wrapper() { + { ${_XSLTPROCESSOR} "-xsl:$1" "-s:$2" -versionmsg:off 2>&1 >&3 \ + | sed -e '/^Cannot find CatalogManager.properties$/d'; } 3>&- 3>&1 >&2 +} +XSLTPROCESSOR=${XSLTPROCESSOR:-xsltproc --nonet} +_XSLTPROCESSOR=${XSLTPROCESSOR} +case "${XSLTPROCESSOR}" in +[Xx]alan*|*/[Xx]alan*) XSLTPROCESSOR=_xalan_wrapper;; +sabcmd*|*/sabcmd*) XSLTPROCESSOR=_sabcmd_wrapper;; +saxon*|*/saxon*) XSLTPROCESSOR=_saxon_wrapper;; +esac +HTTPPORT=${HTTPPORT:-8000} # Python's default +WEBBROWSER=${WEBBROWSER:-firefox} + +tests= # test* names (should go first) here will become preselected default + +# +# commons +# + +emit_result() { + _er_howmany=${1:?} # how many errors (0/anything else incl. strings) + _er_subject=${2:?} + _er_prefix=${3-} + + test -z "${_er_prefix}" || _er_prefix="${_er_prefix}: " + + if test "${_er_howmany}" = 0; then + printf "%s%s finished OK\n" "${_er_prefix}" "${_er_subject}" + else + printf "%s%s encountered ${_er_howmany} errors\n" \ + "${_er_prefix}" "${_er_subject}" + fi +} + +emit_error() { + _ee_msg=${1:?} + printf "%s\n" "${_ee_msg}" >&2 +} + +# returns 1 + floor of base 2 logaritm for _lo0r_i in 1...255, +# or 0 for _lo0r_i = 0 +log2_or_0_return() { + _lo0r_i=${1:?} + return $(((!(_lo0r_i >> 1) && _lo0r_i) * 1 \ + + (!(_lo0r_i >> 2) && _lo0r_i & (1 << 1)) * 2 \ + + (!(_lo0r_i >> 3) && _lo0r_i & (1 << 2)) * 3 \ + + (!(_lo0r_i >> 4) && _lo0r_i & (1 << 3)) * 4 \ + + (!(_lo0r_i >> 5) && _lo0r_i & (1 << 4)) * 5 \ + + (!(_lo0r_i >> 6) && _lo0r_i & (1 << 5)) * 6 \ + + (!(_lo0r_i >> 7) && _lo0r_i & (1 << 6)) * 7 \ + + !!(_lo0r_i >> 7) * 7 )) +} + +# rough addition of two base 2 logarithms +log2_or_0_add() { + _lo0a_op1=${1:?} + _lo0a_op2=${2:?} + + if test ${_lo0a_op1} -gt ${_lo0a_op2}; then + return ${_lo0a_op1} + elif test ${_lo0a_op2} -gt ${_lo0a_op1}; then + return ${_lo0a_op2} + elif test ${_lo0a_op1} -gt 0; then + return $((_lo0a_op1 + 1)) + else + return ${_lo0a_op1} + fi +} + +# +# test phases +# + +# stdin: input file per line +test_browser() { + _tb_cleanref=0 + _tb_serverpid= + + while test $# -gt 0; do + case "$1" in + -r) _tb_cleanref=1;; + esac + shift + done + + if ! read _tb_first; then + return 1 + fi + cat >/dev/null 2>/dev/null # read out the rest + + test -f assets/diffview.js \ + || curl -SsLo assets/diffview.js \ + 'https://raw.githubusercontent.com/prettydiff/prettydiff/2.2.8/lib/diffview.js' + + { which python3 >/dev/null 2>/dev/null \ + && { python3 -m http.server "${HTTPPORT}" -b 127.0.0.1 \ + || emit_error "Python3 HTTP server fail"; return; } \ + || emit_error 'Cannot run Python-based HTTP server' ; } & + _tb_serverpid=$! + ${WEBBROWSER} "http://localhost:${HTTPPORT}/${_tb_first}" & + printf "When finished, just press Ctrl+C or kill %d, please\n" \ + "${_tb_serverpid}" + wait + + test "${_tb_cleanref}" -eq 0 || rm -f assets/diffview.js +} + +# -r ... whether to remove referential files as well +# stdin: input file per line +test_cleaner() { + _tc_cleanref=0 + + while test $# -gt 0; do + case "$1" in + -r) _tc_cleanref=1;; + esac + shift + done + + while read _tc_origin; do + _tc_origin=${_tc_origin%.*} + rm -f "${_tc_origin}.up" "${_tc_origin}.up.err" + rm -f "$(dirname "${_tc_origin}")/.$(basename "${_tc_origin}").up" + test ${_tc_cleanref} -eq 0 \ + || rm -f "${_tc_origin}.ref" "${_tc_origin}.ref.err" + done +} + +# -a= ... action modifier to derive template name from (if any; enter/leave) +# -o= ... which conventional version to deem as the transform origin +test_selfcheck() { + _tsc_cleanref=0 + _tsc_ret=0 + _tsc_action= + _tsc_template= + _tsc_validator= + + while test $# -gt 0; do + case "$1" in + -r) _tsc_cleanref=1;; + -a=*) _tsc_action="${1#-a=}";; + -o=*) _tsc_template="${1#-o=}";; + esac + shift + done + _tsc_validator="${_tsc_template:?}" + _tsc_validator="cibtr-${_tsc_validator%%.*}.rng" + _tsc_action=${_tsc_action:+-${_tsc_action}} + _tsc_template="upgrade-${_tsc_template}${_tsc_action}.xsl" + + # alt. https://relaxng.org/relaxng.rng + _tsc_rng_relaxng=https://raw.githubusercontent.com/relaxng/relaxng.org/master/relaxng.rng + # alt. https://github.com/ndw/xslt-relax-ng/blob/master/1.0/xslt10.rnc + _tsc_rng_xslt=https://raw.githubusercontent.com/relaxng/jing-trang/master/eg/xslt.rng + + case "${RNGVALIDATOR}" in + *xmllint*) + test -f "assets/$(basename "${_tsc_rng_relaxng}")" \ + || curl -SsLo "assets/$(basename "${_tsc_rng_relaxng}")" \ + "${_tsc_rng_relaxng}" + test -f "assets/$(basename "${_tsc_rng_xslt}")" \ + || curl -SsLo "assets/$(basename "${_tsc_rng_xslt}")" \ + "${_tsc_rng_xslt}" + test -f assets/xmlcatalog || >assets/xmlcatalog cat <<-EOF + <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> + <rewriteURI uriStartString="$(dirname "${_tsc_rng_relaxng}")" + rewritePrefix="file://$(pwd)/assets"/> + <rewriteURI uriStartString="$(dirname "${_tsc_rng_xslt}")" + rewritePrefix="file://$(pwd)/assets"/> + </catalog> +EOF + RNGVALIDATOR=\ +"eval env \"XML_CATALOG_FILES=/etc/xml/catalog $(pwd)/assets/xmlcatalog\" +${RNGVALIDATOR}" + # not needed + #_tsc_rng_relaxng="assets/$(basename "${_tsc_rng_relaxng}")" + #_tsc_rng_xslt="assets/$(basename "${_tsc_rng_xslt}")" + ;; + esac + + # check schema (sub-grammar) for custom transformation mapping alone; + if test -z "${_tsc_action}" \ + && ! ${RNGVALIDATOR} "${_tsc_rng_relaxng}" "${_tsc_validator}"; then + _tsc_ret=$((_tsc_ret + 1)) + fi + + # check the overall XSLT per the main grammar + said sub-grammar; + test -f "${_tsc_validator}" && _tsc_validator="xslt_${_tsc_validator}" \ + || _tsc_validator="${_tsc_rng_xslt}" + if ! ${RNGVALIDATOR} "${_tsc_validator}" "${_tsc_template}"; then + _tsc_ret=$((_tsc_ret + 1)) + fi + + test "${_tsc_cleanref}" -eq 0 \ + || rm -f assets/relaxng.rng assets/xslt.rng assets/xmlcatalog + + log2_or_0_return ${_tsc_ret} +} + +test_explanation() { + _tsc_template= + + while test $# -gt 0; do + case "$1" in + -o=*) _tsc_template="upgrade-${1#-o=}.xsl";; + esac + shift + done + + ${XSLTPROCESSOR} upgrade-detail.xsl "${_tsc_template}" +} + +# stdout: filename of the transformed file +test_runner_upgrade() { + _tru_template=${1:?} + _tru_source=${2:?} # filename + _tru_mode=${3:?} # extra modes wrt. "referential" outcome, see below + + _tru_ref="${_tru_source%.*}.ref" + { test "$((_tru_mode & (1 << 0)))" -ne 0 \ + || test -f "${_tru_ref}.err"; } \ + && _tru_ref_err="${_tru_ref}.err" || _tru_ref_err=/dev/null + _tru_target="${_tru_source%.*}.up" + _tru_target_err="${_tru_target}.err" + + if test $((_tru_mode & (1 << 2))) -eq 0; then + ${XSLTPROCESSOR} "${_tru_template}" "${_tru_source}" \ + > "${_tru_target}" 2> "${_tru_target_err}" \ + || { _tru_ref=$?; echo "${_tru_target_err}" + return ${_tru_ref}; } + else + # when -B (deblanked outcomes handling) requested, we: + # - drop blanks from the source XML + # (effectively emulating pacemaker handling) + # - re-drop blanks from the XSLT outcome, + # which is compared with referential outcome + # processed with even greedier custom deblanking + # (extraneous inter-element whitespace like blank + # lines will not get removed otherwise, see lower) + xmllint --noblanks "${_tru_source}" \ + | ${XSLTPROCESSOR} "${_tru_template}" - \ + > "${_tru_target}" 2> "${_tru_target_err}" \ + || { _tru_ref=$?; echo "${_tru_target_err}" + return ${_tru_ref}; } + # reusing variable no longer needed + _tru_template="$(dirname "${_tru_target}")" + _tru_template="${_tru_template}/.$(basename "${_tru_target}")" + mv "${_tru_target}" "${_tru_template}" + ${XSLTPROCESSOR} - "${_tru_template}" > "${_tru_target}" <<-EOF + <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="yes"/> + <xsl:template match="@*|*|comment()|processing-instruction()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + <xsl:template match="text()"> + <xsl:value-of select="normalize-space(.)"/> + </xsl:template> + </xsl:stylesheet> +EOF + fi + + # only respond with the flags except for "-B", i.e., when both: + # - _tru_mode non-zero + # - "-B" in _tru_mode is zero (hence non-zero when flipped with XOR) + if test "$((_tru_mode * ((_tru_mode ^ (1 << 2)) & (1 << 2))))" -ne 0; then + if test $((_tru_mode & (1 << 0))) -ne 0; then + cp -a "${_tru_target}" "${_tru_ref}" + cp -a "${_tru_target_err}" "${_tru_ref_err}" + fi + if test $((_tru_mode & (1 << 1))) -ne 0; then + { "${DIFF}" ${DIFFOPTS} "${_tru_source}" "${_tru_ref}" \ + && printf '\n(files match)\n'; } | ${DIFFPAGER} >&2 + if test $? -ne 0; then + printf "\npager failure\n" >&2 + return 1 + fi + printf '\nIs comparison OK? ' >&2 + if read _tru_answer </dev/tty; then + case "${_tru_answer}" in + y|yes) ;; + *) echo "Answer not 'y' nor 'yes'" >&2; return 1;; + esac + else + return 1 + fi + fi + elif test -f "${_tru_ref}" && test -e "${_tru_ref_err}"; then + { test "$((_tru_mode & (1 << 2)))" -eq 0 && cat "${_tru_ref}" \ + || ${XSLTPROCESSOR} - "${_tru_ref}" <<-EOF + <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="yes"/> + <xsl:template match="@*|*|comment()|processing-instruction()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + <xsl:template match="text()"> + <xsl:value-of select="normalize-space(.)"/> + </xsl:template> + </xsl:stylesheet> +EOF + } \ + | "${DIFF}" ${DIFFOPTS} - "${_tru_target}" >&2 \ + && "${DIFF}" ${DIFFOPTS} "${_tru_ref_err}" \ + "${_tru_target_err}" >&2 + if test $? -ne 0; then + emit_error "Outputs differ from referential ones" + echo "/dev/null" + return 1 + fi + else + emit_error "Referential file(s) missing: ${_tru_ref}" + echo "/dev/null" + return 1 + fi + + echo "${_tru_target}" +} + +test_runner_validate() { + _trv_schema=${1:?} + _trv_target=${2:?} # filename + + if ! ${RNGVALIDATOR} "${_trv_schema}" "${_trv_target}" \ + 2>/dev/null; then + ${RNGVALIDATOR} "${_trv_schema}" "${_trv_target}" + fi +} + +# -a= ... action modifier completing template name (e.g. 2.10-(enter|leave)) +# -o= ... which conventional version to deem as the transform origin +# -t= ... which conventional version to deem as the transform target +# -B +# -D +# -G ... see usage +# stdin: input file per line +test_runner() { + _tr_mode=0 + _tr_ret=0 + _tr_action= + _tr_schema_o= + _tr_schema_t= + _tr_target= + _tr_template= + + while test $# -gt 0; do + case "$1" in + -a=*) _tr_action="${1#-a=}";; + -o=*) _tr_template="${1#-o=}" + _tr_schema_o="pacemaker-${1#-o=}.rng";; + -t=*) _tr_schema_t="pacemaker-${1#-t=}.rng";; + -G) _tr_mode=$((_tr_mode | (1 << 0)));; + -D) _tr_mode=$((_tr_mode | (1 << 1)));; + -B) _tr_mode=$((_tr_mode | (1 << 2)));; + esac + shift + done + _tr_template="upgrade-${_tr_action:-${_tr_template:?}}.xsl" + + if ! test -f "${_tr_schema_o:?}" || ! test -f "${_tr_schema_t:?}"; then + emit_error "Origin and/or target schema missing, rerun make" + return 1 + fi + + while read _tr_origin; do + printf '%-60s' "${_tr_origin}... " + + # pre-validate + if ! test_runner_validate "${_tr_schema_o}" "${_tr_origin}"; then + _tr_ret=$((_tr_ret + 1)); echo "E:pre-validate"; continue + fi + + # upgrade + if ! _tr_target=$(test_runner_upgrade "${_tr_template}" \ + "${_tr_origin}" "${_tr_mode}"); then + _tr_ret=$((_tr_ret + 1)); + test -n "${_tr_target}" || break + echo "E:upgrade" + test -s "${_tr_target}" \ + && { echo ---; cat "${_tr_target}" || :; echo ---; } + continue + fi + + # post-validate + if ! test_runner_validate "${_tr_schema_t}" "${_tr_target}"; then + _tr_ret=$((_tr_ret + 1)); echo "E:post-validate"; continue + fi + + echo "OK" + done + + log2_or_0_return ${_tr_ret} +} + +# +# particular test variations +# -C +# -S +# -X +# -W ... see usage +# stdin: granular test specification(s) if any +# + +test2to3() { + _t23_cleanopt= + _t23_pattern= + + while read _t23_spec; do + _t23_spec=${_t23_spec%.xml} + _t23_spec=${_t23_spec%\*} + _t23_pattern="${_t23_pattern} -name ${_t23_spec}*.xml -o" + done + test -z "${_t23_pattern}" || _t23_pattern="( ${_t23_pattern%-o} )" + case " $* " in *\ -r\ *) _t23_cleanopt=-r; esac + + find test-2 -name test-2 -o -type d -prune \ + -o -name '*.xml' ${_t23_pattern} -print | env LC_ALL=C sort \ + | { case " $* " in + *\ -C\ *) test_cleaner;; + *\ -S\ *) test_selfcheck -o=2.10 ${_t23_cleanopt};; + *\ -X\ *) test_explanation -o=2.10;; + *\ -W\ *) test_browser ${_t23_cleanopt};; + *) test_runner -o=2.10 -t=3.0 "$@" || return $?;; + esac; } +} +tests="${tests} test2to3" + +test2to3enter() { + _t23e_cleanopt= + _t23e_pattern= + + while read _t23e_spec; do + _t23e_spec=${_t23e_spec%.xml} + _t23e_spec=${_t23e_spec%\*} + _t23e_pattern="${_t23e_pattern} -name ${_t23e_spec}*.xml -o" + done + test -z "${_t23e_pattern}" || _t23e_pattern="( ${_t23e_pattern%-o} )" + case " $* " in *\ -r\ *) _t23e_cleanopt=-r; esac + + find test-2-enter -name test-2-enter -o -type d -prune \ + -o -name '*.xml' ${_t23e_pattern} -print | env LC_ALL=C sort \ + | { case " $* " in + *\ -C\ *) test_cleaner;; + *\ -S\ *) test_selfcheck -a=enter -o=2.10 ${_t23e_cleanopt};; + *\ -W\ *) emit_result "not implemented" "option -W";; + *\ -X\ *) emit_result "not implemented" "option -X";; + *) test_runner -a=2.10-enter -o=2.10 -t=2.10 "$@" || return $?;; + esac; } +} +tests="${tests} test2to3enter" + +test2to3leave() { + _t23l_cleanopt= + _t23l_pattern= + + while read _t23l_spec; do + _t23l_spec=${_t23l_spec%.xml} + _t23l_spec=${_t23l_spec%\*} + _t23l_pattern="${_t23l_pattern} -name ${_t23l_spec}*.xml -o" + done + test -z "${_t23l_pattern}" || _t23l_pattern="( ${_t23l_pattern%-o} )" + case " $* " in *\ -r\ *) _t23l_cleanopt=-r; esac + + find test-2-leave -name test-2-leave -o -type d -prune \ + -o -name '*.xml' ${_t23l_pattern} -print | env LC_ALL=C sort \ + | { case " $* " in + *\ -C\ *) test_cleaner;; + *\ -S\ *) test_selfcheck -a=leave -o=2.10 ${_t23l_cleanopt};; + *\ -W\ *) emit_result "not implemented" "option -W";; + *\ -X\ *) emit_result "not implemented" "option -X";; + *) test_runner -a=2.10-leave -o=3.0 -t=3.0 "$@" || return $?;; + esac; } +} +tests="${tests} test2to3leave" + +test2to3roundtrip() { + _t23rt_cleanopt= + _t23rt_pattern= + + while read _t23tr_spec; do + _t23rt_spec=${_t23rt_spec%.xml} + _t23rt_spec=${_t23rt_spec%\*} + _t23rt_pattern="${_t23rt_pattern} -name ${_t23rt_spec}*.xml -o" + done + test -z "${_t23rt_pattern}" || _t23rt_pattern="( ${_t23rt_pattern%-o} )" + case " $* " in *\ -r\ *) _t23rt_cleanopt=-r; esac + + find test-2-roundtrip -name test-2-roundtrip -o -type d -prune \ + -o -name '*.xml' ${_t23rt_pattern} -print | env LC_ALL=C sort \ + | { case " $* " in + *\ -C\ *) test_cleaner;; + *\ -S\ *) test_selfcheck -a=roundtrip -o=2.10 ${_t23rt_cleanopt};; + *\ -W\ *) test_browser ${_t23rt_cleanopt};; + *\ -X\ *) emit_result "not implemented" "option -X";; + *) test_runner -a=2.10-roundtrip -o=2.10 -t=3.0 "$@" || return $?;; + esac; } +} +tests="${tests} test2to3roundtrip" + +# -B +# -D +# -G ... see usage +cts_scheduler() { + _tcp_mode=0 + _tcp_ret=0 + _tcp_validatewith= + _tcp_schema_o= + _tcp_schema_t= + _tcp_template= + + find ../cts/scheduler -name scheduler -o -type d -prune \ + -o -name '*.xml' -print | env LC_ALL=C sort \ + | { case " $* " in + *\ -C\ *) test_cleaner -r;; + *\ -S\ *) emit_result "not implemented" "option -S";; + *\ -W\ *) emit_result "not implemented" "option -W";; + *\ -X\ *) emit_result "not implemented" "option -X";; + *) + while test $# -gt 0; do + case "$1" in + -G) _tcp_mode=$((_tcp_mode | (1 << 0)));; + -D) _tcp_mode=$((_tcp_mode | (1 << 1)));; + -B) _tcp_mode=$((_tcp_mode | (1 << 2)));; + esac + shift + done + while read _tcp_origin; do + _tcp_validatewith=$(${XSLTPROCESSOR} - "${_tcp_origin}" <<-EOF + <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="text" encoding="UTF-8"/> + <xsl:template match="/"> + <xsl:choose> + <xsl:when test="starts-with(cib/@validate-with, 'pacemaker-')"> + <xsl:variable name="Version" select="substring-after(cib/@validate-with, 'pacemaker-')"/> + <xsl:choose> + <xsl:when test="contains(\$Version, '.')"> + <xsl:value-of select="substring-before(\$Version, '.')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="cib/@validate-with"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="cib/@validate-with"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + </xsl:stylesheet> +EOF +) + _tcp_schema_t=${_tcp_validatewith} + case "${_tcp_validatewith}" in + 1) _tcp_schema_o=1.3;; + 2) _tcp_schema_o=2.10;; + # only for gradual refinement as upgrade-2.10.xsl under + # active development, move to 3.x when schema v4 emerges + 3) _tcp_schema_o=2.10 + _tcp_schema_t=2;; + *) emit_error \ + "need to skip ${_tcp_origin} (schema: ${_tcp_validatewith})" + continue;; + esac + _tcp_template="upgrade-${_tcp_schema_o}.xsl" + _tcp_schema_t="pacemaker-$((_tcp_schema_t + 1)).0.rng" + test "${_tcp_schema_o%%.*}" = "${_tcp_validatewith}" \ + && _tcp_schema_o="pacemaker-${_tcp_schema_o}.rng" \ + || _tcp_schema_o="${_tcp_schema_t}" + + # pre-validate + if test "${_tcp_schema_o}" != "${_tcp_schema_t}" \ + && ! test_runner_validate "${_tcp_schema_o}" "${_tcp_origin}"; then + _tcp_ret=$((_tcp_ret + 1)); echo "E:pre-validate"; continue + fi + + # upgrade + test "$((_tcp_mode & (1 << 0)))" -ne 0 \ + || ln -fs "$(pwd)/${_tcp_origin}" "${_tcp_origin%.*}.ref" + if ! _tcp_target=$(test_runner_upgrade "${_tcp_template}" \ + "${_tcp_origin}" "${_tcp_mode}"); then + _tcp_ret=$((_tcp_ret + 1)); + test -n "${_tcp_target}" || break + echo "E:upgrade" + test -s "${_tcp_target}" \ + && { echo ---; cat "${_tcp_target}" || :; echo ---; } + continue + fi + test "$((_tcp_mode & (1 << 0)))" -ne 0 \ + || rm -f "${_tcp_origin%.*}.ref" + + # post-validate + if ! test_runner_validate "${_tcp_schema_t}" "${_tcp_target}"; then + _tcp_ret=$((_tcp_ret + 1)); echo "E:post-validate"; continue + fi + + test "$((_tcp_mode & (1 << 0)))" -eq 0 \ + || mv "${_tcp_target}" "${_tcp_origin}" + done; log2_or_0_return ${_tcp_ret};; + esac; } +} +tests="${tests} cts_scheduler" + +# +# "framework" +# + +# option-likes ... options to be passed down +# argument-likes ... drives a test selection +test_suite() { + _ts_pass= + _ts_select= + _ts_select_full= + _ts_test_specs= + _ts_global_ret=0 + _ts_ret=0 + + while test $# -gt 0; do + case "$1" in + -) printf '%s\n' 'waiting for tests specified at stdin...'; + while read _ts_spec; do _ts_select="${_ts_spec}@$1"; done;; + -*) _ts_pass="${_ts_pass} $1";; + *) _ts_select_full="${_ts_select_full}@$1" + _ts_select="${_ts_select}@${1%%/*}";; + esac + shift + done + _ts_select="${_ts_select}@" + _ts_select_full="${_ts_select_full}@" + + for _ts_test in ${tests}; do + + _ts_test_specs= + while true; do + case "${_ts_select}" in + *@${_ts_test}@*) + _ts_test_specs="${_ts_select%%@${_ts_test}@*}"\ +"@${_ts_select#*@${_ts_test}@}" + if test "${_ts_test_specs}" = @; then + _ts_select= # nothing left + else + _ts_select="${_ts_test_specs}" + fi + continue + ;; + @) case "${_ts_test}" in test*) break;; esac # filter + ;; + esac + test -z "${_ts_test_specs}" || break + continue 2 # move on to matching with next local test + done + + _ts_test_specs= + while true; do + case "${_ts_select_full}" in + *@${_ts_test}/*) + _ts_test_full="${_ts_test}/${_ts_select_full#*@${_ts_test}/}" + _ts_test_full="${_ts_test_full%%@*}" + _ts_select_full="${_ts_select_full%%@${_ts_test_full}@*}"\ +"@${_ts_select_full#*@${_ts_test_full}@}" + _ts_test_specs="${_ts_test_specs} ${_ts_test_full#*/}" + ;; + *) + break + ;; + esac + done + + for _ts_test_spec in ${_ts_test_specs}; do + printf '%s\n' "${_ts_test_spec}" + done | "${_ts_test}" ${_ts_pass} || _ts_ret=$? + + test ${_ts_ret} = 0 \ + && emit_result ${_ts_ret} "${_ts_test}" \ + || emit_result "at least 2^$((_ts_ret - 1))" "${_ts_test}" + log2_or_0_add ${_ts_global_ret} ${_ts_ret} + _ts_global_ret=$? + done + if test -n "${_ts_select#@}"; then + emit_error "Non-existing test(s):$(echo "${_ts_select}" \ + | tr '@' ' ')" + log2_or_0_add ${_ts_global_ret} 1 || _ts_global_ret=$? + fi + + return ${_ts_global_ret} +} + +# NOTE: big letters are dedicated for per-test-set behaviour, +# small ones for generic/global behaviour +usage() { + printf \ +'%s\n%s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n' \ + "usage: $0 [-{B,C,D,G,S,X}]* \\" \ + " [-|{${tests## }}*]" \ + "- when no suites (arguments) provided, \"test*\" ones get used" \ + "- with '-' suite specification the actual ones grabbed on stdin" \ + "- use '-B' to run validate-only check suppressing blanks first" \ + "- use '-C' to only cleanup ephemeral byproducts" \ + "- use '-D' to review originals vs. \"referential\" outcomes" \ + "- use '-G' to generate \"referential\" outcomes" \ + "- use '-S' for template self-check (requires net access)" \ + "- use '-W' to run browser-based, on-the-fly diff'ing test drive" \ + "- use '-X' to show explanatory details about the upgrade" \ + "- some modes (e.g. -{S,W}) take also '-r' for cleanup afterwards" \ + "- test specification can be granular, e.g. 'test2to3/022'" + printf \ + '\n%s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n' \ + 'environment variables affecting the run + default/current values:' \ + "- DIFF (${DIFF}): tool to compute and show differences of 2 files" \ + "- DIFFOPTS (${DIFFOPTS}): options to the above tool" \ + "- DIFFPAGER (${DIFFPAGER}): possibly accompanying the above tool" \ + "- RNGVALIDATOR (${RNGVALIDATOR}): RelaxNG validator" \ + "- XSLTPROCESSOR (${_XSLTPROCESSOR}): XSLT 1.0 capable processor" \ + "- HTTPPORT (${HTTPPORT}): port used by test drive HTTP server run" \ + "- WEBBROWSER (${WEBBROWSER}): used for in-browser test drive" +} + +main() { + _main_pass= + _main_bailout=0 + _main_ret=0 + + while test $# -gt 0; do + case "$1" in + -h) usage; exit;; + -C|-G|-S|-X) _main_bailout=1;; + esac + _main_pass="${_main_pass} $1" + shift + done + + test_suite ${_main_pass} || _main_ret=$? + test ${_main_bailout} -ne 0 \ + || test_suite -C ${_main_pass} >/dev/null || true + test ${_main_ret} = 0 && emit_result ${_main_ret} "Overall suite" \ + || emit_result "at least 2^$((_main_ret - 1))" "Overall suite" + + return ${_main_ret} +} + +main "$@" diff --git a/xml/resources-1.0.rng b/xml/resources-1.0.rng new file mode 100644 index 0000000..a8aa3ac --- /dev/null +++ b/xml/resources-1.0.rng @@ -0,0 +1,179 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + </choice> + </attribute> + </choice> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="requires"> + <choice> + <value>nothing</value> + <value>quorum</value> + <value>fencing</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + +</grammar> diff --git a/xml/resources-1.2.rng b/xml/resources-1.2.rng new file mode 100644 index 0000000..e38eb7c --- /dev/null +++ b/xml/resources-1.2.rng @@ -0,0 +1,227 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + </choice> + </attribute> + </choice> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="requires"> + <choice> + <value>nothing</value> + <value>quorum</value> + <value>fencing</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + +</grammar> diff --git a/xml/resources-1.3.rng b/xml/resources-1.3.rng new file mode 100644 index 0000000..6dba571 --- /dev/null +++ b/xml/resources-1.3.rng @@ -0,0 +1,228 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-1.3.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + </choice> + </attribute> + </choice> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-1.3.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-1.3.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-1.3.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="requires"> + <choice> + <value>nothing</value> + <value>quorum</value> + <value>fencing</value> + <value>unfencing</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + +</grammar> diff --git a/xml/resources-2.10.rng b/xml/resources-2.10.rng new file mode 100644 index 0000000..ac1b11a --- /dev/null +++ b/xml/resources-2.10.rng @@ -0,0 +1,329 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-2.9.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-2.9.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="masters"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="rkt"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="masters"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-2.9.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-2.9.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="requires"> + <choice> + <value>nothing</value> + <value>quorum</value> + <value>fencing</value> + <value>unfencing</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-2.7.rng b/xml/resources-2.7.rng new file mode 100644 index 0000000..355382b --- /dev/null +++ b/xml/resources-2.7.rng @@ -0,0 +1,218 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-1.3.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-1.3.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-1.3.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-1.3.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="requires"> + <choice> + <value>nothing</value> + <value>quorum</value> + <value>fencing</value> + <value>unfencing</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-2.8.rng b/xml/resources-2.8.rng new file mode 100644 index 0000000..a3a9975 --- /dev/null +++ b/xml/resources-2.8.rng @@ -0,0 +1,308 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-1.3.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-1.3.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="masters"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-1.3.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-1.3.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="requires"> + <choice> + <value>nothing</value> + <value>quorum</value> + <value>fencing</value> + <value>unfencing</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-2.9.rng b/xml/resources-2.9.rng new file mode 100644 index 0000000..cd03674 --- /dev/null +++ b/xml/resources-2.9.rng @@ -0,0 +1,308 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-2.9.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-2.9.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="masters"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-2.9.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-2.9.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="requires"> + <choice> + <value>nothing</value> + <value>quorum</value> + <value>fencing</value> + <value>unfencing</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-3.0.rng b/xml/resources-3.0.rng new file mode 100644 index 0000000..f5b9158 --- /dev/null +++ b/xml/resources-3.0.rng @@ -0,0 +1,465 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resource-meta-attributes" + --> + <define name="primitive-template.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>isolation</value> + <value>isolation-host</value> + <value>isolation-instance</value> + <value>isolation-wrapper</value> + </choice> + </except> + </data> + </attribute> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resource-instance-attributes" + --> + <define name="primitive-template.instance_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>pcmk_arg_map</value> + <value>pcmk_list_cmd</value> + <value>pcmk_monitor_cmd</value> + <value>pcmk_off_cmd</value> + <value>pcmk_on_cmd</value> + <value>pcmk_reboot_cmd</value> + <value>pcmk_status_cmd</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.primitive-template"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.0.rng"> + <define name="element-nvset.name"> + <parentRef name="primitive-template.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <grammar> + <include href="nvset-3.0.rng"> + <define name="element-nvset.name"> + <parentRef name="primitive-template.instance_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.0.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.0.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="rkt"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="add-host"><data type="boolean"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resources-operation" + --> + <define name="op.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>requires</value> + </choice> + </except> + </data> + </attribute> + </define> + + <!-- + see above and upgrade-2.10.xsl + - cibtr:table for="resources-operation-instance-attributes" + NOTE: this is rather a grey area, but setting special parameters + just for the particular operation is currently not customary, + and unsupported by higher level tools, e.g. pcs: + https://bugzilla.redhat.com/show_bug.cgi?id=1469801 + so take the liberty to exclude them for now + --> + <define name="op.instance_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>interval-origin</value> + <value>start-delay</value> + + <value>enabled</value> + <value>on-fail</value> + <value>record-pending</value> + <value>role</value> + <value>timeout</value> + + <value>requires</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.op"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.0.rng"> + <define name="element-nvset.name"> + <parentRef name="op.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <grammar> + <include href="nvset-3.0.rng"> + <define name="element-nvset.name"> + <parentRef name="op.instance_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra.op"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-3.1.rng b/xml/resources-3.1.rng new file mode 100644 index 0000000..5558ee1 --- /dev/null +++ b/xml/resources-3.1.rng @@ -0,0 +1,401 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resource-meta-attributes" + --> + <define name="primitive-template.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>isolation</value> + <value>isolation-host</value> + <value>isolation-instance</value> + <value>isolation-wrapper</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.primitive-template"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.0.rng"> + <define name="element-nvset.name"> + <parentRef name="primitive-template.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.0.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.0.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="rkt"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="add-host"><data type="boolean"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resources-operation" + --> + <define name="op.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>requires</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.op"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.0.rng"> + <define name="element-nvset.name"> + <parentRef name="op.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra.op"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-3.2.rng b/xml/resources-3.2.rng new file mode 100644 index 0000000..44656d6 --- /dev/null +++ b/xml/resources-3.2.rng @@ -0,0 +1,425 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resource-meta-attributes" + --> + <define name="primitive-template.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>isolation</value> + <value>isolation-host</value> + <value>isolation-instance</value> + <value>isolation-wrapper</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.primitive-template"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.0.rng"> + <define name="element-nvset.name"> + <parentRef name="primitive-template.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.0.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.0.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="rkt"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="podman"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="add-host"><data type="boolean"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resources-operation" + --> + <define name="op.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>requires</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.op"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.0.rng"> + <define name="element-nvset.name"> + <parentRef name="op.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.0.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra.op"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-3.4.rng b/xml/resources-3.4.rng new file mode 100644 index 0000000..887dc1c --- /dev/null +++ b/xml/resources-3.4.rng @@ -0,0 +1,426 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resource-meta-attributes" + --> + <define name="primitive-template.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>isolation</value> + <value>isolation-host</value> + <value>isolation-instance</value> + <value>isolation-wrapper</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.primitive-template"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.4.rng"> + <define name="element-nvset.name"> + <parentRef name="primitive-template.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.4.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.4.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.4.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="rkt"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="podman"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="add-host"><data type="boolean"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-3.4.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.4.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resources-operation" + --> + <define name="op.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>requires</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.op"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.4.rng"> + <define name="element-nvset.name"> + <parentRef name="op.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.4.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>demote</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra.op"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-3.5.rng b/xml/resources-3.5.rng new file mode 100644 index 0000000..5c6624f --- /dev/null +++ b/xml/resources-3.5.rng @@ -0,0 +1,426 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resource-meta-attributes" + --> + <define name="primitive-template.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>isolation</value> + <value>isolation-host</value> + <value>isolation-instance</value> + <value>isolation-wrapper</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.primitive-template"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.5.rng"> + <define name="element-nvset.name"> + <parentRef name="primitive-template.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.5.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.5.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="rkt"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="podman"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="add-host"><data type="boolean"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resources-operation" + --> + <define name="op.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>requires</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.op"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.5.rng"> + <define name="element-nvset.name"> + <parentRef name="op.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>demote</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra.op"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-3.7.rng b/xml/resources-3.7.rng new file mode 100644 index 0000000..9b58d34 --- /dev/null +++ b/xml/resources-3.7.rng @@ -0,0 +1,428 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resource-meta-attributes" + --> + <define name="primitive-template.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>isolation</value> + <value>isolation-host</value> + <value>isolation-instance</value> + <value>isolation-wrapper</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.primitive-template"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.5.rng"> + <define name="element-nvset.name"> + <parentRef name="primitive-template.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.5.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.5.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="rkt"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="podman"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="add-host"><data type="boolean"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resources-operation" + --> + <define name="op.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>requires</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.op"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.5.rng"> + <define name="element-nvset.name"> + <parentRef name="op.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.5.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>demote</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra.op"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/resources-3.9.rng b/xml/resources-3.9.rng new file mode 100644 index 0000000..37118fa --- /dev/null +++ b/xml/resources-3.9.rng @@ -0,0 +1,428 @@ +<?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-resources"/> + </start> + + <define name="element-resources"> + <element name="resources"> + <zeroOrMore> + <choice> + <ref name="element-primitive"/> + <ref name="element-template"/> + <ref name="element-group"/> + <ref name="element-clone"/> + <ref name="element-master"/> + <ref name="element-bundle"/> + </choice> + </zeroOrMore> + </element> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resource-meta-attributes" + --> + <define name="primitive-template.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>isolation</value> + <value>isolation-host</value> + <value>isolation-instance</value> + <value>isolation-wrapper</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.primitive-template"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.9.rng"> + <define name="element-nvset.name"> + <parentRef name="primitive-template.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.9.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-primitive"> + <element name="primitive"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + </group> + <attribute name="template"><data type="IDREF"/></attribute> + </choice> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.9.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-template"> + <element name="template"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <ref name="element-resource-class"/> + <attribute name="type"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra.primitive-template"/> + <ref name="element-operations"/> + <zeroOrMore> + <element name="utilization"> + <externalRef href="nvset-3.9.rng"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="element-bundle"> + <element name="bundle"> + <interleave> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <ref name="element-resource-extra"/> + <choice> + <element name="docker"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="rkt"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + <element name="podman"> + <attribute name="image"><text/></attribute> + <optional> + <attribute name="replicas"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="replicas-per-host"><data type="integer"/></attribute> + </optional> + <optional> + <choice> + <attribute name="masters"><data type="integer"/></attribute> + <attribute name="promoted-max"><data type="integer"/></attribute> + </choice> + </optional> + <optional> + <attribute name="run-command"> <text/></attribute> + </optional> + <optional> + <attribute name="network"><text/></attribute> + </optional> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </choice> + <optional> + <element name="network"> + <optional> + <attribute name="ip-range-start"><text/></attribute> + </optional> + <optional> + <attribute name="control-port"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="host-interface"><text/></attribute> + </optional> + <optional> + <attribute name="host-netmask"><data type="integer"/></attribute> + </optional> + <optional> + <attribute name="add-host"><data type="boolean"/></attribute> + </optional> + <zeroOrMore> + <element name="port-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="port"><data type="integer"/></attribute> + <optional> + <attribute name="internal-port"><data type="integer"/></attribute> + </optional> + </group> + <attribute name="range"> + <data type="string"> + <param name="pattern">([0-9\-]+)</param> + </data> + </attribute> + </choice> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="storage"> + <zeroOrMore> + <element name="storage-mapping"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <attribute name="source-dir"><text/></attribute> + <attribute name="source-dir-root"><text/></attribute> + </choice> + <attribute name="target-dir"><text/></attribute> + <optional> + <attribute name="options"><text/></attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <ref name="element-primitive"/> + </optional> + </interleave> + </element> + </define> + + <define name="element-group"> + <element name="group"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <oneOrMore> + <ref name="element-primitive"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="element-clone"> + <element name="clone"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-master"> + <element name="master"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <interleave> + <ref name="element-resource-extra"/> + <choice> + <ref name="element-primitive"/> + <ref name="element-group"/> + </choice> + </interleave> + </element> + </define> + + <define name="element-resource-extra"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <externalRef href="nvset-3.9.rng"/> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.9.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <!-- + see upgrade-2.10.xsl + - cibtr:table for="resources-operation" + --> + <define name="op.meta_attributes.nvpair.name-unsupported"> + <attribute name="name"> + <data type="string"> + <except> + <choice> + <value>requires</value> + </choice> + </except> + </data> + </attribute> + </define> + + <define name="element-resource-extra.op"> + <zeroOrMore> + <choice> + <element name="meta_attributes"> + <grammar> + <include href="nvset-3.9.rng"> + <define name="element-nvset.name"> + <parentRef name="op.meta_attributes.nvpair.name-unsupported"/> + </define> + </include> + </grammar> + </element> + <element name="instance_attributes"> + <externalRef href="nvset-3.9.rng"/> + </element> + </choice> + </zeroOrMore> + </define> + + <define name="element-operations"> + <optional> + <element name="operations"> + <optional> + <attribute name="id"><data type="ID"/></attribute> + </optional> + <optional> + <attribute name="id-ref"><data type="IDREF"/></attribute> + </optional> + <zeroOrMore> + <element name="op"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <attribute name="interval"><text/></attribute> + <optional> + <attribute name="description"><text/></attribute> + </optional> + <optional> + <choice> + <attribute name="start-delay"><text/></attribute> + <attribute name="interval-origin"><text/></attribute> + </choice> + </optional> + <optional> + <attribute name="timeout"><text/></attribute> + </optional> + <optional> + <attribute name="enabled"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="record-pending"><data type="boolean"/></attribute> + </optional> + <optional> + <attribute name="role"> + <choice> + <value>Stopped</value> + <value>Started</value> + <value>Promoted</value> + <value>Unpromoted</value> + <value>Slave</value> + <value>Master</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="on-fail"> + <choice> + <value>ignore</value> + <value>block</value> + <value>demote</value> + <value>stop</value> + <value>restart</value> + <value>standby</value> + <value>fence</value> + <value>restart-container</value> + </choice> + </attribute> + </optional> + <ref name="element-resource-extra.op"/> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="element-resource-class"> + <choice> + <group> + <attribute name="class"><value>ocf</value></attribute> + <attribute name="provider"><text/></attribute> + </group> + <attribute name="class"> + <choice> + <value>lsb</value> + <value>heartbeat</value> + <value>stonith</value> + <value>upstart</value> + <value>service</value> + <value>systemd</value> + <value>nagios</value> + </choice> + </attribute> + </choice> + </define> +</grammar> diff --git a/xml/rule-2.9.rng b/xml/rule-2.9.rng new file mode 100644 index 0000000..509eb4e --- /dev/null +++ b/xml/rule-2.9.rng @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + xmlns:ann="http://relaxng.org/ns/compatibility/annotations/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-rule"/> + </start> + + <define name="element-rule"> + <element name="rule"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + </choice> + <optional> + <attribute name="boolean-op"> + <choice> + <value>or</value> + <value>and</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="role"><text/></attribute> + </optional> + <oneOrMore> + <choice> + <element name="expression"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="attribute"><text/></attribute> + <attribute name="operation"> + <choice> + <value>lt</value> + <value>gt</value> + <value>lte</value> + <value>gte</value> + <value>eq</value> + <value>ne</value> + <value>defined</value> + <value>not_defined</value> + </choice> + </attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + <optional> + <attribute name="type" ann:defaultValue="string"> + <choice> + <value>string</value> + <value>number</value> + <value>version</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="value-source" ann:defaultValue="literal"> + <choice> + <value>literal</value> + <value>param</value> + <value>meta</value> + </choice> + </attribute> + </optional> + </element> + <element name="date_expression"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="operation"><value>in_range</value></attribute> + <choice> + <group> + <optional> + <attribute name="start"><text/></attribute> + </optional> + <attribute name="end"><text/></attribute> + </group> + <group> + <attribute name="start"><text/></attribute> + <element name="duration"> + <ref name="date-common"/> + </element> + </group> + </choice> + </group> + <group> + <attribute name="operation"><value>gt</value></attribute> + <attribute name="start"><text/></attribute> + </group> + <group> + <attribute name="operation"><value>lt</value></attribute> + <choice> + <attribute name="end"><text/></attribute> + </choice> + </group> + <group> + <attribute name="operation"><value>date_spec</value></attribute> + <element name="date_spec"> + <ref name="date-common"/> + </element> + </group> + </choice> + </element> + <ref name="element-rule"/> + </choice> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="date-common"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="hours"><text/></attribute> + </optional> + <optional> + <attribute name="monthdays"><text/></attribute> + </optional> + <optional> + <attribute name="weekdays"><text/></attribute> + </optional> + <optional> + <attribute name="yearsdays"><text/></attribute> + </optional> + <optional> + <attribute name="months"><text/></attribute> + </optional> + <optional> + <attribute name="weeks"><text/></attribute> + </optional> + <optional> + <attribute name="years"><text/></attribute> + </optional> + <optional> + <attribute name="weekyears"><text/></attribute> + </optional> + <optional> + <attribute name="moon"><text/></attribute> + </optional> + </define> + +</grammar> diff --git a/xml/rule-3.4.rng b/xml/rule-3.4.rng new file mode 100644 index 0000000..5d1daf0 --- /dev/null +++ b/xml/rule-3.4.rng @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + xmlns:ann="http://relaxng.org/ns/compatibility/annotations/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-rule"/> + </start> + + <define name="element-rule"> + <element name="rule"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + </choice> + <optional> + <attribute name="boolean-op"> + <choice> + <value>or</value> + <value>and</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="role"><text/></attribute> + </optional> + <oneOrMore> + <choice> + <element name="expression"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="attribute"><text/></attribute> + <attribute name="operation"> + <choice> + <value>lt</value> + <value>gt</value> + <value>lte</value> + <value>gte</value> + <value>eq</value> + <value>ne</value> + <value>defined</value> + <value>not_defined</value> + </choice> + </attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + <optional> + <attribute name="type" ann:defaultValue="string"> + <choice> + <value>string</value> + <value>number</value> + <value>version</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="value-source" ann:defaultValue="literal"> + <choice> + <value>literal</value> + <value>param</value> + <value>meta</value> + </choice> + </attribute> + </optional> + </element> + <element name="date_expression"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="operation"><value>in_range</value></attribute> + <choice> + <group> + <optional> + <attribute name="start"><text/></attribute> + </optional> + <attribute name="end"><text/></attribute> + </group> + <group> + <attribute name="start"><text/></attribute> + <element name="duration"> + <ref name="date-common"/> + </element> + </group> + </choice> + </group> + <group> + <attribute name="operation"><value>gt</value></attribute> + <attribute name="start"><text/></attribute> + </group> + <group> + <attribute name="operation"><value>lt</value></attribute> + <choice> + <attribute name="end"><text/></attribute> + </choice> + </group> + <group> + <attribute name="operation"><value>date_spec</value></attribute> + <element name="date_spec"> + <ref name="date-common"/> + </element> + </group> + </choice> + </element> + <element name="rsc_expression"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="class"><text/></attribute> + </optional> + <optional> + <attribute name="provider"><text/></attribute> + </optional> + <optional> + <attribute name="type"><text/></attribute> + </optional> + </element> + <element name="op_expression"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <optional> + <attribute name="interval"><text/></attribute> + </optional> + </element> + <ref name="element-rule"/> + </choice> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="date-common"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="hours"><text/></attribute> + </optional> + <optional> + <attribute name="monthdays"><text/></attribute> + </optional> + <optional> + <attribute name="weekdays"><text/></attribute> + </optional> + <optional> + <attribute name="yearsdays"><text/></attribute> + </optional> + <optional> + <attribute name="months"><text/></attribute> + </optional> + <optional> + <attribute name="weeks"><text/></attribute> + </optional> + <optional> + <attribute name="years"><text/></attribute> + </optional> + <optional> + <attribute name="weekyears"><text/></attribute> + </optional> + <optional> + <attribute name="moon"><text/></attribute> + </optional> + </define> + +</grammar> diff --git a/xml/rule-3.5.rng b/xml/rule-3.5.rng new file mode 100644 index 0000000..82be4d6 --- /dev/null +++ b/xml/rule-3.5.rng @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + xmlns:ann="http://relaxng.org/ns/compatibility/annotations/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-rule"/> + </start> + + <define name="element-rule"> + <element name="rule"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + </choice> + <optional> + <attribute name="boolean-op"> + <choice> + <value>or</value> + <value>and</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="role"><text/></attribute> + </optional> + <oneOrMore> + <choice> + <element name="expression"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="attribute"><text/></attribute> + <attribute name="operation"> + <choice> + <value>lt</value> + <value>gt</value> + <value>lte</value> + <value>gte</value> + <value>eq</value> + <value>ne</value> + <value>defined</value> + <value>not_defined</value> + </choice> + </attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + <optional> + <attribute name="type" ann:defaultValue="string"> + <choice> + <value>string</value> + <value>integer</value> + <value>number</value> + <value>version</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="value-source" ann:defaultValue="literal"> + <choice> + <value>literal</value> + <value>param</value> + <value>meta</value> + </choice> + </attribute> + </optional> + </element> + <element name="date_expression"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="operation"><value>in_range</value></attribute> + <choice> + <group> + <optional> + <attribute name="start"><text/></attribute> + </optional> + <attribute name="end"><text/></attribute> + </group> + <group> + <attribute name="start"><text/></attribute> + <element name="duration"> + <ref name="date-common"/> + </element> + </group> + </choice> + </group> + <group> + <attribute name="operation"><value>gt</value></attribute> + <attribute name="start"><text/></attribute> + </group> + <group> + <attribute name="operation"><value>lt</value></attribute> + <choice> + <attribute name="end"><text/></attribute> + </choice> + </group> + <group> + <attribute name="operation"><value>date_spec</value></attribute> + <element name="date_spec"> + <ref name="date-common"/> + </element> + </group> + </choice> + </element> + <element name="rsc_expression"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="class"><text/></attribute> + </optional> + <optional> + <attribute name="provider"><text/></attribute> + </optional> + <optional> + <attribute name="type"><text/></attribute> + </optional> + </element> + <element name="op_expression"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <optional> + <attribute name="interval"><text/></attribute> + </optional> + </element> + <ref name="element-rule"/> + </choice> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="date-common"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="hours"><text/></attribute> + </optional> + <optional> + <attribute name="monthdays"><text/></attribute> + </optional> + <optional> + <attribute name="weekdays"><text/></attribute> + </optional> + <optional> + <attribute name="yearsdays"><text/></attribute> + </optional> + <optional> + <attribute name="months"><text/></attribute> + </optional> + <optional> + <attribute name="weeks"><text/></attribute> + </optional> + <optional> + <attribute name="years"><text/></attribute> + </optional> + <optional> + <attribute name="weekyears"><text/></attribute> + </optional> + <optional> + <attribute name="moon"><text/></attribute> + </optional> + </define> + +</grammar> diff --git a/xml/rule-3.9.rng b/xml/rule-3.9.rng new file mode 100644 index 0000000..df4eb2a --- /dev/null +++ b/xml/rule-3.9.rng @@ -0,0 +1,382 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + xmlns:ann="http://relaxng.org/ns/compatibility/annotations/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-rule"/> + </start> + + <!-- + The COMPAT comments below mark items that are invalid in their given context + and should be removed at a compatibility break. + --> + + <!-- + A rule element that doesn't match any of the special cases defined below + --> + <define name="element-rule"> + <element name="rule"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <ref name="rule-common"/> + <oneOrMore> + <choice> + <ref name="expression"/> + <ref name="date_expression"/> + <ref name="element-rule"/> + + <!-- + @COMPAT: The below expression types are invalid for element-rule + --> + <ref name="rsc_expression"/> + <ref name="op_expression"/> + </choice> + </oneOrMore> + + <!-- + @COMPAT: The below score attributes are invalid for element-rule + --> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + </choice> + </optional> + </group> + </choice> + </element> + </define> + + <!-- A rule element in a location constraint --> + <define name="element-rule-location"> + <element name="rule"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <ref name="rule-common"/> + <oneOrMore> + <choice> + <ref name="expression-location"/> + <ref name="date_expression"/> + <ref name="element-rule-location"/> + + <!-- + @COMPAT: The below expression types are invalid for + element-rule-location + --> + <ref name="rsc_expression"/> + <ref name="op_expression"/> + </choice> + </oneOrMore> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + </choice> + </optional> + </group> + </choice> + </element> + </define> + + <!-- A rule element in a rsc_defaults element --> + <define name="element-rule-rsc_defaults"> + <element name="rule"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <ref name="rule-common"/> + <oneOrMore> + <choice> + <ref name="expression"/> + <ref name="date_expression"/> + <ref name="rsc_expression"/> + <ref name="element-rule-rsc_defaults"/> + + <!-- + @COMPAT: The below expression type is invalid for + element-rule-rsc_defaults + --> + <ref name="op_expression"/> + </choice> + </oneOrMore> + + <!-- + @COMPAT: The below score attributes are invalid for + element-rule-rsc_defaults + --> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + </choice> + </optional> + </group> + </choice> + </element> + </define> + + <!-- A rule element in an op_defaults element --> + <define name="element-rule-op_defaults"> + <element name="rule"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <ref name="rule-common"/> + <oneOrMore> + <choice> + <ref name="expression"/> + <ref name="date_expression"/> + <ref name="rsc_expression"/> + <ref name="op_expression"/> + <ref name="element-rule-op_defaults"/> + </choice> + </oneOrMore> + + <!-- + @COMPAT: The below score attributes are invalid for + element-rule-op_defaults + --> + <optional> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + </choice> + </optional> + </group> + </choice> + </element> + </define> + + <!-- Attributes that are common to all rule elements --> + <define name="rule-common"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="boolean-op"> + <choice> + <value>or</value> + <value>and</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="role"><text/></attribute> + </optional> + </define> + + <!-- A node attribute expression --> + <define name="expression"> + <element name="expression"> + <ref name="expression-common"/> + + <!-- + @COMPAT: The value-source attribute is invalid for expression + --> + <optional> + <attribute name="value-source" ann:defaultValue="literal"> + <choice> + <value>literal</value> + <value>param</value> + <value>meta</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <!-- A node attribute expression in a location constraint --> + <define name="expression-location"> + <element name="expression"> + <ref name="expression-common"/> + <optional> + <attribute name="value-source" ann:defaultValue="literal"> + <choice> + <value>literal</value> + <value>param</value> + <value>meta</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <!-- Attributes that are common to all <expression> elements --> + <define name="expression-common"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="attribute"><text/></attribute> + <attribute name="operation"> + <choice> + <value>lt</value> + <value>gt</value> + <value>lte</value> + <value>gte</value> + <value>eq</value> + <value>ne</value> + <value>defined</value> + <value>not_defined</value> + </choice> + </attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + <optional> + <attribute name="type" ann:defaultValue="string"> + <choice> + <value>string</value> + <value>integer</value> + <value>number</value> + <value>version</value> + </choice> + </attribute> + </optional> + </define> + + <define name="date_expression"> + <element name="date_expression"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="operation"><value>in_range</value></attribute> + <choice> + <attribute name="start"><text/></attribute> + <attribute name="end"><text/></attribute> + <group> + <attribute name="start"><text/></attribute> + <attribute name="end"><text/></attribute> + </group> + </choice> + <optional> + <ref name="duration"/> + </optional> + </group> + <group> + <attribute name="operation"><value>gt</value></attribute> + <attribute name="start"><text/></attribute> + </group> + <group> + <attribute name="operation"><value>lt</value></attribute> + <attribute name="end"><text/></attribute> + </group> + <group> + <attribute name="operation"><value>date_spec</value></attribute> + <ref name="date_spec"/> + </group> + </choice> + </element> + </define> + + <define name="rsc_expression"> + <element name="rsc_expression"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="class"><text/></attribute> + </optional> + <optional> + <attribute name="provider"><text/></attribute> + </optional> + <optional> + <attribute name="type"><text/></attribute> + </optional> + </element> + </define> + + <define name="op_expression"> + <element name="op_expression"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="name"><text/></attribute> + <optional> + <attribute name="interval"><text/></attribute> + </optional> + </element> + </define> + + <define name="duration"> + <element name="duration"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="years"><text/></attribute> + </optional> + <optional> + <attribute name="months"><text/></attribute> + </optional> + <optional> + <attribute name="weeks"><text/></attribute> + </optional> + <optional> + <attribute name="days"><text/></attribute> + </optional> + <optional> + <attribute name="hours"><text/></attribute> + </optional> + <optional> + <attribute name="minutes"><text/></attribute> + </optional> + <optional> + <attribute name="seconds"><text/></attribute> + </optional> + + <!-- @COMPAT: The below attributes are invalid for duration --> + <optional> + <attribute name="monthdays"><text/></attribute> + </optional> + <optional> + <attribute name="weekdays"><text/></attribute> + </optional> + <optional> + <attribute name="yearsdays"><text/></attribute> + </optional> + <optional> + <attribute name="weekyears"><text/></attribute> + </optional> + <optional> + <attribute name="moon"><text/></attribute> + </optional> + </element> + </define> + + <define name="date_spec"> + <element name="date_spec"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="years"><text/></attribute> + </optional> + <optional> + <attribute name="months"><text/></attribute> + </optional> + <optional> + <attribute name="monthdays"><text/></attribute> + </optional> + <optional> + <attribute name="hours"><text/></attribute> + </optional> + <optional> + <attribute name="minutes"><text/></attribute> + </optional> + <optional> + <attribute name="seconds"><text/></attribute> + </optional> + <optional> + <attribute name="yeardays"><text/></attribute> + </optional> + <optional> + <attribute name="weekyears"><text/></attribute> + </optional> + <optional> + <attribute name="weeks"><text/></attribute> + </optional> + <optional> + <attribute name="weekdays"><text/></attribute> + </optional> + <optional> + <attribute name="moon"><text/></attribute> + </optional> + + <!-- @COMPAT: The below attributes are invalid for date_spec --> + <optional> + <attribute name="yearsdays"><text/></attribute> + </optional> + </element> + </define> + +</grammar> diff --git a/xml/rule.rng b/xml/rule.rng new file mode 100644 index 0000000..8084526 --- /dev/null +++ b/xml/rule.rng @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + xmlns:ann="http://relaxng.org/ns/compatibility/annotations/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="element-rule"/> + </start> + + <define name="element-rule"> + <element name="rule"> + <choice> + <attribute name="id-ref"><data type="IDREF"/></attribute> + <group> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <externalRef href="score.rng"/> + <attribute name="score-attribute"><text/></attribute> + </choice> + <optional> + <attribute name="boolean-op"> + <choice> + <value>or</value> + <value>and</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="role"><text/></attribute> + </optional> + <oneOrMore> + <choice> + <element name="expression"> + <attribute name="id"><data type="ID"/></attribute> + <attribute name="attribute"><text/></attribute> + <attribute name="operation"> + <choice> + <value>lt</value> + <value>gt</value> + <value>lte</value> + <value>gte</value> + <value>eq</value> + <value>ne</value> + <value>defined</value> + <value>not_defined</value> + </choice> + </attribute> + <optional> + <attribute name="value"><text/></attribute> + </optional> + <optional> + <attribute name="type" ann:defaultValue="string"> + <choice> + <value>string</value> + <value>number</value> + <value>version</value> + </choice> + </attribute> + </optional> + </element> + <element name="date_expression"> + <attribute name="id"><data type="ID"/></attribute> + <choice> + <group> + <attribute name="operation"><value>in_range</value></attribute> + <choice> + <group> + <optional> + <attribute name="start"><text/></attribute> + </optional> + <attribute name="end"><text/></attribute> + </group> + <group> + <attribute name="start"><text/></attribute> + <element name="duration"> + <ref name="date-common"/> + </element> + </group> + </choice> + </group> + <group> + <attribute name="operation"><value>gt</value></attribute> + <attribute name="start"><text/></attribute> + </group> + <group> + <attribute name="operation"><value>lt</value></attribute> + <choice> + <attribute name="end"><text/></attribute> + </choice> + </group> + <group> + <attribute name="operation"><value>date_spec</value></attribute> + <element name="date_spec"> + <ref name="date-common"/> + </element> + </group> + </choice> + </element> + <ref name="element-rule"/> + </choice> + </oneOrMore> + </group> + </choice> + </element> + </define> + + <define name="date-common"> + <attribute name="id"><data type="ID"/></attribute> + <optional> + <attribute name="hours"><text/></attribute> + </optional> + <optional> + <attribute name="monthdays"><text/></attribute> + </optional> + <optional> + <attribute name="weekdays"><text/></attribute> + </optional> + <optional> + <attribute name="yearsdays"><text/></attribute> + </optional> + <optional> + <attribute name="months"><text/></attribute> + </optional> + <optional> + <attribute name="weeks"><text/></attribute> + </optional> + <optional> + <attribute name="years"><text/></attribute> + </optional> + <optional> + <attribute name="weekyears"><text/></attribute> + </optional> + <optional> + <attribute name="moon"><text/></attribute> + </optional> + </define> + +</grammar> diff --git a/xml/score.rng b/xml/score.rng new file mode 100644 index 0000000..c632932 --- /dev/null +++ b/xml/score.rng @@ -0,0 +1,18 @@ +<?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="attribute-score"/> + </start> + + <define name="attribute-score"> + <attribute name="score"> + <choice> + <data type="integer"/> + <value>INFINITY</value> + <value>+INFINITY</value> + <value>-INFINITY</value> + </choice> + </attribute> + </define> +</grammar> diff --git a/xml/status-1.0.rng b/xml/status-1.0.rng new file mode 100644 index 0000000..b4e87cd --- /dev/null +++ b/xml/status-1.0.rng @@ -0,0 +1,24 @@ +<?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-status"/> + </start> + + <define name="element-status"> + <zeroOrMore> + <choice> + <attribute> + <anyName/> + <text/> + </attribute> + <element> + <anyName/> + <ref name="element-status"/> + </element> + <text/> + </choice> + </zeroOrMore> + </define> + +</grammar>
\ No newline at end of file diff --git a/xml/tags-1.3.rng b/xml/tags-1.3.rng new file mode 100644 index 0000000..95e3e47 --- /dev/null +++ b/xml/tags-1.3.rng @@ -0,0 +1,25 @@ +<?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> + <optional> + <ref name="element-tags"/> + </optional> + </start> + + <define name="element-tags"> + <element name="tags"> + <zeroOrMore> + <element name="tag"> + <attribute name="id"><data type="ID"/></attribute> + <oneOrMore> + <element name="obj_ref"> + <attribute name="id "><data type="IDREF"/></attribute> + </element> + </oneOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/tags-3.3.rng b/xml/tags-3.3.rng new file mode 100644 index 0000000..d94d73a --- /dev/null +++ b/xml/tags-3.3.rng @@ -0,0 +1,25 @@ +<?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> + <optional> + <ref name="element-tags"/> + </optional> + </start> + + <define name="element-tags"> + <element name="tags"> + <zeroOrMore> + <element name="tag"> + <attribute name="id"><data type="ID"/></attribute> + <oneOrMore> + <element name="obj_ref"> + <attribute name="id"><text /></attribute> + </element> + </oneOrMore> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/xml/test-2-enter/010-clu-props.ref b/xml/test-2-enter/010-clu-props.ref new file mode 100644 index 0000000..86369fb --- /dev/null +++ b/xml/test-2-enter/010-clu-props.ref @@ -0,0 +1,17 @@ +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-stonith_enabled" name="stonith_enabled" value="off"/> + </cluster_property_set> + <!-- this doesn't make any sense, i.e., a design flaw --> + <cluster_property_set id="_cibtr-2_cluster-opts"> + <nvpair id="__cibtr-2_cluster-opts__cluster-opts-stonith_enabled" name="stonith_enabled" value="off"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-enter/010-clu-props.ref.err b/xml/test-2-enter/010-clu-props.ref.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/xml/test-2-enter/010-clu-props.ref.err diff --git a/xml/test-2-enter/010-clu-props.xml b/xml/test-2-enter/010-clu-props.xml new file mode 100644 index 0000000..e44f4db --- /dev/null +++ b/xml/test-2-enter/010-clu-props.xml @@ -0,0 +1,15 @@ +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-stonith_enabled" name="stonith_enabled" value="off"/> + </cluster_property_set> + <!-- this doesn't make any sense, i.e., a design flaw --> + <cluster_property_set id-ref="cluster-opts"/> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-enter/020-instance_atributes-rsc.ref b/xml/test-2-enter/020-instance_atributes-rsc.ref new file mode 100644 index 0000000..e746319 --- /dev/null +++ b/xml/test-2-enter/020-instance_atributes-rsc.ref @@ -0,0 +1,41 @@ +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr1" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr1-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myAddr1-params"> + <nvpair id="myAddr1-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <instance_attributes id="myAddr-common-params"> + <nvpair id="myAddr-common-cidr_netmask" name="cidr_netmask" value="23"/> + </instance_attributes> + </primitive> + + <primitive id="myAddr2" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr2-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myAddr2-params"> + <nvpair id="myAddr2-ip" name="ip" value="192.0.2.42"/> + </instance_attributes> + <instance_attributes id="_cibtr-2_myAddr-common-params"> + <nvpair id="__cibtr-2_myAddr-common-params__myAddr-common-cidr_netmask" name="cidr_netmask" value="23"/> + </instance_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-enter/020-instance_atributes-rsc.ref.err b/xml/test-2-enter/020-instance_atributes-rsc.ref.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/xml/test-2-enter/020-instance_atributes-rsc.ref.err diff --git a/xml/test-2-enter/020-instance_atributes-rsc.xml b/xml/test-2-enter/020-instance_atributes-rsc.xml new file mode 100644 index 0000000..0a651d0 --- /dev/null +++ b/xml/test-2-enter/020-instance_atributes-rsc.xml @@ -0,0 +1,39 @@ +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr1" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr1-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myAddr1-params"> + <nvpair id="myAddr1-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <instance_attributes id="myAddr-common-params"> + <nvpair id="myAddr-common-cidr_netmask" name="cidr_netmask" value="23"/> + </instance_attributes> + </primitive> + + <primitive id="myAddr2" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr2-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myAddr2-params"> + <nvpair id="myAddr2-ip" name="ip" value="192.0.2.42"/> + </instance_attributes> + <instance_attributes id-ref="myAddr-common-params"/> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-enter/021-instance_atributes-rsc-nonbijective.ref b/xml/test-2-enter/021-instance_atributes-rsc-nonbijective.ref new file mode 100644 index 0000000..3a94fb0 --- /dev/null +++ b/xml/test-2-enter/021-instance_atributes-rsc-nonbijective.ref @@ -0,0 +1,40 @@ +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="mySmartFuse" class="ocf" provider="experiment" type="SmartFuse"> + <operations> + <op id="mySmartFuse-start" name="start" interval="0" timeout="40s"/> + <op id="mySmartFuse-monitor-inputpower" name="monitor" interval="30s"> + <instance_attributes id="mySmartFuse-inputpower-instanceparams"> + <nvpair id="mySmartFuse-inputpower-requires" name="requires" value="inputpower"/> + </instance_attributes> + </op> + <op id="mySmartFuse-monitor-outputpower" name="monitor" interval="2s"> + <instance_attributes id="mySmartFuse-outputpower-instanceparams"> + <nvpair id="mySmartFuse-outputpower-requires" name="requires" value="outputpower"/> + </instance_attributes> + </op> + </operations> + <instance_attributes id="mySmartFuse-params"> + <nvpair id="mySmartFuse-params-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <!-- a bit hairy but valid --> + <instance_attributes id="_cibtr-2_mySmartFuse-outputpower-instanceparams"> + <nvpair id="__cibtr-2_mySmartFuse-outputpower-instanceparams__mySmartFuse-outputpower-requires" name="requires" value="outputpower"/> + </instance_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-enter/021-instance_atributes-rsc-nonbijective.ref.err b/xml/test-2-enter/021-instance_atributes-rsc-nonbijective.ref.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/xml/test-2-enter/021-instance_atributes-rsc-nonbijective.ref.err diff --git a/xml/test-2-enter/021-instance_atributes-rsc-nonbijective.xml b/xml/test-2-enter/021-instance_atributes-rsc-nonbijective.xml new file mode 100644 index 0000000..7a12ebe --- /dev/null +++ b/xml/test-2-enter/021-instance_atributes-rsc-nonbijective.xml @@ -0,0 +1,38 @@ +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="mySmartFuse" class="ocf" provider="experiment" type="SmartFuse"> + <operations> + <op id="mySmartFuse-start" name="start" interval="0" timeout="40s"/> + <op id="mySmartFuse-monitor-inputpower" name="monitor" interval="30s"> + <instance_attributes id="mySmartFuse-inputpower-instanceparams"> + <nvpair id="mySmartFuse-inputpower-requires" name="requires" value="inputpower"/> + </instance_attributes> + </op> + <op id="mySmartFuse-monitor-outputpower" name="monitor" interval="2s"> + <instance_attributes id="mySmartFuse-outputpower-instanceparams"> + <nvpair id="mySmartFuse-outputpower-requires" name="requires" value="outputpower"/> + </instance_attributes> + </op> + </operations> + <instance_attributes id="mySmartFuse-params"> + <nvpair id="mySmartFuse-params-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <!-- a bit hairy but valid --> + <instance_attributes id-ref="mySmartFuse-outputpower-instanceparams"/> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-leave/010-clu-props-can.ref b/xml/test-2-leave/010-clu-props-can.ref new file mode 100644 index 0000000..afa924d --- /dev/null +++ b/xml/test-2-leave/010-clu-props-can.ref @@ -0,0 +1,14 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-stonith_enabled" name="stonith-enabled" value="off"/> + </cluster_property_set> + <cluster_property_set id-ref="cluster-opts"/> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-leave/010-clu-props-can.ref.err b/xml/test-2-leave/010-clu-props-can.ref.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/xml/test-2-leave/010-clu-props-can.ref.err diff --git a/xml/test-2-leave/010-clu-props-can.xml b/xml/test-2-leave/010-clu-props-can.xml new file mode 100644 index 0000000..cd82fa8 --- /dev/null +++ b/xml/test-2-leave/010-clu-props-can.xml @@ -0,0 +1,16 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-stonith_enabled" name="stonith-enabled" value="off"/> + </cluster_property_set> + <cluster_property_set id="_cibtr-2_cluster-opts"> + <nvpair id="__cibtr-2_cluster-opts__cluster-opts-stonith_enabled" name="stonith-enabled" value="off"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-leave/011-clu-props-cannot.ref b/xml/test-2-leave/011-clu-props-cannot.ref new file mode 100644 index 0000000..c129f57 --- /dev/null +++ b/xml/test-2-leave/011-clu-props-cannot.ref @@ -0,0 +1,16 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-stonith_enabled" name="stonith-enabled" value="off"/> + </cluster_property_set> + <cluster_property_set id="_cibtr-2_cluster-opts"> + <nvpair id="__cibtr-2_cluster-opts__cluster-opts-stonith_enabled" name="stonith-enabled" value="on"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-leave/011-clu-props-cannot.ref.err b/xml/test-2-leave/011-clu-props-cannot.ref.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/xml/test-2-leave/011-clu-props-cannot.ref.err diff --git a/xml/test-2-leave/011-clu-props-cannot.xml b/xml/test-2-leave/011-clu-props-cannot.xml new file mode 100644 index 0000000..c129f57 --- /dev/null +++ b/xml/test-2-leave/011-clu-props-cannot.xml @@ -0,0 +1,16 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-stonith_enabled" name="stonith-enabled" value="off"/> + </cluster_property_set> + <cluster_property_set id="_cibtr-2_cluster-opts"> + <nvpair id="__cibtr-2_cluster-opts__cluster-opts-stonith_enabled" name="stonith-enabled" value="on"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-leave/021-instance_atributes-rsc-nonbijective.ref b/xml/test-2-leave/021-instance_atributes-rsc-nonbijective.ref new file mode 100644 index 0000000..93ac06f --- /dev/null +++ b/xml/test-2-leave/021-instance_atributes-rsc-nonbijective.ref @@ -0,0 +1,32 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="mySmartFuse" class="ocf" provider="experiment" type="SmartFuse"> + <operations> + <op id="mySmartFuse-start" name="start" interval="0" timeout="40s"/> + <op id="mySmartFuse-monitor-inputpower" name="monitor" interval="30s"/> + <op id="mySmartFuse-monitor-outputpower" name="monitor" interval="2s"/> + </operations> + <instance_attributes id="mySmartFuse-params"> + <nvpair id="mySmartFuse-params-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <!-- a bit hairy but valid --> + <instance_attributes id="_cibtr-2_mySmartFuse-outputpower-instanceparams"> + <nvpair id="__cibtr-2_mySmartFuse-outputpower-instanceparams__mySmartFuse-outputpower-requires" name="requires" value="outputpower"/> + </instance_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-leave/021-instance_atributes-rsc-nonbijective.ref.err b/xml/test-2-leave/021-instance_atributes-rsc-nonbijective.ref.err new file mode 100644 index 0000000..70adf27 --- /dev/null +++ b/xml/test-2-leave/021-instance_atributes-rsc-nonbijective.ref.err @@ -0,0 +1 @@ +DEBUG: instance_attributes: original element pointed to with @id-ref (mySmartFuse-outputpower-instanceparams) disappeared during upgrade diff --git a/xml/test-2-leave/021-instance_atributes-rsc-nonbijective.xml b/xml/test-2-leave/021-instance_atributes-rsc-nonbijective.xml new file mode 100644 index 0000000..93ac06f --- /dev/null +++ b/xml/test-2-leave/021-instance_atributes-rsc-nonbijective.xml @@ -0,0 +1,32 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="mySmartFuse" class="ocf" provider="experiment" type="SmartFuse"> + <operations> + <op id="mySmartFuse-start" name="start" interval="0" timeout="40s"/> + <op id="mySmartFuse-monitor-inputpower" name="monitor" interval="30s"/> + <op id="mySmartFuse-monitor-outputpower" name="monitor" interval="2s"/> + </operations> + <instance_attributes id="mySmartFuse-params"> + <nvpair id="mySmartFuse-params-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <!-- a bit hairy but valid --> + <instance_attributes id="_cibtr-2_mySmartFuse-outputpower-instanceparams"> + <nvpair id="__cibtr-2_mySmartFuse-outputpower-instanceparams__mySmartFuse-outputpower-requires" name="requires" value="outputpower"/> + </instance_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-roundtrip/021-instance_atributes-rsc-nonbijective.ref b/xml/test-2-roundtrip/021-instance_atributes-rsc-nonbijective.ref new file mode 100644 index 0000000..ee5819d --- /dev/null +++ b/xml/test-2-roundtrip/021-instance_atributes-rsc-nonbijective.ref @@ -0,0 +1,32 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="mySmartFuse" class="ocf" provider="experiment" type="SmartFuse"> + <operations> + <op id="mySmartFuse-start" name="start" interval="0" timeout="40s"/> + <op id="mySmartFuse-monitor-inputpower" name="monitor" interval="30s"/> + <op id="mySmartFuse-monitor-outputpower" name="monitor" interval="2s"/> + </operations> + <instance_attributes id="mySmartFuse-params"> + <nvpair id="mySmartFuse-params-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <!-- a bit hairy but valid --> + <instance_attributes id="_cibtr-2_mySmartFuse-outputpower-instanceparams"> + <nvpair id="__cibtr-2_mySmartFuse-outputpower-instanceparams__mySmartFuse-outputpower-requires" name="requires" value="outputpower"/> + </instance_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2-roundtrip/021-instance_atributes-rsc-nonbijective.ref.err b/xml/test-2-roundtrip/021-instance_atributes-rsc-nonbijective.ref.err new file mode 100644 index 0000000..68de733 --- /dev/null +++ b/xml/test-2-roundtrip/021-instance_atributes-rsc-nonbijective.ref.err @@ -0,0 +1,5 @@ +INFO: Resources-operation instance_attributes: mySmartFuse-monitor-inputpower (rsc=mySmartFuse, meta=mySmartFuse-inputpower-instanceparams): dropping requires +INFO: Resources-operation instance_attributes: ... only start/promote operation taken into account +INFO: Resources-operation instance_attributes: mySmartFuse-monitor-outputpower (rsc=mySmartFuse, meta=mySmartFuse-outputpower-instanceparams): dropping requires +INFO: Resources-operation instance_attributes: ... only start/promote operation taken into account +DEBUG: instance_attributes: original element pointed to with @id-ref (mySmartFuse-outputpower-instanceparams) disappeared during upgrade diff --git a/xml/test-2-roundtrip/021-instance_atributes-rsc-nonbijective.xml b/xml/test-2-roundtrip/021-instance_atributes-rsc-nonbijective.xml new file mode 100644 index 0000000..a5d25a5 --- /dev/null +++ b/xml/test-2-roundtrip/021-instance_atributes-rsc-nonbijective.xml @@ -0,0 +1,39 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="mySmartFuse" class="ocf" provider="experiment" type="SmartFuse"> + <operations> + <op id="mySmartFuse-start" name="start" interval="0" timeout="40s"/> + <op id="mySmartFuse-monitor-inputpower" name="monitor" interval="30s"> + <instance_attributes id="mySmartFuse-inputpower-instanceparams"> + <nvpair id="mySmartFuse-inputpower-requires" name="requires" value="inputpower"/> + </instance_attributes> + </op> + <op id="mySmartFuse-monitor-outputpower" name="monitor" interval="2s"> + <instance_attributes id="mySmartFuse-outputpower-instanceparams"> + <nvpair id="mySmartFuse-outputpower-requires" name="requires" value="outputpower"/> + </instance_attributes> + </op> + </operations> + <instance_attributes id="mySmartFuse-params"> + <nvpair id="mySmartFuse-params-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <!-- a bit hairy but valid --> + <instance_attributes id-ref="mySmartFuse-outputpower-instanceparams"/> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/010-rsc_colocation-dropped-for-noop-sa.ref b/xml/test-2/010-rsc_colocation-dropped-for-noop-sa.ref new file mode 100644 index 0000000..a4a4a23 --- /dev/null +++ b/xml/test-2/010-rsc_colocation-dropped-for-noop-sa.ref @@ -0,0 +1,60 @@ +<!-- + Contrieved example of how rsc_colocation/@score-attribute might have been used + + This was never implemented and, apparently, will not work. + --> +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"> + <instance_attributes id="virt-063-attrs"> + <nvpair id="virt-063-AddrHttpdTogether" name="AddrHttpdTogether" value="INFINITY"/> + </instance_attributes> + </node> + <node id="virt-064" uname="virt-064"> + <instance_attributes id="virt-064-attrs"> + <nvpair id="virt-064-AddrHttpdTogether" name="AddrHttpdTogether" value="INFINITY"/> + </instance_attributes> + </node> + <node id="virt-069" uname="virt-069"> + <instance_attributes id="virt-069-attrs"> + <!-- IPaddr2 won't work here, is DNS-load-balanced or something... --> + <nvpair id="virt-069-AddrHttpdTogether" name="AddrHttpdTogether" value="-INFINITY"/> + </instance_attributes> + </node> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + + <!-- this never worked like that --> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/010-rsc_colocation-dropped-for-noop-sa.ref.err b/xml/test-2/010-rsc_colocation-dropped-for-noop-sa.ref.err new file mode 100644 index 0000000..50791bf --- /dev/null +++ b/xml/test-2/010-rsc_colocation-dropped-for-noop-sa.ref.err @@ -0,0 +1,2 @@ +INFO: Constraints-colocation: colocation-addr-httpd: dropping score-attribute +INFO: Constraints-colocation: ... was actually never in effect diff --git a/xml/test-2/010-rsc_colocation-dropped-for-noop-sa.xml b/xml/test-2/010-rsc_colocation-dropped-for-noop-sa.xml new file mode 100644 index 0000000..70bedfd --- /dev/null +++ b/xml/test-2/010-rsc_colocation-dropped-for-noop-sa.xml @@ -0,0 +1,62 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<!-- + Contrieved example of how rsc_colocation/@score-attribute might have been used + + This was never implemented and, apparently, will not work. + --> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"> + <instance_attributes id="virt-063-attrs"> + <nvpair id="virt-063-AddrHttpdTogether" name="AddrHttpdTogether" value="INFINITY"/> + </instance_attributes> + </node> + <node id="virt-064" uname="virt-064"> + <instance_attributes id="virt-064-attrs"> + <nvpair id="virt-064-AddrHttpdTogether" name="AddrHttpdTogether" value="INFINITY"/> + </instance_attributes> + </node> + <node id="virt-069" uname="virt-069"> + <instance_attributes id="virt-069-attrs"> + <!-- IPaddr2 won't work here, is DNS-load-balanced or something... --> + <nvpair id="virt-069-AddrHttpdTogether" name="AddrHttpdTogether" value="-INFINITY"/> + </instance_attributes> + </node> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + + <!-- this never worked like that --> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" + score-attribute="AddrHttpdTogether"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/020-rsc-requires-inline.ref b/xml/test-2/020-rsc-requires-inline.ref new file mode 100644 index 0000000..cef2958 --- /dev/null +++ b/xml/test-2/020-rsc-requires-inline.ref @@ -0,0 +1,45 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <!-- relying on order (+ colocation) to guarantee "requires" + transitively (unfencing/fencing/quorum)? --> + <op id="myAddr-start" name="start" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <meta_attributes id="_2TO3_myAddr-meta"><nvpair id="_2TO3_myAddr-start-meta-requires" name="requires" value="nothing"/> + </meta_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/020-rsc-requires-inline.ref.err b/xml/test-2/020-rsc-requires-inline.ref.err new file mode 100644 index 0000000..9c65697 --- /dev/null +++ b/xml/test-2/020-rsc-requires-inline.ref.err @@ -0,0 +1 @@ +DEBUG: Resources-operation: myAddr-start (rsc=myAddr): moving requires under meta_attributes as requires unless already defined there for matching start|promote diff --git a/xml/test-2/020-rsc-requires-inline.xml b/xml/test-2/020-rsc-requires-inline.xml new file mode 100644 index 0000000..630bb18 --- /dev/null +++ b/xml/test-2/020-rsc-requires-inline.xml @@ -0,0 +1,45 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <!-- relying on order (+ colocation) to guarantee "requires" + transitively (unfencing/fencing/quorum)? --> + <op id="myAddr-start" name="start" interval="0" timeout="40s" + requires="nothing"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/021-rsc-requires-nvpair.ref b/xml/test-2/021-rsc-requires-nvpair.ref new file mode 100644 index 0000000..3c239e4 --- /dev/null +++ b/xml/test-2/021-rsc-requires-nvpair.ref @@ -0,0 +1,47 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <meta_attributes id="_2TO3_myAddr-start-metaparams"> + <!-- relying on order (+ colocation) to guarantee "requires" + transitively (unfencing/fencing/quorum)? --> + + <nvpair id="myAddr-start-requires" name="requires" value="nothing"/> + </meta_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/021-rsc-requires-nvpair.ref.err b/xml/test-2/021-rsc-requires-nvpair.ref.err new file mode 100644 index 0000000..6650f15 --- /dev/null +++ b/xml/test-2/021-rsc-requires-nvpair.ref.err @@ -0,0 +1 @@ +DEBUG: Resources-operation: myAddr-start (rsc=myAddr, meta=myAddr-start-metaparams): moving requires under meta_attributes as requires unless already defined there for matching start|promote diff --git a/xml/test-2/021-rsc-requires-nvpair.xml b/xml/test-2/021-rsc-requires-nvpair.xml new file mode 100644 index 0000000..6f75c20 --- /dev/null +++ b/xml/test-2/021-rsc-requires-nvpair.xml @@ -0,0 +1,48 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"> + <meta_attributes id="myAddr-start-metaparams"> + <!-- relying on order (+ colocation) to guarantee "requires" + transitively (unfencing/fencing/quorum)? --> + <nvpair id="myAddr-start-requires" name="requires" value="nothing"/> + </meta_attributes> + </op> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/022-rsc-requires-counterexamples.ref b/xml/test-2/022-rsc-requires-counterexamples.ref new file mode 100644 index 0000000..c100eef --- /dev/null +++ b/xml/test-2/022-rsc-requires-counterexamples.ref @@ -0,0 +1,48 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"> + <meta_attributes id="myAddr-start-metaparams"> + <!-- fake-requires != requires --> + <nvpair id="myAddr-start-requires" name="fake-requires" value="nothing"/> + </meta_attributes> + </op> + <!-- stop != start --> + <op id="myAddr-stop" name="stop" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/022-rsc-requires-counterexamples.ref.err b/xml/test-2/022-rsc-requires-counterexamples.ref.err new file mode 100644 index 0000000..6f6a995 --- /dev/null +++ b/xml/test-2/022-rsc-requires-counterexamples.ref.err @@ -0,0 +1,2 @@ +INFO: Resources-operation: myAddr-stop (rsc=myAddr): dropping requires +INFO: Resources-operation: ... only start/promote operation taken into account diff --git a/xml/test-2/022-rsc-requires-counterexamples.xml b/xml/test-2/022-rsc-requires-counterexamples.xml new file mode 100644 index 0000000..ce9717b --- /dev/null +++ b/xml/test-2/022-rsc-requires-counterexamples.xml @@ -0,0 +1,50 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"> + <meta_attributes id="myAddr-start-metaparams"> + <!-- fake-requires != requires --> + <nvpair id="myAddr-start-requires" name="fake-requires" value="nothing"/> + </meta_attributes> + </op> + <!-- stop != start --> + <op id="myAddr-stop" name="stop" interval="0" timeout="40s" + requires="nothing"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/023-rsc-requires-no-override.ref b/xml/test-2/023-rsc-requires-no-override.ref new file mode 100644 index 0000000..233a66a --- /dev/null +++ b/xml/test-2/023-rsc-requires-no-override.ref @@ -0,0 +1,56 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- possible override from op attribute --> + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"/> + <!-- stop != start --> + <op id="myAddr-stop" name="stop" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <meta_attributes id="myAddr-meta"> + <nvpair id="myAddr-requires" name="requires" value="quorum"/> + </meta_attributes> + </primitive> + + <!-- possible override from op's meta-attribute --> + <clone id="master"> + <meta_attributes id="master-meta"> + <nvpair id="master-promotable" name="promotable" value="true"/> + <nvpair id="master-promoted-node-max" name="promoted-node-max" value="1"/> + <nvpair id="master-clone-max" name="clone-max" value="3"/> + <nvpair id="master-promoted-max" name="promoted-max" value="1"/> + <nvpair id="master-clone-node-max" name="clone-node-max" value="1"/> + </meta_attributes> + <primitive id="stateful" class="ocf" type="Stateful" provider="pacemaker"> + <operations> + <op id="stateful-monitor-15s" interval="15s" name="monitor" timeout="60s"/> + <op id="stateful-monitor-16s" interval="16s" name="monitor" timeout="60s" role="Master"/> + <op id="stateful-promote" interval="0" name="promote" timeout="40s"/> + <!-- demote != promote --> + <op id="stateful-demote" interval="0" name="demote" timeout="40s"/> + </operations> + <meta_attributes id="stateful-meta"> + <nvpair id="stateful-requires" name="requires" value="quorum"/> + </meta_attributes> + </primitive> + </clone> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/023-rsc-requires-no-override.ref.err b/xml/test-2/023-rsc-requires-no-override.ref.err new file mode 100644 index 0000000..ad680b6 --- /dev/null +++ b/xml/test-2/023-rsc-requires-no-override.ref.err @@ -0,0 +1,4 @@ +DEBUG: Resources-operation: myAddr-start (rsc=myAddr): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: stateful-promote (rsc=stateful, meta=stateful-promote-meta): moving requires under meta_attributes as requires unless already defined there for matching start|promote +INFO: Resources-operation: stateful-demote (rsc=stateful, meta=stateful-demote-meta): dropping requires +INFO: Resources-operation: ... only start/promote operation taken into account diff --git a/xml/test-2/023-rsc-requires-no-override.xml b/xml/test-2/023-rsc-requires-no-override.xml new file mode 100644 index 0000000..8f3d765 --- /dev/null +++ b/xml/test-2/023-rsc-requires-no-override.xml @@ -0,0 +1,66 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- possible override from op attribute --> + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s" + requires="nothing"/> + <!-- stop != start --> + <op id="myAddr-stop" name="stop" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <meta_attributes id="myAddr-meta"> + <nvpair id="myAddr-requires" name="requires" value="quorum"/> + </meta_attributes> + </primitive> + + <!-- possible override from op's meta-attribute --> + <clone id="master"> + <meta_attributes id="master-meta"> + <nvpair id="master-promotable" name="promotable" value="true"/> + <nvpair id="master-promoted-node-max" name="promoted-node-max" value="1"/> + <nvpair id="master-clone-max" name="clone-max" value="3"/> + <nvpair id="master-promoted-max" name="promoted-max" value="1"/> + <nvpair id="master-clone-node-max" name="clone-node-max" value="1"/> + </meta_attributes> + <primitive id="stateful" class="ocf" type="Stateful" provider="pacemaker"> + <operations> + <op id="stateful-monitor-15s" interval="15s" name="monitor" timeout="60s"/> + <op id="stateful-monitor-16s" interval="16s" name="monitor" timeout="60s" role="Master"/> + <op id="stateful-promote" interval="0" name="promote" timeout="40s"> + <meta_attributes id="stateful-promote-meta"> + <nvpair id="stateful-promote-requires" name="requires" value="nothing"/> + </meta_attributes> + </op> + <!-- demote != promote --> + <op id="stateful-demote" interval="0" name="demote" timeout="40s"> + <meta_attributes id="stateful-demote-meta"> + <nvpair id="stateful-demote-requires" name="requires" value="nothing"/> + </meta_attributes> + </op> + </operations> + <meta_attributes id="stateful-meta"> + <nvpair id="stateful-requires" name="requires" value="quorum"/> + </meta_attributes> + </primitive> + </clone> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/024-rsc-requires-no-selfclash.ref b/xml/test-2/024-rsc-requires-no-selfclash.ref new file mode 100644 index 0000000..358ccd7 --- /dev/null +++ b/xml/test-2/024-rsc-requires-no-selfclash.ref @@ -0,0 +1,116 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- potential clash between pre-existing + meta_attributes/nvpair[@name = 'requires'] vs. + op[@name = 'start' + or + @name = 'promote']/@requires + and/or + op[@name = 'start' + or + @name = 'promote']/meta_attributes/nvpair[@name = 'requires'] --> + <primitive id="myAddr1" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr1-monitor" name="monitor" interval="30s"/> + <op id="myAddr1-start" name="start" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr1-params"> + <nvpair id="myAddr1-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <meta_attributes id="myAddr1-meta"> + <nvpair id="myAddr1-requires" name="requires" value="quorum"/> + </meta_attributes> + </primitive> + + <!-- potential clash between op[@name = 'start' + or + @name = 'promote']/@requires + and op[@name = 'start' + or + @name = 'promote']/meta_attributes/nvpair[@name = 'requires'] + (would-eliminate-override-meta-attribute is missing, + allowing for direct clash in the propagation logic) --> + <primitive id="myAddr2" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr2-monitor" name="monitor" interval="30s"/> + <op id="myAddr2-start" name="start" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr2-params"> + <nvpair id="myAddr2-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <meta_attributes id="_2TO3_myAddr2-meta"><nvpair id="_2TO3_myAddr2-start-meta-requires" name="requires" value="nothing"/> + </meta_attributes> + </primitive> + + <!-- potential clash between multiple op[@name = 'start' + or + @name = 'promote']/@requires + (would-eliminate-override-meta-attribute is missing, + allowing for direct clash in the propagation logic) --> + <clone id="master1"> + <meta_attributes id="master1-meta"> + <nvpair id="master1-promotable" name="promotable" value="true"/> + <nvpair id="master1-promoted-node-max" name="promoted-node-max" value="1"/> + <nvpair id="master1-clone-max" name="clone-max" value="3"/> + <nvpair id="master1-promoted-max" name="promoted-max" value="1"/> + <nvpair id="master1-clone-node-max" name="clone-node-max" value="1"/> + </meta_attributes> + <primitive id="stateful1" class="ocf" type="Stateful" provider="pacemaker"> + <operations> + <op id="stateful1-monitor-15s" interval="15s" name="monitor" timeout="60s"/> + <op id="stateful1-monitor-16s" interval="16s" name="monitor" timeout="60s" role="Master"/> + <op id="stateful1-promote" interval="0" name="promote" timeout="40s"/> + <op id="stateful1-start" interval="0" name="start" timeout="40s"/> + <!-- demote != promote --> + <op id="stateful1-demote" interval="0" name="demote" timeout="40s"/> + </operations> + <meta_attributes id="_2TO3_stateful1-meta"><nvpair id="_2TO3_stateful1-start-meta-requires" name="requires" value="fencing"/> + </meta_attributes> + </primitive> + </clone> + + <!-- potential clash between multiple + op[@name = 'start' + or + @name = 'promote']/meta_attributes/nvpair[@name = 'requires'] + (would-eliminate-override-meta-attribute is missing, + allowing for direct clash in the propagation logic) --> + <clone id="master2"> + <meta_attributes id="master2-meta"> + <nvpair id="master2-promotable" name="promotable" value="true"/> + <nvpair id="master2-promoted-node-max" name="promoted-node-max" value="1"/> + <nvpair id="master2-clone-max" name="clone-max" value="3"/> + <nvpair id="master2-promoted-max" name="promoted-max" value="1"/> + <nvpair id="master2-clone-node-max" name="clone-node-max" value="1"/> + </meta_attributes> + <primitive id="stateful2" class="ocf" type="Stateful" provider="pacemaker"> + <operations> + <op id="stateful2-monitor-15s" interval="15s" name="monitor" timeout="60s"/> + <op id="stateful2-monitor-16s" interval="16s" name="monitor" timeout="60s" role="Master"/> + <op id="stateful2-promote" interval="0" name="promote" timeout="40s"/> + <op id="stateful2-start" interval="0" name="start" timeout="40s"/> + <!-- demote != promote --> + <op id="stateful2-demote" interval="0" name="demote" timeout="40s"/> + </operations> + <meta_attributes id="_2TO3_stateful2-promote-meta3"> + + <nvpair id="stateful2-promote-requires3-1" name="requires" value="fencing"/> + </meta_attributes> + </primitive> + </clone> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/024-rsc-requires-no-selfclash.ref.err b/xml/test-2/024-rsc-requires-no-selfclash.ref.err new file mode 100644 index 0000000..b275532 --- /dev/null +++ b/xml/test-2/024-rsc-requires-no-selfclash.ref.err @@ -0,0 +1,14 @@ +DEBUG: Resources-operation: myAddr1-start (rsc=myAddr1, meta=myAddr1-start-meta): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: myAddr1-start (rsc=myAddr1): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: myAddr2-start (rsc=myAddr2, meta=myAddr2-start-meta): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: myAddr2-start (rsc=myAddr2): moving requires under meta_attributes as requires unless already defined there for matching start|promote +INFO: Resources-operation: stateful1-demote (rsc=stateful1, meta=stateful1-demote-meta): dropping requires +INFO: Resources-operation: ... only start/promote operation taken into account +DEBUG: Resources-operation: stateful1-promote (rsc=stateful1): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: stateful1-start (rsc=stateful1): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: stateful2-promote (rsc=stateful2, meta=stateful2-promote-meta1): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: stateful2-promote (rsc=stateful2, meta=stateful2-promote-meta1): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: stateful2-promote (rsc=stateful2, meta=stateful2-promote-meta2): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: stateful2-start (rsc=stateful2, meta=stateful2-promote-meta3): moving requires under meta_attributes as requires unless already defined there for matching start|promote +INFO: Resources-operation: stateful2-demote (rsc=stateful2, meta=stateful2-promote-meta): dropping requires +INFO: Resources-operation: ... only start/promote operation taken into account diff --git a/xml/test-2/024-rsc-requires-no-selfclash.xml b/xml/test-2/024-rsc-requires-no-selfclash.xml new file mode 100644 index 0000000..096c61c --- /dev/null +++ b/xml/test-2/024-rsc-requires-no-selfclash.xml @@ -0,0 +1,141 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- potential clash between pre-existing + meta_attributes/nvpair[@name = 'requires'] vs. + op[@name = 'start' + or + @name = 'promote']/@requires + and/or + op[@name = 'start' + or + @name = 'promote']/meta_attributes/nvpair[@name = 'requires'] --> + <primitive id="myAddr1" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr1-monitor" name="monitor" interval="30s"/> + <op id="myAddr1-start" name="start" interval="0" timeout="40s" + requires="nothing"> + <meta_attributes id="myAddr1-start-meta"> + <nvpair id="myAddr1-start-requires" name="requires" value="stonith"/> + </meta_attributes> + </op> + </operations> + <instance_attributes id="myAddr1-params"> + <nvpair id="myAddr1-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <meta_attributes id="myAddr1-meta"> + <nvpair id="myAddr1-requires" name="requires" value="quorum"/> + </meta_attributes> + </primitive> + + <!-- potential clash between op[@name = 'start' + or + @name = 'promote']/@requires + and op[@name = 'start' + or + @name = 'promote']/meta_attributes/nvpair[@name = 'requires'] + (would-eliminate-override-meta-attribute is missing, + allowing for direct clash in the propagation logic) --> + <primitive id="myAddr2" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr2-monitor" name="monitor" interval="30s"/> + <op id="myAddr2-start" name="start" interval="0" timeout="40s" + requires="nothing"> + <meta_attributes id="myAddr2-start-meta"> + <nvpair id="myAddr2-start-requires" name="requires" value="stonith"/> + </meta_attributes> + </op> + </operations> + <instance_attributes id="myAddr2-params"> + <nvpair id="myAddr2-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <!-- potential clash between multiple op[@name = 'start' + or + @name = 'promote']/@requires + (would-eliminate-override-meta-attribute is missing, + allowing for direct clash in the propagation logic) --> + <clone id="master1"> + <meta_attributes id="master1-meta"> + <nvpair id="master1-promotable" name="promotable" value="true"/> + <nvpair id="master1-promoted-node-max" name="promoted-node-max" value="1"/> + <nvpair id="master1-clone-max" name="clone-max" value="3"/> + <nvpair id="master1-promoted-max" name="promoted-max" value="1"/> + <nvpair id="master1-clone-node-max" name="clone-node-max" value="1"/> + </meta_attributes> + <primitive id="stateful1" class="ocf" type="Stateful" provider="pacemaker"> + <operations> + <op id="stateful1-monitor-15s" interval="15s" name="monitor" timeout="60s"/> + <op id="stateful1-monitor-16s" interval="16s" name="monitor" timeout="60s" role="Master"/> + <op id="stateful1-promote" interval="0" name="promote" timeout="40s" + requires="quorum"/> + <op id="stateful1-start" interval="0" name="start" timeout="40s" + requires="fencing"/> + <!-- demote != promote --> + <op id="stateful1-demote" interval="0" name="demote" timeout="40s"> + <meta_attributes id="stateful1-demote-meta"> + <nvpair id="stateful1-demote-requires" name="requires" value="nothing"/> + </meta_attributes> + </op> + </operations> + </primitive> + </clone> + + <!-- potential clash between multiple + op[@name = 'start' + or + @name = 'promote']/meta_attributes/nvpair[@name = 'requires'] + (would-eliminate-override-meta-attribute is missing, + allowing for direct clash in the propagation logic) --> + <clone id="master2"> + <meta_attributes id="master2-meta"> + <nvpair id="master2-promotable" name="promotable" value="true"/> + <nvpair id="master2-promoted-node-max" name="promoted-node-max" value="1"/> + <nvpair id="master2-clone-max" name="clone-max" value="3"/> + <nvpair id="master2-promoted-max" name="promoted-max" value="1"/> + <nvpair id="master2-clone-node-max" name="clone-node-max" value="1"/> + </meta_attributes> + <primitive id="stateful2" class="ocf" type="Stateful" provider="pacemaker"> + <operations> + <op id="stateful2-monitor-15s" interval="15s" name="monitor" timeout="60s"/> + <op id="stateful2-monitor-16s" interval="16s" name="monitor" timeout="60s" role="Master"/> + <op id="stateful2-promote" interval="0" name="promote" timeout="40s"> + <meta_attributes id="stateful2-promote-meta1"> + <nvpair id="stateful2-promote-requires1-1" name="requires" value="quorum"/> + <nvpair id="stateful2-promote-requires1-2" name="requires" value="nothing"/> + </meta_attributes> + <meta_attributes id="stateful2-promote-meta2"> + <nvpair id="stateful2-promote-requires2-1" name="requires" value="unfencing"/> + </meta_attributes> + </op> + <op id="stateful2-start" interval="0" name="start" timeout="40s"> + <meta_attributes id="stateful2-promote-meta3"> + <nvpair id="stateful2-promote-requires3-1" name="requires" value="fencing"/> + </meta_attributes> + </op> + <!-- demote != promote --> + <op id="stateful2-demote" interval="0" name="demote" timeout="40s"> + <meta_attributes id="stateful2-promote-meta"> + <nvpair id="stateful2-promote-requires" name="requires" value="nothing"/> + </meta_attributes> + </op> + </operations> + </primitive> + </clone> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/030-clu-props-plain-rename.ref b/xml/test-2/030-clu-props-plain-rename.ref new file mode 100644 index 0000000..2f446c3 --- /dev/null +++ b/xml/test-2/030-clu-props-plain-rename.ref @@ -0,0 +1,25 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-cluster_recheck_interval" name="cluster-recheck-interval" value="10min"/> + <nvpair id="cluster-opts-dc_deadtime" name="dc-deadtime" value="15s"/> + <nvpair id="cluster-opts-election_timeout" name="election-timeout" value="90s"/> + <nvpair id="cluster-opts-no_quorum_policy" name="no-quorum-policy" value="freeze"/> + <nvpair id="cluster-opts-remove_after_stop" name="remove-after-stop" value="false"/> + <nvpair id="cluster-opts-shutdown_escalation" name="shutdown-escalation" value="15min"/> + <nvpair id="cluster-opts-startup_fencing" name="startup-fencing" value="true"/> + <nvpair id="cluster-opts-stonith_action" name="stonith-action" value="off"/> + <nvpair id="cluster-opts-stonith_enabled" name="stonith-enabled" value="off"/> + <nvpair id="cluster-opts-stop_orphan_actions" name="stop-orphan-actions" value="true"/> + <nvpair id="cluster-opts-stop_orphan_resources" name="stop-orphan-resources" value="true"/> + <nvpair id="cluster-opts-symmetric_cluster" name="symmetric-cluster" value="true"/> + <nvpair id="cluster-opts-transition_idle_timeout" name="cluster-delay" value="50s"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/030-clu-props-plain-rename.ref.err b/xml/test-2/030-clu-props-plain-rename.ref.err new file mode 100644 index 0000000..878c504 --- /dev/null +++ b/xml/test-2/030-clu-props-plain-rename.ref.err @@ -0,0 +1,13 @@ +DEBUG: Cluster properties: cluster-opts-cluster_recheck_interval: renaming cluster_recheck_interval as cluster-recheck-interval +DEBUG: Cluster properties: cluster-opts-dc_deadtime: renaming dc_deadtime as dc-deadtime +DEBUG: Cluster properties: cluster-opts-election_timeout: renaming election_timeout as election-timeout +DEBUG: Cluster properties: cluster-opts-no_quorum_policy: renaming no_quorum_policy as no-quorum-policy +DEBUG: Cluster properties: cluster-opts-remove_after_stop: renaming remove_after_stop as remove-after-stop +DEBUG: Cluster properties: cluster-opts-shutdown_escalation: renaming shutdown_escalation as shutdown-escalation +DEBUG: Cluster properties: cluster-opts-startup_fencing: renaming startup_fencing as startup-fencing +DEBUG: Cluster properties: cluster-opts-stonith_action: renaming stonith_action as stonith-action +DEBUG: Cluster properties: cluster-opts-stonith_enabled: renaming stonith_enabled as stonith-enabled +DEBUG: Cluster properties: cluster-opts-stop_orphan_actions: renaming stop_orphan_actions as stop-orphan-actions +DEBUG: Cluster properties: cluster-opts-stop_orphan_resources: renaming stop_orphan_resources as stop-orphan-resources +DEBUG: Cluster properties: cluster-opts-symmetric_cluster: renaming symmetric_cluster as symmetric-cluster +DEBUG: Cluster properties: cluster-opts-transition_idle_timeout: renaming transition_idle_timeout as cluster-delay diff --git a/xml/test-2/030-clu-props-plain-rename.xml b/xml/test-2/030-clu-props-plain-rename.xml new file mode 100644 index 0000000..f7a0a52 --- /dev/null +++ b/xml/test-2/030-clu-props-plain-rename.xml @@ -0,0 +1,26 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-cluster_recheck_interval" name="cluster_recheck_interval" value="10min"/> + <nvpair id="cluster-opts-dc_deadtime" name="dc_deadtime" value="15s"/> + <nvpair id="cluster-opts-election_timeout" name="election_timeout" value="90s"/> + <nvpair id="cluster-opts-no_quorum_policy" name="no_quorum_policy" value="freeze"/> + <nvpair id="cluster-opts-remove_after_stop" name="remove_after_stop" value="false"/> + <nvpair id="cluster-opts-shutdown_escalation" name="shutdown_escalation" value="15min"/> + <nvpair id="cluster-opts-startup_fencing" name="startup_fencing" value="true"/> + <nvpair id="cluster-opts-stonith_action" name="stonith_action" value="off"/> + <nvpair id="cluster-opts-stonith_enabled" name="stonith_enabled" value="off"/> + <nvpair id="cluster-opts-stop_orphan_actions" name="stop_orphan_actions" value="true"/> + <nvpair id="cluster-opts-stop_orphan_resources" name="stop_orphan_resources" value="true"/> + <nvpair id="cluster-opts-symmetric_cluster" name="symmetric_cluster" value="true"/> + <nvpair id="cluster-opts-transition_idle_timeout" name="transition_idle_timeout" value="50s"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/031-clu-props-drop.ref b/xml/test-2/031-clu-props-drop.ref new file mode 100644 index 0000000..03e5618 --- /dev/null +++ b/xml/test-2/031-clu-props-drop.ref @@ -0,0 +1,14 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + + <cluster_property_set id="cluster-opts-2"> + <nvpair id="cluster-opts-cluster-infrastructure-2" name="cluster-infrastructure" value="corosync"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/031-clu-props-drop.ref.err b/xml/test-2/031-clu-props-drop.ref.err new file mode 100644 index 0000000..b26de82 --- /dev/null +++ b/xml/test-2/031-clu-props-drop.ref.err @@ -0,0 +1,10 @@ +INFO: Cluster properties: cluster-opts-cluster-infrastructure: dropping cluster-infrastructure for matching heartbeat|openais|classic openais|classic openais (with plugin)|cman +INFO: Cluster properties: ... corosync (2+) infrastructure can be used instead, though the value is not of significance +INFO: Cluster properties: cluster-opts-default-migration-threshold: dropping default-migration-threshold +INFO: Cluster properties: ... migration-threshold in rsc_defaults can be configured instead +INFO: Cluster properties: cluster-opts-default_migration_threshold: dropping default_migration_threshold +INFO: Cluster properties: ... migration-threshold in rsc_defaults can be configured instead +INFO: Cluster properties: cluster-opts-expected-quorum-votes: dropping expected-quorum-votes +INFO: Cluster properties: ... corosync (2+) infrastructure tracks quorum on its own +INFO: Cluster properties: cluster-opts-notification-agent: dropping notification-agent +INFO: Cluster properties: ... standalone alerts can be configured instead diff --git a/xml/test-2/031-clu-props-drop.xml b/xml/test-2/031-clu-props-drop.xml new file mode 100644 index 0000000..663569c --- /dev/null +++ b/xml/test-2/031-clu-props-drop.xml @@ -0,0 +1,21 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-cluster-infrastructure" name="cluster-infrastructure" value="heartbeat"/> + <nvpair id="cluster-opts-default-migration-threshold" name="default-migration-threshold" value="10"/> + <nvpair id="cluster-opts-default_migration_threshold" name="default_migration_threshold" value="10"/> + <nvpair id="cluster-opts-expected-quorum-votes" name="expected-quorum-votes" value="3"/> + <nvpair id="cluster-opts-notification-agent" name="notification-agent" value="/etc/pacemaker/notif.sh"/> + </cluster_property_set> + <cluster_property_set id="cluster-opts-2"> + <nvpair id="cluster-opts-cluster-infrastructure-2" name="cluster-infrastructure" value="corosync"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/032-clu-props-move.ref b/xml/test-2/032-clu-props-move.ref new file mode 100644 index 0000000..3477ab7 --- /dev/null +++ b/xml/test-2/032-clu-props-move.ref @@ -0,0 +1,18 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + + </crm_config> + <nodes/> + <resources/> + <constraints/> + <op_defaults><meta_attributes id="_2TO3_-op-defaults"> + <nvpair id="cluster-opts-default-action-timeout" name="timeout" value="30s"/> + </meta_attributes> + </op_defaults><rsc_defaults><meta_attributes id="_2TO3_-rsc-defaults"> + <nvpair id="cluster-opts-default-resource-stickiness" name="resource-stickiness" value="100"/> + <nvpair id="cluster-opts-is-managed-default" name="is-managed" value="true"/> + </meta_attributes> + </rsc_defaults></configuration> + <status/> +</cib> diff --git a/xml/test-2/032-clu-props-move.ref.err b/xml/test-2/032-clu-props-move.ref.err new file mode 100644 index 0000000..ed5d3d3 --- /dev/null +++ b/xml/test-2/032-clu-props-move.ref.err @@ -0,0 +1,3 @@ +DEBUG: Cluster properties: cluster-opts-default-action-timeout: moving default-action-timeout under op_defaults as timeout unless already defined there +DEBUG: Cluster properties: cluster-opts-default-resource-stickiness: moving default-resource-stickiness under rsc_defaults as resource-stickiness unless already defined there +DEBUG: Cluster properties: cluster-opts-is-managed-default: moving is-managed-default under rsc_defaults as is-managed unless already defined there diff --git a/xml/test-2/032-clu-props-move.xml b/xml/test-2/032-clu-props-move.xml new file mode 100644 index 0000000..1f34d7b --- /dev/null +++ b/xml/test-2/032-clu-props-move.xml @@ -0,0 +1,16 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-default-action-timeout" name="default-action-timeout" value="30s"/> + <nvpair id="cluster-opts-default-resource-stickiness" name="default-resource-stickiness" value="100"/> + <nvpair id="cluster-opts-is-managed-default" name="is-managed-default" value="true"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/033-clu-props-move-merge.ref b/xml/test-2/033-clu-props-move-merge.ref new file mode 100644 index 0000000..f8e5a9f --- /dev/null +++ b/xml/test-2/033-clu-props-move-merge.ref @@ -0,0 +1,21 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + + </crm_config> + <rsc_defaults> + <meta_attributes id="rsc-defaults"> + <nvpair id="rsc-defaults-is-managed" name="is-managed" value="false"/> + + <nvpair id="cluster-opts-default-resource-stickiness" name="resource-stickiness" value="100"/> + </meta_attributes> + </rsc_defaults> + <nodes/> + <resources/> + <constraints/> + <op_defaults><meta_attributes id="_2TO3_-op-defaults"> + <nvpair id="cluster-opts-default-action-timeout" name="timeout" value="30s"/> + </meta_attributes> + </op_defaults></configuration> + <status/> +</cib> diff --git a/xml/test-2/033-clu-props-move-merge.ref.err b/xml/test-2/033-clu-props-move-merge.ref.err new file mode 100644 index 0000000..ed5d3d3 --- /dev/null +++ b/xml/test-2/033-clu-props-move-merge.ref.err @@ -0,0 +1,3 @@ +DEBUG: Cluster properties: cluster-opts-default-action-timeout: moving default-action-timeout under op_defaults as timeout unless already defined there +DEBUG: Cluster properties: cluster-opts-default-resource-stickiness: moving default-resource-stickiness under rsc_defaults as resource-stickiness unless already defined there +DEBUG: Cluster properties: cluster-opts-is-managed-default: moving is-managed-default under rsc_defaults as is-managed unless already defined there diff --git a/xml/test-2/033-clu-props-move-merge.xml b/xml/test-2/033-clu-props-move-merge.xml new file mode 100644 index 0000000..c34085b --- /dev/null +++ b/xml/test-2/033-clu-props-move-merge.xml @@ -0,0 +1,21 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-default-action-timeout" name="default-action-timeout" value="30s"/> + <nvpair id="cluster-opts-default-resource-stickiness" name="default-resource-stickiness" value="100"/> + <nvpair id="cluster-opts-is-managed-default" name="is-managed-default" value="true"/> + </cluster_property_set> + </crm_config> + <rsc_defaults> + <meta_attributes id="rsc-defaults"> + <nvpair id="rsc-defaults-is-managed" name="is-managed" value="false"/> + </meta_attributes> + </rsc_defaults> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/034-clu-props-move-redef.ref b/xml/test-2/034-clu-props-move-redef.ref new file mode 100644 index 0000000..88fb44c --- /dev/null +++ b/xml/test-2/034-clu-props-move-redef.ref @@ -0,0 +1,14 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + + </crm_config> + <nodes/> + <resources/> + <constraints/> + <rsc_defaults><meta_attributes id="_2TO3_-rsc-defaults"> + <nvpair id="cluster-opts-default-resource-failure-stickiness" name="migration-threshold" value="1"/> + </meta_attributes> + </rsc_defaults></configuration> + <status/> +</cib> diff --git a/xml/test-2/034-clu-props-move-redef.ref.err b/xml/test-2/034-clu-props-move-redef.ref.err new file mode 100644 index 0000000..f8c148f --- /dev/null +++ b/xml/test-2/034-clu-props-move-redef.ref.err @@ -0,0 +1,3 @@ +DEBUG: Cluster properties: cluster-opts-default-resource-failure-stickiness: moving default-resource-failure-stickiness under rsc_defaults as migration-threshold unless already defined there, redefined as 1, for matching -INFINITY +INFO: Cluster properties: cluster-opts-default_resource_failure_stickiness: dropping default_resource_failure_stickiness +INFO: Cluster properties: ... migration-threshold in rsc_defaults can be configured instead diff --git a/xml/test-2/034-clu-props-move-redef.xml b/xml/test-2/034-clu-props-move-redef.xml new file mode 100644 index 0000000..fcadf20 --- /dev/null +++ b/xml/test-2/034-clu-props-move-redef.xml @@ -0,0 +1,15 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config> + <cluster_property_set id="cluster-opts"> + <nvpair id="cluster-opts-default-resource-failure-stickiness" name="default-resource-failure-stickiness" value="-INFINITY"/> + <nvpair id="cluster-opts-default_resource_failure_stickiness" name="default_resource_failure_stickiness" value="0"/> + </cluster_property_set> + </crm_config> + <nodes/> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/040-nodes-rename-type.ref b/xml/test-2/040-nodes-rename-type.ref new file mode 100644 index 0000000..58d58d8 --- /dev/null +++ b/xml/test-2/040-nodes-rename-type.ref @@ -0,0 +1,15 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063" type="member"/> + <node id="virt-064" uname="virt-064" type="member"/> + <node id="virt-069" uname="virt-069" type="member"/> + + </nodes> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/040-nodes-rename-type.ref.err b/xml/test-2/040-nodes-rename-type.ref.err new file mode 100644 index 0000000..ce68fa4 --- /dev/null +++ b/xml/test-2/040-nodes-rename-type.ref.err @@ -0,0 +1,2 @@ +DEBUG: Cluster node: virt-063 (id=virt-063): keeping type as type, redefined as member, for matching normal +DEBUG: Cluster node: virt-064 (id=virt-064): keeping type as type, redefined as member, for matching normal diff --git a/xml/test-2/040-nodes-rename-type.xml b/xml/test-2/040-nodes-rename-type.xml new file mode 100644 index 0000000..939b768 --- /dev/null +++ b/xml/test-2/040-nodes-rename-type.xml @@ -0,0 +1,16 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063" type="normal"/> + <node id="virt-064" uname="virt-064" type="normal"/> + <node id="virt-069" uname="virt-069" type="member"/> + + </nodes> + <resources/> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/050-rsc-attrs-instance-plain-rename.ref b/xml/test-2/050-rsc-attrs-instance-plain-rename.ref new file mode 100644 index 0000000..1fd7c44 --- /dev/null +++ b/xml/test-2/050-rsc-attrs-instance-plain-rename.ref @@ -0,0 +1,24 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes/> + <resources> + + <primitive class="stonith" id="fence-vbox" type="fence_vbox"> + <instance_attributes id="fence-vbox-params"> + <nvpair id="fence-vbox-params-ipaddr" name="ipaddr" value="192.0.3.10"/> + <nvpair id="fence-vbox-params-login" name="login" value="vboxadmin"/> + <nvpair id="fence-vbox-params-passwd_script" name="passwd_script" value="/usr/local/cluster/vboxpass.sh"/> + <nvpair id="fence-vbox-params-plug" name="plug" value="vboxhost"/> + <nvpair id="fence-vbox-pcmk_monitor_cmd" name="pcmk_monitor_action" value="metadata"/> + </instance_attributes> + <operations> + <op id="fence-vbox-monitor" interval="60s" name="monitor"/> + </operations> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/050-rsc-attrs-instance-plain-rename.ref.err b/xml/test-2/050-rsc-attrs-instance-plain-rename.ref.err new file mode 100644 index 0000000..a3129e5 --- /dev/null +++ b/xml/test-2/050-rsc-attrs-instance-plain-rename.ref.err @@ -0,0 +1 @@ +DEBUG: Resource instance_attributes: fence-vbox-pcmk_monitor_cmd: renaming pcmk_monitor_cmd as pcmk_monitor_action diff --git a/xml/test-2/050-rsc-attrs-instance-plain-rename.xml b/xml/test-2/050-rsc-attrs-instance-plain-rename.xml new file mode 100644 index 0000000..ccf2404 --- /dev/null +++ b/xml/test-2/050-rsc-attrs-instance-plain-rename.xml @@ -0,0 +1,25 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes/> + <resources> + + <primitive class="stonith" id="fence-vbox" type="fence_vbox"> + <instance_attributes id="fence-vbox-params"> + <nvpair id="fence-vbox-params-ipaddr" name="ipaddr" value="192.0.3.10"/> + <nvpair id="fence-vbox-params-login" name="login" value="vboxadmin"/> + <nvpair id="fence-vbox-params-passwd_script" name="passwd_script" value="/usr/local/cluster/vboxpass.sh"/> + <nvpair id="fence-vbox-params-plug" name="plug" value="vboxhost"/> + <nvpair id="fence-vbox-pcmk_monitor_cmd" name="pcmk_monitor_cmd" value="metadata"/> + </instance_attributes> + <operations> + <op id="fence-vbox-monitor" interval="60s" name="monitor"/> + </operations> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/051-rsc-attrs-instance-pcmk_arg_map.ref b/xml/test-2/051-rsc-attrs-instance-pcmk_arg_map.ref new file mode 100644 index 0000000..8aa8047 --- /dev/null +++ b/xml/test-2/051-rsc-attrs-instance-pcmk_arg_map.ref @@ -0,0 +1,48 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes/> + <resources> + + <primitive class="stonith" id="fence-vbox1" type="fence_vbox"> + <instance_attributes id="fence-vbox1-params"> + <nvpair id="fence-vbox1-params-ipaddr" name="ipaddr" value="192.0.3.10"/> + <nvpair id="fence-vbox1-params-login" name="login" value="vboxadmin"/> + <nvpair id="fence-vbox1-params-passwd_script" name="passwd_script" value="/usr/local/cluster/vboxpass.sh"/> + <nvpair id="fence-vbox1-params-plug" name="plug" value="vboxhost"/> + <nvpair id="fence-vbox1-pcmk_arg_map" name="pcmk_host_argument" value="port"/> + </instance_attributes> + <operations> + <op id="fence-vbox1-monitor" interval="60s" name="monitor"/> + </operations> + </primitive> + + <primitive class="stonith" id="fence-vbox2" type="fence_vbox"> + <instance_attributes id="fence-vbox2-params"> + <nvpair id="fence-vbox2-params-ipaddr" name="ipaddr" value="192.0.3.10"/> + <nvpair id="fence-vbox2-params-login" name="login" value="vboxadmin"/> + <nvpair id="fence-vbox2-params-passwd_script" name="passwd_script" value="/usr/local/cluster/vboxpass.sh"/> + <nvpair id="fence-vbox2-params-plug" name="plug" value="vboxhost"/> + </instance_attributes> + <operations> + <op id="fence-vbox2-monitor" interval="60s" name="monitor"/> + </operations> + </primitive> + + <primitive class="stonith" id="fence-vbox3" type="fence_vbox"> + <instance_attributes id="fence-vbox3-params"> + <nvpair id="fence-vbox3-params-ipaddr" name="ipaddr" value="192.0.3.10"/> + <nvpair id="fence-vbox3-params-login" name="login" value="vboxadmin"/> + <nvpair id="fence-vbox3-params-passwd_script" name="passwd_script" value="/usr/local/cluster/vboxpass.sh"/> + <nvpair id="fence-vbox3-params-plug" name="plug" value="vboxhost"/> + </instance_attributes> + <operations> + <op id="fence-vbox3-monitor" interval="60s" name="monitor"/> + </operations> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/051-rsc-attrs-instance-pcmk_arg_map.ref.err b/xml/test-2/051-rsc-attrs-instance-pcmk_arg_map.ref.err new file mode 100644 index 0000000..a0149c1 --- /dev/null +++ b/xml/test-2/051-rsc-attrs-instance-pcmk_arg_map.ref.err @@ -0,0 +1,3 @@ +DEBUG: Resource instance_attributes: fence-vbox1-pcmk_arg_map: renaming pcmk_arg_map as pcmk_host_argument for matching port: prefix that will, meanwhile, get dropped +DEBUG: Resource instance_attributes: fence-vbox2-pcmk_arg_map: dropping pcmk_arg_map +DEBUG: Resource instance_attributes: fence-vbox3-pcmk_arg_map: dropping pcmk_arg_map diff --git a/xml/test-2/051-rsc-attrs-instance-pcmk_arg_map.xml b/xml/test-2/051-rsc-attrs-instance-pcmk_arg_map.xml new file mode 100644 index 0000000..75ad2a7 --- /dev/null +++ b/xml/test-2/051-rsc-attrs-instance-pcmk_arg_map.xml @@ -0,0 +1,51 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes/> + <resources> + + <primitive class="stonith" id="fence-vbox1" type="fence_vbox"> + <instance_attributes id="fence-vbox1-params"> + <nvpair id="fence-vbox1-params-ipaddr" name="ipaddr" value="192.0.3.10"/> + <nvpair id="fence-vbox1-params-login" name="login" value="vboxadmin"/> + <nvpair id="fence-vbox1-params-passwd_script" name="passwd_script" value="/usr/local/cluster/vboxpass.sh"/> + <nvpair id="fence-vbox1-params-plug" name="plug" value="vboxhost"/> + <nvpair id="fence-vbox1-pcmk_arg_map" name="pcmk_arg_map" value="port:port"/> + </instance_attributes> + <operations> + <op id="fence-vbox1-monitor" interval="60s" name="monitor"/> + </operations> + </primitive> + + <primitive class="stonith" id="fence-vbox2" type="fence_vbox"> + <instance_attributes id="fence-vbox2-params"> + <nvpair id="fence-vbox2-params-ipaddr" name="ipaddr" value="192.0.3.10"/> + <nvpair id="fence-vbox2-params-login" name="login" value="vboxadmin"/> + <nvpair id="fence-vbox2-params-passwd_script" name="passwd_script" value="/usr/local/cluster/vboxpass.sh"/> + <nvpair id="fence-vbox2-params-plug" name="plug" value="vboxhost"/> + <nvpair id="fence-vbox2-pcmk_arg_map" name="pcmk_arg_map" value="dropme:sure,port:port"/> + </instance_attributes> + <operations> + <op id="fence-vbox2-monitor" interval="60s" name="monitor"/> + </operations> + </primitive> + + <primitive class="stonith" id="fence-vbox3" type="fence_vbox"> + <instance_attributes id="fence-vbox3-params"> + <nvpair id="fence-vbox3-params-ipaddr" name="ipaddr" value="192.0.3.10"/> + <nvpair id="fence-vbox3-params-login" name="login" value="vboxadmin"/> + <nvpair id="fence-vbox3-params-passwd_script" name="passwd_script" value="/usr/local/cluster/vboxpass.sh"/> + <nvpair id="fence-vbox3-params-plug" name="plug" value="vboxhost"/> + <nvpair id="fence-vbox3-pcmk_arg_map" name="pcmk_arg_map" value="port:port,dropme:justhope"/> + </instance_attributes> + <operations> + <op id="fence-vbox3-monitor" interval="60s" name="monitor"/> + </operations> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/060-rsc-attrs-meta-isolation.ref b/xml/test-2/060-rsc-attrs-meta-isolation.ref new file mode 100644 index 0000000..91c43c0 --- /dev/null +++ b/xml/test-2/060-rsc-attrs-meta-isolation.ref @@ -0,0 +1,25 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes/> + <resources> + + <!-- from c713bbe39:pengine/test10/isolation-restart-all.xml --> + <primitive class="ocf" id="fake" provider="heartbeat" type="Dummy"> + <instance_attributes id="fake-instance_attributes"> + <nvpair id="fake-instance_attributes-docker_image" name="pcmk_docker_image" value="centos:dock-wrapper-test"/> + <nvpair id="fake-instance_attributes-docker_privileged" name="pcmk_docker_privileged" value="false"/> + </instance_attributes> + <operations> + <op id="fake-monitor-interval-60s" interval="60s" name="monitor"/> + </operations> + <meta_attributes id="fake-meta_attributes"> + <nvpair id="fake-meta_attributes-isolation-wrapper" name="target-role" value="Stopped"/> + </meta_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/060-rsc-attrs-meta-isolation.ref.err b/xml/test-2/060-rsc-attrs-meta-isolation.ref.err new file mode 100644 index 0000000..fb40cc4 --- /dev/null +++ b/xml/test-2/060-rsc-attrs-meta-isolation.ref.err @@ -0,0 +1,4 @@ +WARNING: Resource meta_attributes: fake (meta=fake-meta_attributes): renaming isolation-wrapper as target-role, redefined as Stopped +WARNING: Resource meta_attributes: ... i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources +WARNING: Resource meta_attributes: fake (meta=fake-meta_attributes): renaming isolation-wrapper as target-role, redefined as Stopped +WARNING: Resource meta_attributes: ... i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources diff --git a/xml/test-2/060-rsc-attrs-meta-isolation.xml b/xml/test-2/060-rsc-attrs-meta-isolation.xml new file mode 100644 index 0000000..9c7dcb9 --- /dev/null +++ b/xml/test-2/060-rsc-attrs-meta-isolation.xml @@ -0,0 +1,27 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes/> + <resources> + + <!-- from c713bbe39:pengine/test10/isolation-restart-all.xml --> + <primitive class="ocf" id="fake" provider="heartbeat" type="Dummy"> + <instance_attributes id="fake-instance_attributes"> + <nvpair id="fake-instance_attributes-docker_image" name="pcmk_docker_image" value="centos:dock-wrapper-test"/> + <nvpair id="fake-instance_attributes-docker_privileged" name="pcmk_docker_privileged" value="false"/> + </instance_attributes> + <operations> + <op id="fake-monitor-interval-60s" interval="60s" name="monitor"/> + </operations> + <meta_attributes id="fake-meta_attributes"> + <nvpair id="fake-meta_attributes-isolation-wrapper" name="isolation-wrapper" value="docker-wrapper"/> + <nvpair id="fake-meta_attributes-isolation-wrapper2" name="isolation-wrapper" value="docker-wrapper"/> + </meta_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/061-rsc-attrs-meta-exchange.ref b/xml/test-2/061-rsc-attrs-meta-exchange.ref new file mode 100644 index 0000000..8148d76 --- /dev/null +++ b/xml/test-2/061-rsc-attrs-meta-exchange.ref @@ -0,0 +1,27 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes/> + <resources> + + <primitive class="ocf" id="res1" provider="heartbeat" type="Dummy"> + <operations> + <op id="res1-monitor-interval-60s" interval="60s" name="monitor"/> + </operations> + <meta_attributes id="res1-meta_attributes"> + <nvpair id="res1-resource-failure-stickiness" name="migration-threshold" value="1"/> + </meta_attributes> + </primitive> + + <primitive class="ocf" id="res2" provider="heartbeat" type="Dummy"> + <operations> + <op id="res2-monitor-interval-60s" interval="60s" name="monitor"/> + </operations> + + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/061-rsc-attrs-meta-exchange.ref.err b/xml/test-2/061-rsc-attrs-meta-exchange.ref.err new file mode 100644 index 0000000..2938b77 --- /dev/null +++ b/xml/test-2/061-rsc-attrs-meta-exchange.ref.err @@ -0,0 +1,3 @@ +DEBUG: Resource meta_attributes: res1 (meta=res1-meta_attributes): renaming resource-failure-stickiness as migration-threshold, redefined as 1, for matching -INFINITY +INFO: Resource meta_attributes: res2 (meta=res2-meta_attributes): dropping resource-failure-stickiness +INFO: Resource meta_attributes: ... migration-threshold can be configured instead diff --git a/xml/test-2/061-rsc-attrs-meta-exchange.xml b/xml/test-2/061-rsc-attrs-meta-exchange.xml new file mode 100644 index 0000000..cb0c0eb --- /dev/null +++ b/xml/test-2/061-rsc-attrs-meta-exchange.xml @@ -0,0 +1,30 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes/> + <resources> + + <primitive class="ocf" id="res1" provider="heartbeat" type="Dummy"> + <operations> + <op id="res1-monitor-interval-60s" interval="60s" name="monitor"/> + </operations> + <meta_attributes id="res1-meta_attributes"> + <nvpair id="res1-resource-failure-stickiness" name="resource-failure-stickiness" value="-INFINITY"/> + </meta_attributes> + </primitive> + + <primitive class="ocf" id="res2" provider="heartbeat" type="Dummy"> + <operations> + <op id="res2-monitor-interval-60s" interval="60s" name="monitor"/> + </operations> + <meta_attributes id="res2-meta_attributes"> + <nvpair id="res2-resource-failure-stickiness" name="resource-failure-stickiness" value="0"/> + </meta_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/070-rsc-op-attrs-inst-requires-start.ref b/xml/test-2/070-rsc-op-attrs-inst-requires-start.ref new file mode 100644 index 0000000..20aba39 --- /dev/null +++ b/xml/test-2/070-rsc-op-attrs-inst-requires-start.ref @@ -0,0 +1,48 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- borrowed from 021-rsc-requires-nvpair --> + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <meta_attributes id="_2TO3_myAddr-start-instanceparams"> + <!-- relying on order (+ colocation) to guarantee "requires" + transitively (unfencing/fencing/quorum)? --> + + <nvpair id="myAddr-start-requires" name="requires" value="nothing"/> + </meta_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/070-rsc-op-attrs-inst-requires-start.ref.err b/xml/test-2/070-rsc-op-attrs-inst-requires-start.ref.err new file mode 100644 index 0000000..6f707bb --- /dev/null +++ b/xml/test-2/070-rsc-op-attrs-inst-requires-start.ref.err @@ -0,0 +1 @@ +DEBUG: Resources-operation instance_attributes: myAddr-start (rsc=myAddr, meta=myAddr-start-instanceparams): moving requires under per-resource-meta_attributes as requires unless already defined there for matching start|promote diff --git a/xml/test-2/070-rsc-op-attrs-inst-requires-start.xml b/xml/test-2/070-rsc-op-attrs-inst-requires-start.xml new file mode 100644 index 0000000..2661f7d --- /dev/null +++ b/xml/test-2/070-rsc-op-attrs-inst-requires-start.xml @@ -0,0 +1,49 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- borrowed from 021-rsc-requires-nvpair --> + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"> + <instance_attributes id="myAddr-start-instanceparams"> + <!-- relying on order (+ colocation) to guarantee "requires" + transitively (unfencing/fencing/quorum)? --> + <nvpair id="myAddr-start-requires" name="requires" value="nothing"/> + </instance_attributes> + </op> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/071-rsc-op-attrs-inst-requires-nonstart.ref b/xml/test-2/071-rsc-op-attrs-inst-requires-nonstart.ref new file mode 100644 index 0000000..3dd5168 --- /dev/null +++ b/xml/test-2/071-rsc-op-attrs-inst-requires-nonstart.ref @@ -0,0 +1,42 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- borrowed from 021-rsc-requires-nvpair --> + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-stop" name="stop" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/071-rsc-op-attrs-inst-requires-nonstart.ref.err b/xml/test-2/071-rsc-op-attrs-inst-requires-nonstart.ref.err new file mode 100644 index 0000000..6b6f8f7 --- /dev/null +++ b/xml/test-2/071-rsc-op-attrs-inst-requires-nonstart.ref.err @@ -0,0 +1,2 @@ +INFO: Resources-operation instance_attributes: myAddr-stop (rsc=myAddr, meta=myAddr-stop-instanceparams): dropping requires +INFO: Resources-operation instance_attributes: ... only start/promote operation taken into account diff --git a/xml/test-2/071-rsc-op-attrs-inst-requires-nonstart.xml b/xml/test-2/071-rsc-op-attrs-inst-requires-nonstart.xml new file mode 100644 index 0000000..4f364f4 --- /dev/null +++ b/xml/test-2/071-rsc-op-attrs-inst-requires-nonstart.xml @@ -0,0 +1,49 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- borrowed from 021-rsc-requires-nvpair --> + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-stop" name="stop" interval="0" timeout="40s"> + <instance_attributes id="myAddr-stop-instanceparams"> + <!-- relying on order (+ colocation) to guarantee "requires" + transitively (unfencing/fencing/quorum)? --> + <nvpair id="myAddr-stop-requires" name="requires" value="nothing"/> + </instance_attributes> + </op> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"/> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints> + + <rsc_order id="order-addr-httpd" first="myAddr" then="myHttpd"/> + <rsc_colocation id="colocation-addr-httpd" rsc="myHttpd" with-rsc="myAddr" score="INFINITY"/> + + </constraints> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/072-rsc-op-attrs-inst-requires-no-override.ref b/xml/test-2/072-rsc-op-attrs-inst-requires-no-override.ref new file mode 100644 index 0000000..c63230c --- /dev/null +++ b/xml/test-2/072-rsc-op-attrs-inst-requires-no-override.ref @@ -0,0 +1,54 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- possible override from op's instance attribute over + op attribute --> + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"/> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + <meta_attributes id="_2TO3_myAddr-meta"><nvpair id="_2TO3_myAddr-start-meta-requires" name="requires" value="nothing"/> + </meta_attributes> + </primitive> + + <!-- possible override from op's instance attribute over + op's meta-attribute --> + <clone id="master"> + <meta_attributes id="master-meta"> + <nvpair id="master-promotable" name="promotable" value="true"/> + <nvpair id="master-promoted-node-max" name="promoted-node-max" value="1"/> + <nvpair id="master-clone-max" name="clone-max" value="3"/> + <nvpair id="master-promoted-max" name="promoted-max" value="1"/> + <nvpair id="master-clone-node-max" name="clone-node-max" value="1"/> + </meta_attributes> + <primitive id="stateful" class="ocf" type="Stateful" provider="pacemaker"> + <operations> + <op id="stateful-monitor-15s" interval="15s" name="monitor" timeout="60s"/> + <op id="stateful-monitor-16s" interval="16s" name="monitor" timeout="60s" role="Master"/> + <op id="stateful-promote" interval="0" name="promote" timeout="40s"/> + </operations> + <meta_attributes id="_2TO3_stateful-promote-meta"> + + <nvpair id="stateful-promote-meta-requires" name="requires" value="nothing"/> + </meta_attributes> + </primitive> + </clone> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/072-rsc-op-attrs-inst-requires-no-override.ref.err b/xml/test-2/072-rsc-op-attrs-inst-requires-no-override.ref.err new file mode 100644 index 0000000..cc5dd7d --- /dev/null +++ b/xml/test-2/072-rsc-op-attrs-inst-requires-no-override.ref.err @@ -0,0 +1,4 @@ +DEBUG: Resources-operation instance_attributes: myAddr-start (rsc=myAddr, meta=myAddr-start-instance): moving requires under per-resource-meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: myAddr-start (rsc=myAddr): moving requires under meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation instance_attributes: stateful-promote (rsc=stateful, meta=stateful-promote-instance): moving requires under per-resource-meta_attributes as requires unless already defined there for matching start|promote +DEBUG: Resources-operation: stateful-promote (rsc=stateful, meta=stateful-promote-meta): moving requires under meta_attributes as requires unless already defined there for matching start|promote diff --git a/xml/test-2/072-rsc-op-attrs-inst-requires-no-override.xml b/xml/test-2/072-rsc-op-attrs-inst-requires-no-override.xml new file mode 100644 index 0000000..8af4bf1 --- /dev/null +++ b/xml/test-2/072-rsc-op-attrs-inst-requires-no-override.xml @@ -0,0 +1,61 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <!-- possible override from op's instance attribute over + op attribute --> + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s" + requires="nothing"> + <instance_attributes id="myAddr-start-instance"> + <nvpair id="myAddr-start-instance-requires" name="requires" value="quorum"/> + </instance_attributes> + </op> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <!-- possible override from op's instance attribute over + op's meta-attribute --> + <clone id="master"> + <meta_attributes id="master-meta"> + <nvpair id="master-promotable" name="promotable" value="true"/> + <nvpair id="master-promoted-node-max" name="promoted-node-max" value="1"/> + <nvpair id="master-clone-max" name="clone-max" value="3"/> + <nvpair id="master-promoted-max" name="promoted-max" value="1"/> + <nvpair id="master-clone-node-max" name="clone-node-max" value="1"/> + </meta_attributes> + <primitive id="stateful" class="ocf" type="Stateful" provider="pacemaker"> + <operations> + <op id="stateful-monitor-15s" interval="15s" name="monitor" timeout="60s"/> + <op id="stateful-monitor-16s" interval="16s" name="monitor" timeout="60s" role="Master"/> + <op id="stateful-promote" interval="0" name="promote" timeout="40s"> + <meta_attributes id="stateful-promote-meta"> + <nvpair id="stateful-promote-meta-requires" name="requires" value="nothing"/> + </meta_attributes> + <instance_attributes id="stateful-promote-instance"> + <nvpair id="stateful-promote-instance-requires" name="requires" value="quorum"/> + </instance_attributes> + </op> + </operations> + </primitive> + </clone> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/073-rsc-op-attrs-inst-meta-meaning.ref b/xml/test-2/073-rsc-op-attrs-inst-meta-meaning.ref new file mode 100644 index 0000000..28b1d17 --- /dev/null +++ b/xml/test-2/073-rsc-op-attrs-inst-meta-meaning.ref @@ -0,0 +1,51 @@ +<cib validate-with="pacemaker-3.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"> + + <meta_attributes id="_2TO3_myAddr-start-meta"> + <nvpair id="myAddr-start-instance-on-fail" name="on-fail" value="standby"/> + <nvpair id="myAddr-start-instance-record-pending" name="record-pending" value="true"/> + </meta_attributes> + </op> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"> + <instance_attributes id="myHttpd-monitor-instance"> + <nvpair id="myHttpd-monitor-instance-statusurl" name="statusurl" value="http://localhost/server-status"/> + </instance_attributes> + + <meta_attributes id="_2TO3_myHttpd-monitor-meta"> + + <nvpair id="myHttpd-monitor-instance2-timeout" name="timeout" value="30"/> + </meta_attributes> + </op> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/test-2/073-rsc-op-attrs-inst-meta-meaning.ref.err b/xml/test-2/073-rsc-op-attrs-inst-meta-meaning.ref.err new file mode 100644 index 0000000..18beb3a --- /dev/null +++ b/xml/test-2/073-rsc-op-attrs-inst-meta-meaning.ref.err @@ -0,0 +1,4 @@ +DEBUG: Resources-operation instance_attributes: myAddr-start (rsc=myAddr, meta=myAddr-start-instance): moving on-fail under meta_attributes as on-fail unless already defined there +DEBUG: Resources-operation instance_attributes: myAddr-start (rsc=myAddr, meta=myAddr-start-instance): moving record-pending under meta_attributes as record-pending unless already defined there +DEBUG: Resources-operation instance_attributes: myHttpd-monitor (rsc=myHttpd, meta=myHttpd-monitor-instance): moving timeout under meta_attributes as timeout unless already defined there +DEBUG: Resources-operation instance_attributes: myHttpd-monitor (rsc=myHttpd, meta=myHttpd-monitor-instance2): moving timeout under meta_attributes as timeout unless already defined there diff --git a/xml/test-2/073-rsc-op-attrs-inst-meta-meaning.xml b/xml/test-2/073-rsc-op-attrs-inst-meta-meaning.xml new file mode 100644 index 0000000..1a1f73f --- /dev/null +++ b/xml/test-2/073-rsc-op-attrs-inst-meta-meaning.xml @@ -0,0 +1,50 @@ +<?xml-stylesheet href="../assets/upgrade-2.10-htmldiff.xsl" type="text/xsl"?> +<cib validate-with="pacemaker-2.0" admin_epoch="0" epoch="0" num_updates="0"> + <configuration> + <crm_config/> + <nodes> + + <node id="virt-063" uname="virt-063"/> + <node id="virt-064" uname="virt-064"/> + <node id="virt-069" uname="virt-069"/> + + </nodes> + <resources> + + <primitive id="myAddr" class="ocf" provider="heartbeat" type="IPaddr2"> + <operations> + <op id="myAddr-monitor" name="monitor" interval="30s"/> + <op id="myAddr-start" name="start" interval="0" timeout="40s"> + <instance_attributes id="myAddr-start-instance"> + <nvpair id="myAddr-start-instance-on-fail" name="on-fail" value="standby"/> + <nvpair id="myAddr-start-instance-record-pending" name="record-pending" value="true"/> + </instance_attributes> + </op> + </operations> + <instance_attributes id="myAddr-params"> + <nvpair id="myAddr-ip" name="ip" value="192.0.2.10"/> + </instance_attributes> + </primitive> + + <primitive id="myHttpd" class="ocf" provider="heartbeat" type="apache"> + <operations> + <op id="myHttpd-monitor" name="monitor" interval="30s"> + <instance_attributes id="myHttpd-monitor-instance"> + <nvpair id="myHttpd-monitor-instance-timeout" name="timeout" value="20"/> + <nvpair id="myHttpd-monitor-instance-statusurl" name="statusurl" value="http://localhost/server-status"/> + </instance_attributes> + <instance_attributes id="myHttpd-monitor-instance2"> + <nvpair id="myHttpd-monitor-instance2-timeout" name="timeout" value="30"/> + </instance_attributes> + </op> + </operations> + <instance_attributes id="myHttpd-params"> + <nvpair id="myHttpd-configfile" name="configfile" value="/etc/httpd/conf/httpd.conf"/> + </instance_attributes> + </primitive> + + </resources> + <constraints/> + </configuration> + <status/> +</cib> diff --git a/xml/upgrade-1.3.xsl b/xml/upgrade-1.3.xsl new file mode 100644 index 0000000..9ea56a2 --- /dev/null +++ b/xml/upgrade-1.3.xsl @@ -0,0 +1,107 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/> + +<xsl:param name="cib-min-ver" select="'2.0'"/> + +<xsl:template match="cib"> + <xsl:copy> + <xsl:apply-templates select="@*"/> + <xsl:attribute name="validate-with"> + <xsl:value-of select="concat('pacemaker-', $cib-min-ver)"/> + </xsl:attribute> + <xsl:apply-templates select="node()"/> + </xsl:copy> +</xsl:template> + +<xsl:template match="role_ref"> + <xsl:element name="role"> + <xsl:apply-templates select="@*|node()"/> + </xsl:element> +</xsl:template> + +<xsl:template match="read|write|deny"> + <xsl:element name="acl_permission"> + + <xsl:copy-of select="@id"/> + <xsl:attribute name="kind"><xsl:value-of select="name()"/></xsl:attribute> + + <!-- previously, one could have a single element "matched" multiple times, + each time using a different attribute (or no attribute at all), which + would result, after the generalization (stripping @attribute) in + multiple possibly conflicting ACL behaviours for given element(s); + we could take this into account by, at the very least, preferring + the behavior at attribute-less specification, if any --> + <xsl:choose> + <xsl:when test="@ref"> + <xsl:attribute name="reference"><xsl:value-of select="@ref"/></xsl:attribute> + <xsl:if test="@attribute"> + <!-- alternatively, rephrase (generalized a bit) turning it to @xpath --> + <xsl:message>ACLs: @attribute cannot accompany @ref for upgrade-1.3.xsl purposes, ignoring</xsl:message> + </xsl:if> + </xsl:when> + <xsl:when test="@tag"> + <xsl:attribute name="object-type"><xsl:value-of select="@tag"/></xsl:attribute> + <xsl:if test="@attribute"> + <xsl:message>ACLs: @attribute (with @tag) handling generalized a bit for upgrade-1.3.xsl purposes</xsl:message> + <xsl:copy-of select="@attribute"/> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <!-- must have been xpath per the schema, then --> + <xsl:choose> + <xsl:when test="@attribute"> + <xsl:message>ACLs: @attribute (with @xpath) handling generalized a bit for upgrade-1.3.xsl purposes</xsl:message> + <xsl:attribute name="xpath"> + <xsl:value-of select="concat(@xpath,'[@', @attribute, ']')"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="@xpath"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + + </xsl:element> +</xsl:template> + +<xsl:template match="acl_user[role_ref]"> + <!-- schema disallows role_ref's AND deny/read/write --> + <xsl:element name="acl_target"> + <xsl:apply-templates select="@*|node()"/> + </xsl:element> +</xsl:template> + +<xsl:template match="acl_user[not(role_ref)]"> + + <xsl:element name="acl_target"> + <xsl:apply-templates select="@*"/> + + <xsl:if test="count(deny|read|write)" > + <xsl:element name="role"> + <xsl:attribute name="id"> + <xsl:value-of select="concat('auto-', @id)"/> + </xsl:attribute> + </xsl:element> + </xsl:if> + + </xsl:element> + + <xsl:if test="count(deny|read|write)" > + <xsl:element name="acl_role"> + <xsl:attribute name="id"> + <xsl:value-of select="concat('auto-', @id)"/> + </xsl:attribute> + <xsl:apply-templates select="*"/> + </xsl:element> + </xsl:if> + +</xsl:template> + +<xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/upgrade-2.10-enter.xsl b/xml/upgrade-2.10-enter.xsl new file mode 100644 index 0000000..e7eb1ba --- /dev/null +++ b/xml/upgrade-2.10-enter.xsl @@ -0,0 +1,176 @@ +<!-- + Copyright 2018 Red Hat, Inc. + Author: Jan Pokorny <jpokorny@redhat.com> + Part of pacemaker project + SPDX-License-Identifier: GPL-2.0-or-later + --> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:cibtr="http://clusterlabs.org/ns/pacemaker/cibtr-2" + exclude-result-prefixes="cibtr" + cibtr:filename="upgrade-2.10-enter.xsl"> +<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/> + + +<!-- + + GENERIC UTILITIES + + --> + +<!-- + Recursive implementation of "basename" + + Merely parameter driven, no implicit context taken into account: + - Uri: input in it's current phase of processing +--> +<xsl:template name="cibtr:WrapSpecificBasename"> + <xsl:param name="Uri"/> + <xsl:choose> + <xsl:when test="not(contains($Uri, '/'))"> + <xsl:value-of select="$Uri"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:WrapSpecificBasename"> + <xsl:with-param name="Uri" + select="substring-after($Uri, '/')"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- + Id-mangling-enriched identity template. + --> +<xsl:template name="cibtr:HelperIdentityEnter"> + <xsl:param name="TargetIdPrefix" select="''"/> + <xsl:copy> + <xsl:apply-templates select="@*|node()" + mode="cibtr:enter"> + <xsl:with-param name="TargetIdPrefix" select="$TargetIdPrefix"/> + </xsl:apply-templates> + </xsl:copy> +</xsl:template> + + +<!-- + + ACTUAL TRANSFORMATION + + Extra modes: cibtr:enter + + --> + +<xsl:variable name="cibtr:WrapSpecificPrefix"> + <!-- no sleek way to fetch this, top-level xmlns:cibtr disappears early --> + <xsl:call-template name="cibtr:WrapSpecificBasename"> + <xsl:with-param name="Uri" + select="namespace-uri(document('')/xsl:stylesheet/@cibtr:filename)"/> + </xsl:call-template> +</xsl:variable> + +<xsl:variable name="cibtr:WrapSpecificPrefixInitialRoot" + select="concat('_', $cibtr:WrapSpecificPrefix, '_')"/> + +<!-- + cibtr:enter mode + --> + +<!-- + This is to cover elements with the internal structure characterized + with the following RelaxNG Compact encoded grammar: + + > attribute id-ref { xsd:IDREF } + > | (attribute id { xsd:ID }, + > (rule? + > & nvpair* + > & attribute score { + > xsd:integer + > | xsd:token "INFINITY" + > | xsd:token "+INFINITY" + > | xsd:token "-INFINITY" + > }?)) + + The context node corresponds to "@id-ref" branch, and Original to the other, + and the task here is to recursively copy anything from Original to target + (with new, unique IDs, of course), and to flip @id-ref to full-fledged, + now valid @id, which will be likewise unique, and importantly, reversibly + mappable back to original in "leave" XSLT counterpart. + --> +<xsl:template match="*[ + @id-ref + and + contains( + concat('|cluster_property_set', + '|instance_attributes|', + '|meta_attributes|'), + concat('|', name(), '|') + ) + ]" + mode="cibtr:enter"> + <xsl:variable name="Original" + select="//*[ + name() = name(current()) + and + @id = current()/@id-ref + ]"/> + <xsl:choose> + <xsl:when test="count($Original) = 0"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR:', + name(), ': dangling @id-ref (', + @id-ref, '): no such @id found', + ' within the same element class')"/> + </xsl:message> + </xsl:when> + <xsl:when test="count($Original) != 1"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR:', + name(), ': dangling @id-ref (', + @id-ref, '): more than one @id found', + ' within the same element class')"/> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:copy> + <xsl:attribute name="id"> + <xsl:value-of select="concat($cibtr:WrapSpecificPrefixInitialRoot, + $Original/@id)"/> + </xsl:attribute> + <xsl:apply-templates select="$Original/@*[name() != 'id'] + |$Original/node()" + mode="cibtr:enter"> + <xsl:with-param name="TargetIdPrefix" + select="concat('__', $cibtr:WrapSpecificPrefix, '_', + $Original/@id, '__')"/> + </xsl:apply-templates> + </xsl:copy> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- + (uniformity as an unattainable goal) + --> +<xsl:template match="@id[ + name(..) != 'resource_ref' + ]" + mode="cibtr:enter"> + <xsl:param name="TargetIdPrefix"/> + <xsl:attribute name="{name()}"> + <xsl:value-of select="concat($TargetIdPrefix, .)"/> + </xsl:attribute> +</xsl:template> + +<xsl:template match="@*|node()" mode="cibtr:enter"> + <xsl:param name="TargetIdPrefix" select="''"/> + <xsl:call-template name="cibtr:HelperIdentityEnter"> + <xsl:with-param name="TargetIdPrefix" select="$TargetIdPrefix"/> + </xsl:call-template> +</xsl:template> + +<!-- mode-less, easy to override kick-off --> +<xsl:template match="/"> + <xsl:call-template name="cibtr:HelperIdentityEnter"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/upgrade-2.10-leave.xsl b/xml/upgrade-2.10-leave.xsl new file mode 100644 index 0000000..6e3fe65 --- /dev/null +++ b/xml/upgrade-2.10-leave.xsl @@ -0,0 +1,230 @@ +<!-- + Copyright 2018 Red Hat, Inc. + Author: Jan Pokorny <jpokorny@redhat.com> + Part of pacemaker project + SPDX-License-Identifier: GPL-2.0-or-later + --> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:cibtr="http://clusterlabs.org/ns/pacemaker/cibtr-2" + exclude-result-prefixes="cibtr" + cibtr:filename="upgrade-2.10-leave.xsl"> +<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/> + +<xsl:param name="cibtr:label-debug" select="'DEBUG: '"/> + +<!-- + + GENERIC UTILITIES + + --> + +<!-- + Recursive implementation of "basename" + + Merely parameter driven, no implicit context taken into account: + - Uri: input in it's current phase of processing +--> +<xsl:template name="cibtr:WrapSpecificBasename"> + <xsl:param name="Uri"/> + <xsl:choose> + <xsl:when test="not(contains($Uri, '/'))"> + <xsl:value-of select="$Uri"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:WrapSpecificBasename"> + <xsl:with-param name="Uri" + select="substring-after($Uri, '/')"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- + Id-mangling-enriched identity template. + --> +<xsl:template name="cibtr:HelperIdentityLeave"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" mode="cibtr:leave"/> + </xsl:copy> +</xsl:template> + + +<!-- + + ACTUAL TRANSFORMATION + + Extra modes: cibtr:leave + cibtr:leave-serialize + + --> + +<xsl:variable name="cibtr:WrapSpecificPrefix"> + <!-- no sleek way to fetch this, top-level xmlns:cibtr disappears early --> + <xsl:call-template name="cibtr:WrapSpecificBasename"> + <xsl:with-param name="Uri" + select="namespace-uri(document('')/xsl:stylesheet/@cibtr:filename)"/> + </xsl:call-template> +</xsl:variable> + +<xsl:variable name="cibtr:WrapSpecificPrefixInitialRoot" + select="concat('_', $cibtr:WrapSpecificPrefix, '_')"/> + +<!-- + cibtr:leave-serialize mode + --> + +<xsl:template match="@*|node()" mode="cibtr:leave-serialize"> + <xsl:choose> + <xsl:when test="count(.|../@*)=count(../@*) + and + name() = 'id'"> + <!-- intentionally skip --> + </xsl:when> + <xsl:when test="count(.|../@*)=count(../@*) + or + self::processing-instruction()"> + <xsl:variable name="Mark"> + <xsl:if test="count(.|../@*)=count(../@*)">A</xsl:if> + <xsl:if test="self::processing-instruction()">P</xsl:if> + </xsl:variable> + <xsl:value-of select="concat($Mark, '(', name(), '=', ., '),')"/> + </xsl:when> + <xsl:when test="self::*"> + <xsl:value-of select="concat('E(', name(), ',')"/> + <xsl:apply-templates select="@*|node()" + mode="cibtr:leave-serialize"/> + <xsl:value-of select="'),'"/> + </xsl:when> + <xsl:when test="self::comment()|self::text()"> + <xsl:variable name="Mark"> + <xsl:if test="self::comment()">C</xsl:if> + <xsl:if test="self::text()">T</xsl:if> + </xsl:variable> + <xsl:value-of select="concat($Mark, '(', ., '),')"/> + </xsl:when> + </xsl:choose> +</xsl:template> + +<!-- + cibtr:leave mode + --> + +<!-- + This is to cover elements with the internal structure characterized + with the following RelaxNG Compact encoded grammar: + + > attribute id-ref { xsd:IDREF } + > | (attribute id { xsd:ID }, + > (rule? + > & nvpair* + > & attribute score { + > xsd:integer + > | xsd:token "INFINITY" + > | xsd:token "+INFINITY" + > | xsd:token "-INFINITY" + > }?)) + + The context node corresponds to "@id-ref" branch prior to unfolding + in the preceding "unfold" XSLT counterpart, and Original to the other, + and the task here is to recursively (and deterministically) compare + the content of the two, and when there's a match, to collapse the + former back to a mere empty @id-ref link. + + NOTE: name of this template may be a bit misleading, but it's meant + to really mean "after upgrade of the same trailing numbers", + which effectively means we are playing per 3.X CIB schema + rules, which needs to be considered, should any element be + renamed, etc. + --> +<xsl:template match="*[ + contains( + concat('|cluster_property_set', + '|instance_attributes|', + '|meta_attributes|'), + concat('|', name(), '|') + ) + ]" + mode="cibtr:leave"> + <xsl:variable name="Original" + select="//*[ + name() = name(current()) + and + @id = substring-after(current()/@id, + $cibtr:WrapSpecificPrefixInitialRoot) + ]"/> + <xsl:choose> + <xsl:when test="not( + starts-with(@id, $cibtr:WrapSpecificPrefixInitialRoot) + )"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" + mode="cibtr:leave"/> + </xsl:copy> + </xsl:when> + <xsl:when test="count($Original) = 0"> + <xsl:if test="string($cibtr:label-debug) != string(false())"> + <xsl:message> + <xsl:value-of select="concat($cibtr:label-debug, name(), + ': original element pointed to with', + ' @id-ref (', + substring-after(@id, + $cibtr:WrapSpecificPrefixInitialRoot), + ') disappeared during upgrade')"/> + </xsl:message> + </xsl:if> + <xsl:copy> + <xsl:apply-templates select="@*|node()" + mode="cibtr:leave"/> + </xsl:copy> + </xsl:when> + <xsl:when test="count($Original) != 1"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR:', + name(), ': found several elements', + ' that possibly were originally', + ' pointed to with @id-ref (', + substring-after(@id, + $cibtr:WrapSpecificPrefixInitialRoot), + '); unexpected ambiguity')"/> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="SerializedOriginal"> + <xsl:apply-templates select="$Original/@*[name() != 'id'] + |$Original/node()" + mode="cibtr:leave-serialize"/> + </xsl:variable> + <xsl:variable name="SerializedDependant"> + <xsl:apply-templates select="@*[name() != 'id'] + |node()" + mode="cibtr:leave-serialize"/> + </xsl:variable> + <xsl:copy> + <xsl:choose> + <xsl:when test="$SerializedOriginal = $SerializedDependant"> + <xsl:attribute name="id-ref"> + <xsl:value-of select="substring-after(@id, + $cibtr:WrapSpecificPrefixInitialRoot)"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="@*|node()" + mode="cibtr:leave"> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </xsl:copy> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="@*|node()" mode="cibtr:leave"> + <xsl:call-template name="cibtr:HelperIdentityLeave"/> +</xsl:template> + +<!-- mode-less, easy to override kick-off --> +<xsl:template match="/"> + <xsl:call-template name="cibtr:HelperIdentityLeave"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/upgrade-2.10-roundtrip.xsl b/xml/upgrade-2.10-roundtrip.xsl new file mode 100644 index 0000000..18d73c8 --- /dev/null +++ b/xml/upgrade-2.10-roundtrip.xsl @@ -0,0 +1,47 @@ +<!-- + Copyright 2018 Red Hat, Inc. + Author: Jan Pokorny <jpokorny@redhat.com> + Part of pacemaker project + SPDX-License-Identifier: GPL-2.0-or-later + --> +<!-- + For experimenting and maintenance purposes only, pacemaker shall + split the transformation pipeline on its own. +--> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:cibtr="http://clusterlabs.org/ns/pacemaker/cibtr-2" + xmlns:exsl="http://exslt.org/common"> +<!-- NOTE: this is an exception from rule forbidding EXSLT's usage --> + +<xsl:import href="upgrade-2.10.xsl"/> +<xsl:import href="upgrade-2.10-enter.xsl"/> +<xsl:import href="upgrade-2.10-leave.xsl"/> + +<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/> + + +<!-- + + ACTUAL TRANSFORMATION + + Extra modes: cibtr:roundtrip + + --> +<xsl:template match="/" + mode="cibtr:roundtrip"> + <xsl:variable name="pre-upgrade"> + <xsl:apply-templates mode="cibtr:enter"/> + </xsl:variable> + <xsl:variable name="upgrade"> + <xsl:apply-templates select="exsl:node-set($pre-upgrade)/node()" mode="cibtr:main"/> + </xsl:variable> + + <xsl:apply-templates select="exsl:node-set($upgrade)/node()" mode="cibtr:leave"/> +</xsl:template> + +<!-- mode-less, easy to override kick-off --> +<xsl:template match="/"> + <xsl:apply-templates select="." mode="cibtr:roundtrip"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/upgrade-2.10.xsl b/xml/upgrade-2.10.xsl new file mode 100644 index 0000000..526ef6d --- /dev/null +++ b/xml/upgrade-2.10.xsl @@ -0,0 +1,2569 @@ +<!-- + Copyright 2018 Red Hat, Inc. + Author: Jan Pokorny <jpokorny@redhat.com> + Part of pacemaker project + SPDX-License-Identifier: GPL-2.0-or-later + --> + +<!-- + Not compatible with @id-ref occurrences! Normalize generic 2.X-compatible + instances with upgrade-2.10-enter.xsl (optionally denormalize back akin + to the original with upgrade-2.10-leave.xsl once the upgrade is finished). +--> + +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:cibtr="http://clusterlabs.org/ns/pacemaker/cibtr-2" + exclude-result-prefixes="cibtr"> +<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/> + +<xsl:param name="cibtr:cib-min-ver" select="'3.0'"/> +<xsl:param name="cibtr:label-warning" select="'WARNING: '"/> +<xsl:param name="cibtr:label-info" select="'INFO: '"/> +<xsl:param name="cibtr:label-debug" select="'DEBUG: '"/> + +<!-- + + HELPER DEFINITIONS + + --> + +<cibtr:map> + + <!-- + Target tag: cluster_property_set + Object: ./nvpair/@name + Selector ctxt: ./nvpair/@value + Move ctxt: op_defaults ~ /cib/configuration/op_defaults + rsc_defaults ~ /cib/configuration/rsc_defaults + Related commit: c1c66fe13 + + + 7a9891f29 + 7d0d1b0eb + 1f643d610 + 73a5d63a8 + + + 642a09b22 + 0c03e366d + a28a558f9 + --> + <cibtr:table for="cluster-properties" msg-prefix="Cluster properties" + where-cases="op_defaults|rsc_defaults"> + <cibtr:replace what="cluster-infrastructure" + with="" + in-case-of="heartbeat|openais|classic openais|classic openais (with plugin)|cman" + msg-extra="corosync (2+) infrastructure can be used instead, though the value is not of significance"/> + + <cibtr:replace what="cluster_recheck_interval" + with="cluster-recheck-interval"/> + <cibtr:replace what="dc_deadtime" + with="dc-deadtime"/> + + <cibtr:replace what="default-action-timeout" + with="timeout" + where="op_defaults"/> + <cibtr:replace what="default_action_timeout" + with="timeout" + where="op_defaults"/> + + <cibtr:replace what="default-migration-threshold" + with="" + msg-extra="migration-threshold in rsc_defaults can be configured instead"/> + <cibtr:replace what="default_migration_threshold" + with="" + msg-extra="migration-threshold in rsc_defaults can be configured instead"/> + + <cibtr:replace what="default-resource-stickiness" + with="resource-stickiness" + where="rsc_defaults"/> + <cibtr:replace what="default_resource_stickiness" + with="resource-stickiness" + where="rsc_defaults"/> + + <cibtr:replace what="default-resource-failure-stickiness" + with="migration-threshold" + where="rsc_defaults" + in-case-of="-INFINITY" + redefined-as="1"/> + <cibtr:replace what="default-resource-failure-stickiness" + with="" + msg-extra="migration-threshold in rsc_defaults can be configured instead"/> + <cibtr:replace what="default_resource_failure_stickiness" + with="migration-threshold" + where="rsc_defaults" + in-case-of="-INFINITY" + redefined-as="1"/> + <cibtr:replace what="default_resource_failure_stickiness" + with="" + msg-extra="migration-threshold in rsc_defaults can be configured instead"/> + + <cibtr:replace what="election_timeout" + with="election-timeout"/> + <cibtr:replace what="expected-quorum-votes" + with="" + msg-extra="corosync (2+) infrastructure tracks quorum on its own"/> + + <cibtr:replace what="is-managed-default" + with="is-managed" + where="rsc_defaults"/> + <cibtr:replace what="is_managed_default" + with="is-managed" + where="rsc_defaults"/> + <cibtr:replace what="no_quorum_policy" + with="no-quorum-policy"/> + + <cibtr:replace what="notification-agent" + with="" + msg-extra="standalone alerts can be configured instead"/> + <cibtr:replace what="notification-recipient" + with="" + msg-extra="standalone alerts can be configured instead"/> + + <cibtr:replace what="remove_after_stop" + with="remove-after-stop"/> + <cibtr:replace what="shutdown_escalation" + with="shutdown-escalation"/> + <cibtr:replace what="startup_fencing" + with="startup-fencing"/> + <cibtr:replace what="stonith_action" + with="stonith-action"/> + <cibtr:replace what="stonith_enabled" + with="stonith-enabled"/> + <cibtr:replace what="stop_orphan_actions" + with="stop-orphan-actions"/> + <cibtr:replace what="stop_orphan_resources" + with="stop-orphan-resources"/> + <cibtr:replace what="symmetric_cluster" + with="symmetric-cluster"/> + <cibtr:replace what="transition_idle_timeout" + with="cluster-delay"/> + </cibtr:table> + + <!-- + Target tag: node + Object: ./@* + Selector ctxt: ./@* + Move ctxt: N/A + Related commit: 55ab749bf + --> + <cibtr:table for="cluster-node" msg-prefix="Cluster node"> + <cibtr:replace what="type" + with="type" + in-case-of="normal" + redefined-as="member"/> + </cibtr:table> + + <!-- + Target tag: primitive + template + Object: ./instance_attributes/nvpair/@name + Selector ctxt: N/A + Move ctxt: N/A + Related commit: 06d4559cb + + + 6c8e0be20 + --> + <cibtr:table for="resource-instance-attributes" msg-prefix="Resource instance_attributes"> + <cibtr:replace what="pcmk_arg_map" + with=""/> + <!-- simplified as pcmk_arg_map can encode multiple + comma-separated pairs (everything would be dropped then, + except for a single dangling case: "port" coming first) --> + <cibtr:replace what="pcmk_arg_map" + with="pcmk_host_argument" + in-case-of-droppable-prefix="port:"/> + + <cibtr:replace what="pcmk_list_cmd" + with="pcmk_list_action"/> + <cibtr:replace what="pcmk_monitor_cmd" + with="pcmk_monitor_action"/> + <cibtr:replace what="pcmk_off_cmd" + with="pcmk_off_action"/> + <cibtr:replace what="pcmk_on_cmd" + with="pcmk_on_action"/> + <cibtr:replace what="pcmk_reboot_cmd" + with="pcmk_reboot_action"/> + <cibtr:replace what="pcmk_status_cmd" + with="pcmk_status_action"/> + </cibtr:table> + + <!-- + Target tag: primitive + template + Object: ./meta_attributes/nvpair/@name + Selector ctxt: N/A + Move ctxt: N/A + Related commit: c713bbe39 + + + 6052ad6da + --> + <cibtr:table for="resource-meta-attributes" msg-prefix="Resource meta_attributes"> + <cibtr:replace what="isolation" + with="target-role" + redefined-as="Stopped" + msg-extra="i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources" + msg-severity="WARNING"/> + <cibtr:replace what="isolation-host" + with="target-role" + redefined-as="Stopped" + msg-extra="i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources" + msg-severity="WARNING"/> + <cibtr:replace what="isolation-instance" + with="target-role" + redefined-as="Stopped" + msg-extra="i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources" + msg-severity="WARNING"/> + <cibtr:replace what="isolation-wrapper" + with="target-role" + redefined-as="Stopped" + msg-extra="i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources" + msg-severity="WARNING"/> + + <cibtr:replace what="resource-failure-stickiness" + with="migration-threshold" + in-case-of="-INFINITY" + redefined-as="1"/> + <cibtr:replace what="resource-failure-stickiness" + with="" + msg-extra="migration-threshold can be configured instead"/> + <cibtr:replace what="resource_failure_stickiness" + with="migration-threshold" + in-case-of="-INFINITY" + redefined-as="1"/> + <cibtr:replace what="resource_failure_stickiness" + with="" + msg-extra="migration-threshold can be configured instead"/> + </cibtr:table> + + <!-- + Target tag: primitive + template + Object: ./operations/op/@* + ./operations/op/meta_attributes/nvpair/@name + ./operations/op/instance_attributes/nvpair/@name + Selector ctxt: ./operations/op/@name + Move ctxt: meta_attributes ~ ./meta_attributes/nvpair + Related commit: 014a543d5 + --> + <cibtr:table for="resources-operation" msg-prefix="Resources-operation" + where-cases="meta_attributes"> + <!-- keep this in sync with resource-operation-instance-attributes table --> + <cibtr:replace what="requires" + with="" + msg-extra="only start/promote operation taken into account"/> + <cibtr:replace what="requires" + with="requires" + in-case-of="start|promote" + where="meta_attributes"/> + </cibtr:table> + + <!-- + Target tag: primitive + template + Object: ./operations/op/instance_attributes/nvpair/@name + Selector ctxt: ./operations/op/@name + Move ctxt: per-resource-meta_attributes ~ ./meta_attributes/nvpair + meta_attributes ~ ./operations/op/meta_attributes/nvpair + Related commit: 023897afc + 3100c0e8b + --> + <cibtr:table for="resource-operation-instance-attributes" + msg-prefix="Resources-operation instance_attributes" + where-cases="meta_attributes|per-resource-meta_attributes"> + <!-- this is easier to solve through resources-operation table handling, + in the inverse mode, but for compatibility purposes, we need to have + it tracked here, so mark it the same way as if we were moving it over + to sibling per-op meta_attributes (while in fact we move it up to + per-resource meta_attributes, as if it was specified in per-op + meta_attributes already), just use a dedicated "where-case" other + than "meta_attributes" reserved for proper local move as mentioned; + otherwise keep it in sync with said table --> + <cibtr:replace what="requires" + with="" + msg-extra="only start/promote operation taken into account"/> + <cibtr:replace what="requires" + with="requires" + in-case-of="start|promote" + where="per-resource-meta_attributes"/> + + <!-- these must have been, due to the value sourcing predence arrangement, + shadowed by immediate op's attributes, so simply preserve their + non-meta meaning --> + <!-- + <cibtr:replace what="name" + with="name" + where="meta_attributes"/> + <cibtr:replace what="interval" + with="interval" + where="meta_attributes"/> + --> + + <cibtr:replace what="interval-origin" + with="interval-origin" + where="meta_attributes"/> + <cibtr:replace what="start-delay" + with="start-delay" + where="meta_attributes"/> + + <cibtr:replace what="enabled" + with="enabled" + where="meta_attributes"/> + <cibtr:replace what="on-fail" + with="on-fail" + where="meta_attributes"/> + <cibtr:replace what="record-pending" + with="record-pending" + where="meta_attributes"/> + <cibtr:replace what="role" + with="role" + where="meta_attributes"/> + <cibtr:replace what="timeout" + with="timeout" + where="meta_attributes"/> + </cibtr:table> + + <!-- + Target tag: rsc_colocation + Object: ./@* + Selector ctxt: N/A + Move ctxt: N/A + Related commit: 96d7ffedf + --> + <cibtr:table for="constraints-colocation" msg-prefix="Constraints-colocation"> + <cibtr:replace what="score-attribute" + with="" + msg-extra="was actually never in effect"/> + <cibtr:replace what="score-attribute-mangle" + with="" + msg-extra="was actually never in effect"/> + </cibtr:table> + +</cibtr:map> + +<xsl:variable name="cibtr:MapClusterProperties" + select="document('')/xsl:stylesheet + /cibtr:map/cibtr:table[ + @for = 'cluster-properties' + ]"/> + +<xsl:variable name="cibtr:MapClusterNode" + select="document('')/xsl:stylesheet + /cibtr:map/cibtr:table[ + @for = 'cluster-node' + ]"/> + +<xsl:variable name="cibtr:MapResourceInstanceAttributes" + select="document('')/xsl:stylesheet + /cibtr:map/cibtr:table[ + @for = 'resource-instance-attributes' + ]"/> + +<xsl:variable name="cibtr:MapResourceMetaAttributes" + select="document('')/xsl:stylesheet + /cibtr:map/cibtr:table[ + @for = 'resource-meta-attributes' + ]"/> + +<xsl:variable name="cibtr:MapResourcesOperation" + select="document('')/xsl:stylesheet + /cibtr:map/cibtr:table[ + @for = 'resources-operation' + ]"/> + +<xsl:variable name="cibtr:MapResourcesOperationInstanceAttributes" + select="document('')/xsl:stylesheet + /cibtr:map/cibtr:table[ + @for = 'resource-operation-instance-attributes' + ]"/> + +<xsl:variable name="cibtr:MapConstraintsColocation" + select="document('')/xsl:stylesheet + /cibtr:map/cibtr:table[ + @for = 'constraints-colocation' + ]"/> + +<!-- + + GENERIC UTILITIES + + --> + +<!-- + Plain identity template + + Merely implicit-context-driven, no arguments. + --> +<xsl:template name="cibtr:HelperIdentity"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" + mode="cibtr:main"/> + </xsl:copy> +</xsl:template> + +<!-- + Emit an message about the replacement, sanity checking the source definitions + + Merely parameter driven, no implicit context taken into account: + - Context: optional message prefix + - Replacement: selected subset of cibtr:map's leaves + (it's considered a hard error if consists of more than 1 item) + + Explanation wrt. how target severity gets selected, ordered by priority: + - $Replacement/@msg-severity (WARNING/INFO/DEBUG) + - $Replacement/@msg-extra defined -> INFO + - otherwise -> DEBUG + --> +<xsl:template name="cibtr:MapMsg"> + <xsl:param name="Context" select="''"/> + <xsl:param name="Replacement"/> + <xsl:choose> + <xsl:when test="not($Replacement)"/> + <xsl:when test="count($Replacement) != 1"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR: ', + $Replacement/../@msg-prefix, + ': count($Replacement) != 1', + ' does not hold (', + count($Replacement), ')')"/> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="MsgPrefix" select="concat( + ($Replacement|$Replacement/..) + /@msg-prefix, ': ' + )"/> + <xsl:variable name="MsgSeverity"> + <xsl:choose> + <xsl:when test="$Replacement/@msg-severity"> + <xsl:value-of select="$Replacement/@msg-severity"/> + </xsl:when> + <xsl:when test="$Replacement/@msg-extra"> + <xsl:value-of select="'INFO'"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="'DEBUG'"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="MsgSeverityLabel"> + <xsl:choose> + <xsl:when test="$MsgSeverity = 'WARNING'"> + <xsl:value-of select="$cibtr:label-warning"/> + </xsl:when> + <xsl:when test="$MsgSeverity = 'INFO'"> + <xsl:value-of select="$cibtr:label-info"/> + </xsl:when> + <xsl:when test="$MsgSeverity = 'DEBUG'"> + <xsl:value-of select="$cibtr:label-debug"/> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR: not a valid', + ' severity specification: ', + $MsgSeverity)"/> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:if test="string($MsgSeverityLabel) != string(false())"> + <xsl:message> + <xsl:value-of select="concat($MsgSeverityLabel, $MsgPrefix)"/> + <xsl:if test="$Context"> + <xsl:value-of select="concat($Context, ': ')"/> + </xsl:if> + <xsl:choose> + <xsl:when test="string($Replacement/@with)"> + <xsl:choose> + <xsl:when test="string($Replacement/@where)"> + <xsl:if test="not( + contains( + concat('|', $Replacement/../@where-cases, '|'), + concat('|', $Replacement/@where, '|') + ) + )"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR:', + $Replacement/../@msg-prefix, + ': $Replacement/@where (', + $Replacement/@where, ') not in ', + concat('|', + $Replacement/../@where-cases, + '|'))"/> + </xsl:message> + </xsl:if> + <xsl:value-of select="concat('moving ', $Replacement/@what, + ' under ', $Replacement/@where)"/> + </xsl:when> + <xsl:when test="$Replacement/@with = $Replacement/@what"> + <xsl:value-of select="concat('keeping ', $Replacement/@what)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat('renaming ', $Replacement/@what)"/> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="concat(' as ', $Replacement/@with)"/> + <xsl:if test="$Replacement/@where"> + <xsl:value-of select="' unless already defined there'"/> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat('dropping ', $Replacement/@what)"/> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="string($Replacement/@redefined-as)"> + <xsl:value-of select="concat(', redefined as ', + $Replacement/@redefined-as)"/> + <xsl:if test="$Replacement/@in-case-of"> + <xsl:value-of select="','"/> + </xsl:if> + </xsl:if> + <xsl:choose> + <xsl:when test="string($Replacement/@in-case-of)"> + <xsl:value-of select="concat(' for matching ', + $Replacement/@in-case-of)"/> + </xsl:when> + <xsl:when test="$Replacement/@in-case-of"> + <xsl:value-of select="' for matching "empty string"'"/> + </xsl:when> + <xsl:when test="$Replacement/@in-case-of-droppable-prefix"> + <xsl:value-of select="concat(' for matching ', + $Replacement/@in-case-of-droppable-prefix, + ' prefix that will, meanwhile, get dropped' + )"/> + </xsl:when> + </xsl:choose> + </xsl:message> + <xsl:if test="$Replacement/@msg-extra"> + <xsl:message> + <xsl:value-of select="concat($MsgSeverityLabel, $MsgPrefix, '... ', + $Replacement/@msg-extra)"/> + </xsl:message> + </xsl:if> + </xsl:if> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- + Produce a denormalized space if not present in the input (cf. trick A.) + + Merely parameter driven, no implicit context taken into account: + - Source: input selection or result tree fragment to evaluate + - ResultTreeFragment: optional self-explanatory flag related to Source + --> +<xsl:template name="cibtr:HelperDenormalizedSpace"> + <xsl:param name="Source"/> + <xsl:param name="ResultTreeFragment" select="false()"/> + <xsl:param name="InnerSimulation" select="false()"/> + <xsl:choose> + <xsl:when test="not($ResultTreeFragment)"> + <!-- intention here is that immediately surrounding text (mostly expected + to be just indenting whitespace) and comments will be preserved; + in case no denormalized space is present, " " is injected --> + <xsl:variable name="ExistingSpace" + select="$Source/preceding-sibling::node()[ + ( + self::comment() + or + self::text() + ) + and + generate-id(following-sibling::*[1]) + = generate-id($Source) + ]"/> + <xsl:copy-of select="$ExistingSpace"/> + <xsl:if test="not( + $ExistingSpace/self::text()[ + normalize-space(.) != string(.) + ] + ) and $InnerSimulation"> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="normalize-space($Source) + != string($Source)"> + <xsl:text> </xsl:text> + </xsl:when> + </xsl:choose> +</xsl:template> + +<!-- + + TRANSFORMATION HELPERS + + considerations, limitations, etc.: + 1. the transformations tries to preserve as much of the original XML + as possible, incl. whitespace text/indentation and comments, but + at times (corner cases of tricks A. + B. below), this needs to be + sacrificed, e.g., distorting nice indentation, hence if the + perfection is the goal: + - user of the transformation can feed the minimized version of + the XML (no denormalized/any white-space present) + - user of the transformation can (re-)pretty-print the outcome + afterwards + + tricks and conventions used: + A. callable templates only return Result Tree Fragments, which means + the only operations allowed are those looking at the underlying, + virtual node-set, and since we need to discern their non-void + production (i.e. on successful match/es), we use this trick: + - ensure the template will not propagate any denormalized whitespace + - inject denormalized whitespace (superfluous space) artificially + to mark successful production (but see B. below) + - with the template production, here stored as Var variable, + we test "normalize-space($Var) != $Var" condition to detect + non-void production, mainly intended to see whether to emit + the enclosing element at all (with the goal of not leaving + superfluous elements behind needlessly) + B. [extension over A.] to eliminate distorted indentation + (cf. consideration 1.), additional reuse of these callable + templates is introduced: the template can recursively call + itself with a special flag (InnerSimulation) as an oracle to + see to whether non-void production will ensue (all pre-existing + denormalized whitespace is forcefully removed in this mode), + and if positive, all such inner pre-existing whitespace is + then preserved in this outer=main invocation + C. [extension over B.] when checking the non-void production + (via InnerSimulation), beside the injected denormalized whitespace, + we can also inject particular strings, which the callsite of such + simulation can, in addition, inspect for paricular string + occurrences, e.g. to prevent clashes on the production coming + from multiple sources + D. not only to honour DRY principle and to avoid inner entropy, it's + often useful to make callable template bimodal, e.g., when the + production is generated in the "what's to stay in place" vs. + "what's to be propagated (combined with previous, effectively + moved) at this other part of the tree" contexts; for such cases, + there's usually InverseMode parameter to be assigned true() + (implicit default) and false(), respectively + E. the common idiom that emerges is: evaluate simulation value, + depending on the presence of the "success mark" (cf. A.), + possibly emit non-simulation value; since it would (likely) + re-evaluate the simulation anew (wastefully) or perhaps + this sort of dependency injection can just come handy, + common transformation helpers below offer InnerPass + parameter to be optionally passed, either as a string (when + no-denormalized-space is an internal criterium for the template) + or, conventionally, the result tree fragment representing the + output of the template at hand called with a simulation flag + * established signaling strings accompanying InnerSimulation=true: + - TRIGGER-MSG ... make the template execution emit messages + describing changes being performed + - TRIGGER-RECURSION + ... currently used in the oracle-like evaluation + of what's the situation with the sibling + elements as a recursion guard so that such + nested runs won't revisit the new set of + siblings per the respective nested context + + --> + +<!-- + Source ctxt: cluster_property_set + Target ctxt: cluster_property_set + Target-inv ctxt:/cib/configuration/(op_defaults|rsc_defaults) + [cluster_property_set -> meta_attributes] + Dependencies: N/A + --> +<xsl:template name="cibtr:ProcessClusterProperties"> + <xsl:param name="Source"/> + <xsl:param name="InverseMode" select="false()"/> + <xsl:param name="InnerSimulation" select="false()"/> + <xsl:param name="InnerPass"> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="''"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:ProcessClusterProperties"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="InverseMode" select="$InverseMode"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + + <xsl:for-each select="$Source/node()"> + <xsl:choose> + <xsl:when test="self::text()"> + <!-- cf. trick A. (consideration 1.) --> + <xsl:choose> + <xsl:when test="normalize-space($InnerPass) + != $InnerPass + and + ( + not(following-sibling::nvpair) + or + generate-id(following-sibling::nvpair[1]) + != generate-id(following-sibling::*[1]) + )"> + <xsl:value-of select="."/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(.)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="self::nvpair"> + <xsl:variable name="Replacement" + select="$cibtr:MapClusterProperties/cibtr:replace[ + @what = current()/@name + and + ( + ( + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/@value, '|')) + ) + or + ( + not(@in-case-of) + and + not( + $cibtr:MapClusterProperties/cibtr:replace[ + @what = current()/@name + and + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/@value, '|')) + ] + ) + ) + ) + ]"/> + <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> + <xsl:call-template name="cibtr:MapMsg"> + <xsl:with-param name="Context" select="@id"/> + <xsl:with-param name="Replacement" select="$Replacement"/> + </xsl:call-template> + </xsl:if> + <xsl:choose> + <xsl:when test="$Replacement + and + ( + not(string($Replacement/@with)) + or + $Replacement/@where + )"> + <!-- drop (possibly just move over) --> + <xsl:if test="$Replacement/@where + and + ( + ( + normalize-space($InverseMode) + and + $Replacement/@where = $InverseMode + ) + or + ( + not(normalize-space($InverseMode)) + and + (true() or count($InverseMode)) + and + not( + $InverseMode/nvpair[ + @name = $Replacement/@with + ] + ) + and + $Replacement/@where = name($InverseMode/..) + ) + )"> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:copy> + <xsl:for-each select="@*"> + <xsl:choose> + <xsl:when test="name() = 'name'"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="$Replacement/@with"/> + </xsl:attribute> + </xsl:when> + <xsl:when test="string($Replacement/@redefined-as) + and + name() = 'value'"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="$Replacement/@redefined-as"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:copy> + </xsl:if> + </xsl:when> + <xsl:when test="$InverseMode"/> + <xsl:when test="$Replacement"> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:copy> + <xsl:for-each select="@*"> + <xsl:choose> + <xsl:when test="name() = 'name'"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="$Replacement/@with"/> + </xsl:attribute> + </xsl:when> + <xsl:when test="string($Replacement/@redefined-as) + and + name() = 'value'"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="$Replacement/@redefined-as"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:copy> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="$InverseMode + or + self::comment()"> + <!-- drop --> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> +</xsl:template> + +<!-- + Source ctxt: (primitive|template)/instance_attributes + Target ctxt: (primitive|template)/instance_attributes + Target-inv ctxt:N/A + Dependencies: N/A + --> +<xsl:template name="cibtr:ProcessRscInstanceAttributes"> + <xsl:param name="Source"/> + <xsl:param name="InnerSimulation" select="false()"/> + <xsl:param name="InnerPass"> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="''"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:ProcessRscInstanceAttributes"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + + <!-- B: special-casing nvpair --> + <xsl:for-each select="$Source/node()"> + <xsl:choose> + <xsl:when test="self::text()"> + <!-- cf. trick A. (consideration 1.) --> + <xsl:choose> + <xsl:when test="normalize-space($InnerPass) + != $InnerPass + and + ( + not(following-sibling::nvpair) + or + generate-id(following-sibling::nvpair[1]) + != generate-id(following-sibling::*[1]) + )"> + <xsl:value-of select="."/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(.)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="self::nvpair"> + <xsl:variable name="Replacement" + select="$cibtr:MapResourceInstanceAttributes/cibtr:replace[ + @what = current()/@name + and + ( + ( + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/@value, '|')) + ) + or + ( + @in-case-of-droppable-prefix + and + starts-with(current()/@value, + @in-case-of-droppable-prefix) + and + not( + contains(current()/@value, ',') + ) + ) + or + ( + not(@in-case-of) + and + not(@in-case-of-droppable-prefix) + and + not( + $cibtr:MapResourceInstanceAttributes/cibtr:replace[ + @what = current()/@name + and + ( + ( + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/@value, '|')) + ) + or + ( + @in-case-of-droppable-prefix + and + starts-with(current()/@value, + @in-case-of-droppable-prefix) + and + not( + contains(current()/@value, ',') + ) + ) + ) + ] + ) + ) + ) + ]"/> + <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> + <xsl:call-template name="cibtr:MapMsg"> + <xsl:with-param name="Context" select="@id"/> + <xsl:with-param name="Replacement" select="$Replacement"/> + </xsl:call-template> + </xsl:if> + <xsl:choose> + <xsl:when test="$Replacement + and + not(string($Replacement/@with))"> + <!-- drop (move-over code missing) --> + </xsl:when> + <xsl:when test="$Replacement"> + <!-- plain rename --> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:copy> + <xsl:for-each select="@*"> + <xsl:choose> + <xsl:when test="name() = 'name'"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="$Replacement/@with"/> + </xsl:attribute> + </xsl:when> + <xsl:when test="string($Replacement/@redefined-as) + and + name() = 'value'"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="$Replacement/@redefined-as"/> + </xsl:attribute> + </xsl:when> + <xsl:when test="string($Replacement/@in-case-of-droppable-prefix) + and + name() = 'value'"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="substring-after( + ., $Replacement/@in-case-of-droppable-prefix + )"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:copy> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <!-- E: special-casing nvpair --> +</xsl:template> + +<!-- + Source ctxt: (primitive|template)/meta_attributes + Target ctxt: (primitive|template)/meta_attributes + Target-inv ctxt:N/A + Dependencies: N/A + --> +<xsl:template name="cibtr:ProcessRscMetaAttributes"> + <xsl:param name="Source"/> + <xsl:param name="InnerSimulation" select="false()"/> + <xsl:param name="InnerPass"> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="''"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:ProcessRscMetaAttributes"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + + <!-- B: special-casing nvpair --> + <xsl:for-each select="$Source/node()"> + <xsl:choose> + <xsl:when test="self::text()"> + <!-- cf. trick A. (consideration 1.) --> + <xsl:choose> + <xsl:when test="normalize-space($InnerPass) + != $InnerPass + and + ( + not(following-sibling::nvpair) + or + generate-id(following-sibling::nvpair[1]) + != generate-id(following-sibling::*[1]) + )"> + <xsl:value-of select="."/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(.)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="self::nvpair"> + <xsl:variable name="Replacement" + select="$cibtr:MapResourceMetaAttributes/cibtr:replace[ + @what = current()/@name + and + ( + ( + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/@value, '|')) + ) + or + ( + not(@in-case-of) + and + not( + $cibtr:MapResourceMetaAttributes/cibtr:replace[ + @what = current()/@name + and + ( + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/@value, '|')) + ) + ] + ) + ) + ) + ]"/> + <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> + <xsl:call-template name="cibtr:MapMsg"> + <xsl:with-param name="Context" + select="concat(../../@id, + ' (meta=', ../@id, + ')')"/> + <xsl:with-param name="Replacement" select="$Replacement"/> + </xsl:call-template> + </xsl:if> + <xsl:choose> + <xsl:when test="$Replacement + and + not(string($Replacement/@with))"> + <!-- drop (move-over code missing) --> + </xsl:when> + <xsl:when test="$Replacement"> + <!-- plain rename --> + <xsl:variable name="SimulateFollowingSiblings"> + <!-- prevent generating redundant name-value pairs --> + <xsl:for-each select="(..|../following-sibling::meta_attributes)[ + not(rule) + ]"> + <xsl:if test="$InnerPass != 'TRIGGER-RECURSION'"> + <xsl:call-template name="cibtr:ProcessRscMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="true()"/> + <xsl:with-param name="InnerPass" select="'TRIGGER-RECURSION'"/> + </xsl:call-template> + </xsl:if> + </xsl:for-each> + </xsl:variable> + <xsl:choose> + <!-- instead of HelperDenormalizedSpace --> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="concat(generate-id(), '@', $Replacement/@with, ' ')"/> + </xsl:when> + <xsl:otherwise> + <xsl:if test="not( + contains($SimulateFollowingSiblings, + concat($Replacement/@with, ' ')) + ) + or + generate-id() + = + substring-before($SimulateFollowingSiblings, + concat('@', $Replacement/@with))"> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:copy> + <xsl:for-each select="@*"> + <xsl:choose> + <xsl:when test="name() = 'name'"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="$Replacement/@with"/> + </xsl:attribute> + </xsl:when> + <xsl:when test="string($Replacement/@redefined-as) + and + name() = 'value'"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="$Replacement/@redefined-as"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:copy> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <!-- E: special-casing nvpair --> +</xsl:template> + +<!-- + Source ctxt: (primitive|template)/operations/op/instance_attributes + Target ctxt: (primitive|template)/operations/op/instance_attributes + Target-inv ctxt:(primitive|template)/operations/op/meta_attributes + Dependencies: ProcessNonattrOpMetaAttributes [inverse only] + --> +<xsl:template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:param name="Source"/> + <xsl:param name="InverseMode" select="false()"/> + <xsl:param name="InnerSimulation" select="false()"/> + <xsl:param name="InnerPass"> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="''"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + + <xsl:variable name="EnclosingTag" select="../../.."/> + + <!-- B: special-casing nvpair --> + <xsl:for-each select="$Source/node()"> + <xsl:choose> + <xsl:when test="self::text()"> + <!-- cf. trick A. (consideration 1.) --> + <xsl:choose> + <xsl:when test="normalize-space($InnerPass) + != $InnerPass + and + ( + not(following-sibling::nvpair) + or + generate-id(following-sibling::nvpair[1]) + != generate-id(following-sibling::*[1]) + )"> + <xsl:value-of select="."/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(.)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="self::nvpair"> + <xsl:variable name="Replacement" + select="$cibtr:MapResourcesOperationInstanceAttributes/cibtr:replace[ + @what = current()/@name + and + ( + ( + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/../../@name, '|')) + ) + or + ( + not(@in-case-of) + and + not( + $cibtr:MapResourcesOperationInstanceAttributes/cibtr:replace[ + @what = current()/@name + and + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/../../@name, '|')) + ] + ) + ) + ) + ]"/> + <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> + <xsl:call-template name="cibtr:MapMsg"> + <xsl:with-param name="Context" + select="concat(../../@id, + ' (rsc=', $EnclosingTag/@id, + ', meta=', ../@id, + ')')"/> + <xsl:with-param name="Replacement" select="$Replacement"/> + </xsl:call-template> + </xsl:if> + <xsl:choose> + <xsl:when test="$Replacement + and + ( + not(string($Replacement/@with)) + or + $Replacement/@where + )"> + <!-- drop (possibly just move over) --> + <xsl:variable name="SimulateAttrOverrides"> + <xsl:for-each select="../../../op"> + <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <xsl:if test="$InverseMode + and + not( + contains($SimulateAttrOverrides, + concat(@name, ' ')) + )"> + <!-- do not override; do not collide with: + - newly added from op/@* (see last condition above) + - existing - actually subsumed with the previous point + - successors sourced like this (see below) --> + <xsl:variable name="SimulateFollowingSiblingsMeta"> + <!-- cf. similar handling in ProcessAttrOpMetaAttributes, + but this is more convoluted --> + <xsl:for-each select="(../following-sibling::meta_attributes + |../../following-sibling::op/meta_attributes)[ + not(rule) + ]"> + <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <xsl:variable name="SimulateFollowingSiblingsInstance"> + <xsl:for-each select="../following-sibling::instance_attributes[ + not(rule) + ]"> + <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <xsl:if test="$Replacement/@where = 'meta_attributes' + and + not( + $EnclosingTag/meta_attributes[ + not(rule) + and + nvpair/@name = $Replacement/@with + ] + ) + and + not( + contains($SimulateFollowingSiblingsInstance, + concat(@name, ' ')) + )"> + <!-- cf. trick C. (indicate for inverse mode) --> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <!-- instead of HelperDenormalizedSpace --> + <xsl:value-of select="concat(@name, ' ')"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + </xsl:copy> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </xsl:if> + </xsl:when> + <xsl:when test="$Replacement"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR: ', + $Replacement/../@msg-prefix, + ': no in-situ rename', + ' does not hold (', + not(($InverseMode)), ')')"/> + </xsl:message> + </xsl:when> + <xsl:when test="$InverseMode"/> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="$InverseMode + or + self::comment()"> + <!-- drop --> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <!-- E: special-casing nvpair --> +</xsl:template> + +<!-- + Source ctxt: (primitive|template)/operations/op/meta_attributes + (primitive|template)/operations/op/instance_attributes (inverse only) + Target ctxt: (primitive|template)/operations/op/meta_attributes + Target-inv ctxt:(primitive|template)/meta_attributes + Dependencies: ProcessAttrOpMetaAttributes + ProcessNonattrOpMetaAttributes + --> +<xsl:template name="cibtr:ProcessNonattrOpMetaAttributes"> + <xsl:param name="Source"/> + <xsl:param name="InverseMode" select="false()"/> + <xsl:param name="InnerSimulation" select="false()"/> + <xsl:param name="InnerPass"> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="''"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + + <xsl:variable name="EnclosingTag" select="../../.."/> + + <xsl:for-each select="$Source/node()"> + <xsl:choose> + <xsl:when test="self::text() + and + not($InverseMode)"> + <!-- cf. trick A. (consideration 1.) --> + <xsl:choose> + <xsl:when test="normalize-space($InnerPass) + != $InnerPass + and + ( + not(following-sibling::nvpair) + or + generate-id(following-sibling::nvpair[1]) + != generate-id(following-sibling::*[1]) + )"> + <xsl:value-of select="."/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(.)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="self::nvpair"> + <xsl:variable name="Replacement" + select="$cibtr:MapResourcesOperation/cibtr:replace[ + @what = current()/@name + and + ( + ( + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/../../@name, '|')) + ) + or + ( + not(@in-case-of) + and + not( + $cibtr:MapResourcesOperation/cibtr:replace[ + @what = current()/@name + and + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/../../@name, '|')) + ] + ) + ) + ) + ]"/> + <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> + <xsl:call-template name="cibtr:MapMsg"> + <xsl:with-param name="Context" + select="concat(../../@id, + ' (rsc=', $EnclosingTag/@id, + ', meta=', ../@id, + ')')"/> + <xsl:with-param name="Replacement" select="$Replacement"/> + </xsl:call-template> + </xsl:if> + <xsl:choose> + <xsl:when test="$Replacement + and + ( + not(string($Replacement/@with)) + or + $Replacement/@where + )"> + <!-- drop (possibly just move over) --> + <xsl:if test="$InverseMode"> + <xsl:variable name="SimulateAttrOverrides"> + <xsl:for-each select="../../../op"> + <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <xsl:if test="not( + contains($SimulateAttrOverrides, + concat(@name, ' ')) + )"> + <!-- do not override; do not collide with: + - newly added from op/@* (see last condition above) + - existing - actually subsumed with the previous point + - successors sourced like this (see below) + and if coming from op/instance_attributes, add also + - any meta_attributes sourced like this --> + <xsl:variable name="SimulateFollowingSiblings"> + <!-- cf. similar handling in ProcessAttrOpMetaAttributes, + but this is more convoluted --> + <xsl:if test="name(..) = 'meta_attributes'"> + <xsl:for-each select="(../following-sibling::meta_attributes + |../../following-sibling::op/meta_attributes)[ + not(rule) + ]"> + <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:for-each> + </xsl:if> + <xsl:if test="name(..) = 'instance_attributes'"> + <xsl:for-each select="(../following-sibling::instance_attributes + |../../following-sibling::op/instance_attributes + |../../meta_attributes + |../../../op/meta_attributes)[ + not(rule) + ]"> + <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:for-each> + </xsl:if> + </xsl:variable> + <xsl:if test="$Replacement/@where = 'meta_attributes' + and + not( + $EnclosingTag/meta_attributes[ + not(rule) + and + nvpair/@name = $Replacement/@with + ] + ) + and + not( + contains($SimulateFollowingSiblings, + concat(@name, ' ')) + )"> + <!-- cf. trick C. (indicate for inverse mode) --> + <xsl:choose> + <!-- instead of HelperDenormalizedSpace --> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="concat(@name, ' ')"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + </xsl:copy> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </xsl:if> + </xsl:if> + </xsl:when> + <xsl:when test="$Replacement"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR: ', + $Replacement/../@msg-prefix, + ': no in-situ rename', + ' does not hold (', + not(($InverseMode)), ')')"/> + </xsl:message> + </xsl:when> + <xsl:when test="$InverseMode"/> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="$InverseMode + or + self::comment()"> + <!-- drop --> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> +</xsl:template> + +<!-- + Source ctxt: (primitive|template)/operations/op + Target ctxt: (primitive|template)/operations/op/meta_attributes + Target-inv ctxt:(primitive|template)/meta_attributes + Dependencies: ProcessNonattrOpMetaAttributes [non-inverse only] + ProcessOpInstanceAttributes [non-inverse only] + --> +<xsl:template name="cibtr:ProcessAttrOpMetaAttributes"> + <xsl:param name="Source"/> + <xsl:param name="InverseMode" select="false()"/> + <xsl:param name="InnerSimulation" select="false()"/> + <xsl:param name="InnerPass"> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="''"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="InverseMode" select="$InverseMode"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + + <xsl:variable name="EnclosingTag" select="../.."/> + + <xsl:if test="( + $InverseMode + and + ( + $InnerSimulation + or + normalize-space($InnerPass) + != string($InnerPass) + ) + ) + or + not($InverseMode)"> + <xsl:if test="$InverseMode + and + $InnerSimulation"> + <xsl:call-template name="cibtr:HelperDenormalizedSpace"> + <xsl:with-param name="Source" select="$InnerPass"/> + <xsl:with-param name="ResultTreeFragment" select="true()"/> + </xsl:call-template> + </xsl:if> + + <!-- cannot combine "copy" with creating a new element, hence we mimic + "copy" with recreating the element anew, while still using just + a single for-each loop --> + <xsl:variable name="ParentName"> + <xsl:choose> + <xsl:when test="not($InverseMode)"> + <xsl:value-of select="name()"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="'nvpair'"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:element name="{$ParentName}"> + <!-- B: special-casing @* --> + <xsl:for-each select="@*"> + <xsl:variable name="Replacement" + select="$cibtr:MapResourcesOperation/cibtr:replace[ + @what = name(current()) + and + ( + ( + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/../@name, '|')) + ) + or + ( + not(@in-case-of) + and + not( + $cibtr:MapResourcesOperation/cibtr:replace[ + @what = name(current()) + and + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current()/../@name, '|')) + ] + ) + ) + ) + ]"/> + <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> + <xsl:call-template name="cibtr:MapMsg"> + <xsl:with-param name="Context" + select="concat(../@id, + ' (rsc=', $EnclosingTag/@id, + ')')"/> + <xsl:with-param name="Replacement" select="$Replacement"/> + </xsl:call-template> + </xsl:if> + <xsl:choose> + <!-- use inner simulation to find out if success, + then emit also extra denormalized space --> + <xsl:when test="$InverseMode + and + $Replacement/@where = 'meta_attributes' + and + not( + $EnclosingTag/meta_attributes[ + not(rule) + and + nvpair/@name = $Replacement/@with + ] + )"> + <!-- do not override; do not collide with: + - existing (see last condition above) + - successors sourced like this (see below) --> + <xsl:variable name="SimulateFollowingSiblings"> + <xsl:for-each select="../following-sibling::op"> + <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <xsl:if test="not(contains($SimulateFollowingSiblings, + concat(name(), ' ')))"> + <!-- fix concurrent op/@* sources (these themselves are winning + over sources from meta_attributes --> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <!-- cf. trick C. (indicate for inverse mode) --> + <xsl:value-of select="concat(name(), ' ')"/> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="id"> + <xsl:value-of select="concat('_2TO3_', ../@id, '-meta-', + $Replacement/@with)"/> + </xsl:attribute> + <xsl:attribute name="name"> + <xsl:value-of select="$Replacement/@with"/> + </xsl:attribute> + <xsl:attribute name="value"> + <xsl:value-of select="."/> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </xsl:when> + <xsl:when test="$InverseMode"/> + <xsl:when test="$Replacement + and + ( + not(string($Replacement/@with)) + or + $Replacement/@where + )"> + <!-- drop (possibly just move over) --> + </xsl:when> + <xsl:when test="$Replacement"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR: ', + $Replacement/../@msg-prefix, + ': no in-situ rename', + ' does not hold')"/> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <!-- E: special-casing @* --> + + <xsl:if test="not($InverseMode)"> + <!-- Look ahead if there are any meta-like instance_attibutes to + be propagated next door, into existing/new meta_attributes --> + <xsl:variable name="ProcessedInverseNonruleOpInstanceAttributes"> + <xsl:for-each select="instance_attributes[not(rule)]"> + <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="true()"/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerPass" + select="substring-after( + concat( + string($InnerSimulation), + 'TRIGGER-MSG' + ), + 'true' + )"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <!-- B: special-casing instance_attributes|meta_attributes --> + <xsl:for-each select="$Source/node()"> + <xsl:choose> + <xsl:when test="self::text()"> + <!-- cf. trick A. (consideration 1.) --> + <xsl:choose> + <xsl:when test="normalize-space($InnerPass) + != $InnerPass + and + ( + not(following-sibling::nvpair) + or + generate-id(following-sibling::nvpair[1]) + != generate-id(following-sibling::*[1]) + )"> + <xsl:value-of select="."/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(.)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="self::instance_attributes"> + <xsl:variable name="ProcessedOpInstanceAttributes"> + <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:variable> + <!-- cf. trick A. --> + <xsl:if test="normalize-space($ProcessedOpInstanceAttributes) + != $ProcessedOpInstanceAttributes"> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + <!-- cf. trick E. --> + <xsl:with-param name="InnerPass" select="$ProcessedOpInstanceAttributes"/> + </xsl:call-template> + </xsl:copy> + </xsl:if> + </xsl:when> + <xsl:when test="self::meta_attributes"> + <xsl:variable name="ProcessedOpMetaAttributes"> + <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="true()"/> + <xsl:with-param name="InnerPass" + select="substring-after( + concat( + string($InnerSimulation), + 'TRIGGER-MSG' + ), + 'true' + )"/> + </xsl:call-template> + </xsl:variable> + <!-- cf. trick A.; + possibly piggy-back instance_attributes (if any per + above look ahead) to first suitable (not rules-driven) + meta_attributes set... --> + <xsl:if test="normalize-space($ProcessedOpMetaAttributes) + != $ProcessedOpMetaAttributes + or + ( + not(rule) + and + not(preceding-sibling::meta_attributes[not(rule)]) + and + normalize-space($ProcessedInverseNonruleOpInstanceAttributes) + != $ProcessedInverseNonruleOpInstanceAttributes + )"> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <xsl:if test="normalize-space($ProcessedOpMetaAttributes) + != $ProcessedOpMetaAttributes"> + <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + <!-- cf. trick E. --> + <xsl:with-param name="InnerPass" select="$ProcessedOpMetaAttributes"/> + </xsl:call-template> + </xsl:if> + <xsl:if test="not(rule) + and + not(preceding-sibling::meta_attributes[not(rule)]) + and + normalize-space($ProcessedInverseNonruleOpInstanceAttributes) + != $ProcessedInverseNonruleOpInstanceAttributes"> + <xsl:for-each select="../instance_attributes[not(rule)]"> + <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + <xsl:with-param name="InverseMode" select="true()"/> + </xsl:call-template> + </xsl:for-each> + </xsl:if> + </xsl:copy> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <!-- E: special-casing instance_attributes|meta_attributes --> + + <!-- ...or roll out brand new meta_attributes, first collectively + for no-rules instances... --> + <xsl:if test="not(meta_attributes[not(rule)]) + and + normalize-space($ProcessedInverseNonruleOpInstanceAttributes) + != $ProcessedInverseNonruleOpInstanceAttributes"> + <meta_attributes id="{concat('_2TO3_', @id, '-meta')}"> + <xsl:for-each select="instance_attributes[not(rule)]"> + <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + <xsl:with-param name="InverseMode" select="true()"/> + </xsl:call-template> + </xsl:for-each> + <xsl:apply-templates select="text()[position() = last()]" + mode="cibtr:main"/> + </meta_attributes> + <xsl:apply-templates select="text()[position() = last()]" + mode="cibtr:main"/> + </xsl:if> + + <!-- ...then individually for rules-driven ones --> + <xsl:for-each select="instance_attributes[rule]"> + <xsl:variable name="ProcessedInverseRuleOpInstanceAttributes"> + <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="true()"/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerPass" + select="substring-after( + concat( + string($InnerSimulation), + 'TRIGGER-MSG' + ), + 'true' + )"/> + </xsl:call-template> + </xsl:variable> + <!-- cf. trick A. --> + <xsl:if test="normalize-space($ProcessedInverseRuleOpInstanceAttributes) + != $ProcessedInverseRuleOpInstanceAttributes"> + <meta_attributes> + <xsl:apply-templates select="@*[ + name() != 'id' + ]" + mode="cibtr:main"/> + <xsl:attribute name='id'> + <xsl:value-of select="concat('_2TO3_', @id)"/> + </xsl:attribute> + <xsl:apply-templates select="node()[ + name() != 'nvpair' + ]" + mode="cibtr:main"/> + <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <!-- cf. trick E. --> + <xsl:with-param name="InnerPass" select="$ProcessedInverseRuleOpInstanceAttributes"/> + </xsl:call-template> + <xsl:apply-templates select="text()[position() = last()]" + mode="cibtr:main"/> + </meta_attributes> + </xsl:if> + </xsl:for-each> + </xsl:if> + </xsl:element> + </xsl:if> +</xsl:template> + +<!-- + Source ctxt: configuration + Target ctxt: {op,rsc}_defaults/meta_attributes [per $Variant, see below] + Target-inv ctxt:N/A + Dependencies: ProcessClusterProperties + + Variant: 'op_defaults' | 'rsc_defaults' + --> +<xsl:template name="cibtr:ProcessDefaultsNonruleClusterProperties"> + <xsl:param name="Source"/> + <xsl:param name="Variant"/> + <xsl:param name="InnerSimulation" select="false()"/> + <xsl:param name="InnerPass"> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="''"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="Variant" select="$Variant"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + + <xsl:choose> + <xsl:when test="$Source/*[name() = $Variant]/meta_attributes[ + not(rule) + ]"> + <xsl:call-template name="cibtr:ProcessClusterProperties"> + <xsl:with-param name="Source" + select="$Source/crm_config/cluster_property_set[ + not(rule) + ]"/> + <xsl:with-param name="InverseMode" + select="$Source/*[name() = $Variant]/meta_attributes[ + not(rule) + ]"/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:ProcessClusterProperties"> + <xsl:with-param name="Source" + select="$Source/crm_config/cluster_property_set[ + not(rule) + ]"/> + <xsl:with-param name="InverseMode" + select="$Variant"/> + <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- + Source ctxt: configuration + Target ctxt: {op,rsc}_defaults/meta_attributes [per $Variant, see below] + Target-inv ctxt:N/A + Dependencies: ProcessClusterProperties + + Variant: 'op_defaults' | 'rsc_defaults' + --> +<xsl:template name="cibtr:ProcessDefaultsRuleClusterProperties"> + <xsl:param name="Source"/> + <xsl:param name="Variant"/> + <xsl:param name="InnerSimulation" select="false()"/> + <xsl:param name="InnerPass"> + <xsl:choose> + <xsl:when test="$InnerSimulation"> + <xsl:value-of select="''"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:ProcessDefaultsRuleClusterProperties"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="Variant" select="$Variant"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + + <xsl:for-each select="crm_config/cluster_property_set[ + rule + ]"> + <xsl:variable name="ProcessedPartial"> + <xsl:call-template name="cibtr:ProcessClusterProperties"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="InverseMode" select="$Variant"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> + </xsl:call-template> + </xsl:variable> + <xsl:if test="normalize-space($ProcessedPartial) + != $ProcessedPartial"> + <meta_attributes id="{concat('_2TO3_', @id)}"> + <xsl-copy-of select="rule"/> + <xsl:call-template name="cibtr:ProcessClusterProperties"> + <xsl:with-param name="Source" select="$Source"/> + <xsl:with-param name="InverseMode" select="$Variant"/> + </xsl:call-template> + </meta_attributes> + </xsl:if> + </xsl:for-each> +</xsl:template> + +<!-- + + ACTUAL TRANSFORMATION + + --> + +<xsl:template match="cib" mode="cibtr:main"> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <xsl:attribute name="validate-with"> + <xsl:value-of select="concat('pacemaker-', $cibtr:cib-min-ver)"/> + </xsl:attribute> + <xsl:apply-templates select="node()" + mode="cibtr:main"/> + </xsl:copy> +</xsl:template> + +<xsl:template match="cluster_property_set" mode="cibtr:main"> + <xsl:variable name="ProcessedClusterProperties"> + <xsl:call-template name="cibtr:ProcessClusterProperties"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="true()"/> + <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> + </xsl:call-template> + </xsl:variable> + <xsl:if test="normalize-space($ProcessedClusterProperties) + != $ProcessedClusterProperties"> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <xsl:call-template name="cibtr:ProcessClusterProperties"> + <xsl:with-param name="Source" select="."/> + <!-- cf. trick E. --> + <xsl:with-param name="InnerPass" select="$ProcessedClusterProperties"/> + </xsl:call-template> + </xsl:copy> + </xsl:if> +</xsl:template> + +<xsl:template match="rsc_colocation" mode="cibtr:main"> + <xsl:copy> + <xsl:for-each select="@*"> + <xsl:variable name="Replacement" + select="$cibtr:MapConstraintsColocation/cibtr:replace[ + @what = name(current()) + ]"/> + <xsl:call-template name="cibtr:MapMsg"> + <xsl:with-param name="Context" select="../@id"/> + <xsl:with-param name="Replacement" select="$Replacement"/> + </xsl:call-template> + <xsl:choose> + <xsl:when test="$Replacement + and + not(string($Replacement/@with))"> + <!-- drop --> + </xsl:when> + <xsl:when test="$Replacement"> + <!-- rename --> + <xsl:attribute name="{name()}"> + <xsl:value-of select="$Replacement/@with"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <xsl:apply-templates select="node()" + mode="cibtr:main"/> + </xsl:copy> +</xsl:template> + +<xsl:template match="node" mode="cibtr:main"> + <xsl:copy> + <xsl:for-each select="@*"> + <xsl:variable name="Replacement" + select="$cibtr:MapClusterNode/cibtr:replace[ + @what = name(current()) + and + ( + ( + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current(), '|')) + ) + or + ( + not(@in-case-of) + and + not( + $cibtr:MapClusterNode/cibtr:replace[ + @what = name(current()) + and + @in-case-of + and + contains(concat('|', @in-case-of, '|'), + concat('|', current(), '|')) + ] + ) + ) + ) + ]"/> + <xsl:call-template name="cibtr:MapMsg"> + <xsl:with-param name="Context" select="concat(../@uname, ' (id=', ../@id, ')')"/> + <xsl:with-param name="Replacement" select="$Replacement"/> + </xsl:call-template> + <xsl:choose> + <xsl:when test="$Replacement + and + not(string($Replacement/@with))"> + <!-- drop --> + </xsl:when> + <xsl:when test="$Replacement"> + <!-- rename --> + <xsl:attribute name="{$Replacement/@with}"> + <xsl:choose> + <xsl:when test="$Replacement/@redefined-as"> + <xsl:value-of select="$Replacement/@redefined-as"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="."/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <xsl:apply-templates select="node()" + mode="cibtr:main"/> + </xsl:copy> +</xsl:template> + +<!-- + 1a. propagate (primitive|template)/operations/ + op[name() = 'start' or name() = 'promote']/@requires + under new ./meta_attributes/nvpair + + 1b. "move" (primitive|template)/operations/ + op[name() = 'start' or name() = 'promote']/ + meta_attributes/nvpair[@requires] + under ./meta_attributes + + otherwise, just + + 2a. drop (primitive|template)/operations/ + op/@requires + + 2b. drop (primitive|template)/operations/ + op/meta_attributes/nvpair[@requires] + --> +<xsl:template match="primitive|template" mode="cibtr:main"> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <!-- B: special-casing operations|instance_attributes|meta_attributes --> + <xsl:for-each select="node()"> + <xsl:choose> + <xsl:when test="self::operations"> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <!-- B: special-casing op --> + <xsl:for-each select="node()"> + <xsl:choose> + <xsl:when test="self::op"> + <!-- process @*|meta_attributes/nvpair + (keep/drop/move elsewhere) --> + <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <!-- E: special-casing op --> + </xsl:copy> + </xsl:when> + <xsl:when test="self::instance_attributes"> + <xsl:variable name="ProcessedRscInstanceAttributes"> + <xsl:call-template name="cibtr:ProcessRscInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="true()"/> + <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> + </xsl:call-template> + </xsl:variable> + <!-- cf. trick A. --> + <xsl:if test="normalize-space($ProcessedRscInstanceAttributes) + != $ProcessedRscInstanceAttributes"> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <xsl:call-template name="cibtr:ProcessRscInstanceAttributes"> + <xsl:with-param name="Source" select="."/> + <!-- cf. trick E. --> + <xsl:with-param name="InnerPass" select="$ProcessedRscInstanceAttributes"/> + </xsl:call-template> + </xsl:copy> + </xsl:if> + </xsl:when> + <xsl:when test="self::meta_attributes"> + <xsl:variable name="ProcessedRscMetaAttributes"> + <xsl:call-template name="cibtr:ProcessRscMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InnerSimulation" select="true()"/> + <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> + </xsl:call-template> + </xsl:variable> + <!-- cf. trick A. --> + <xsl:if test="normalize-space($ProcessedRscMetaAttributes) + != $ProcessedRscMetaAttributes"> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <xsl:call-template name="cibtr:ProcessRscMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <!-- cf. trick E. --> + <xsl:with-param name="InnerPass" select="$ProcessedRscMetaAttributes"/> + </xsl:call-template> + </xsl:copy> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <!-- E: special-casing operations|instance_attributes|meta_attributes --> + + <!-- add as last meta_attributes block... --> + + <!-- ...indirectly from op attributes --> + <xsl:variable name="ToPropagateFromOp"> + <xsl:for-each select="operations/op"> + <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <!-- cf. trick A. --> + <xsl:if test="normalize-space($ToPropagateFromOp) + != $ToPropagateFromOp"> + <meta_attributes id="{concat('_2TO3_', @id, '-meta')}"> + <xsl:for-each select="operations/op"> + <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + </xsl:call-template> + </xsl:for-each> + <xsl:apply-templates select="text()[position() = last()]" + mode="cibtr:main"/> + </meta_attributes> + <xsl:apply-templates select="text()[position() = last()]" + mode="cibtr:main"/> + </xsl:if> + + <!-- ...directly by picking existing nvpairs of + meta_attributes|instance_attributes --> + <xsl:for-each select="operations/op/meta_attributes + |operations/op/instance_attributes"> + <xsl:variable name="ProcessedOpMetaAttributes"> + <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:variable> + <!-- cf. trick A. --> + <xsl:if test="normalize-space($ProcessedOpMetaAttributes) + != $ProcessedOpMetaAttributes"> + <!-- cannot xsl:copy, need to settle on meta_attributes --> + <meta_attributes> + <xsl:apply-templates select="@*[ + name() != 'id' + ]" + mode="cibtr:main"/> + <xsl:attribute name='id'> + <xsl:value-of select="concat('_2TO3_', @id)"/> + </xsl:attribute> + <xsl:apply-templates select="node()[ + name() != 'nvpair' + ]" + mode="cibtr:main"/> + <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> + <xsl:with-param name="Source" select="."/> + <xsl:with-param name="InverseMode" select="true()"/> + <!-- cf. trick E. --> + <xsl:with-param name="InnerPass" select="$ProcessedOpMetaAttributes"/> + </xsl:call-template> + <xsl:apply-templates select="text()[position() = last()]" + mode="cibtr:main"/> + </meta_attributes> + <xsl:apply-templates select="text()[position() = last()]" + mode="cibtr:main"/> + </xsl:if> + </xsl:for-each> + </xsl:copy> +</xsl:template> + +<xsl:template match="configuration" mode="cibtr:main"> + <xsl:variable name="Configuration" select="."/> + <xsl:variable name="ProcessedOpDefaultsNonruleClusterProperties"> + <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="'op_defaults'"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="ProcessedRscDefaultsNonruleClusterProperties"> + <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="'rsc_defaults'"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="ProcessedOpDefaultsRuleClusterProperties"> + <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="'op_defaults'"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="ProcessedRscDefaultsRuleClusterProperties"> + <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="'rsc_defaults'"/> + <xsl:with-param name="InnerSimulation" select="true()"/> + </xsl:call-template> + </xsl:variable> + + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <!-- B: special-casing {op,rsc}_defaults --> + <xsl:for-each select="node()"> + <xsl:choose> + <xsl:when test="self::op_defaults|self::rsc_defaults"> + <xsl:variable name="WhichDefaults" select="name()"/> + <xsl:copy> + <xsl:apply-templates select="@*" + mode="cibtr:main"/> + <!-- B: special-casing meta_attributes --> + <xsl:for-each select="node()"> + <xsl:copy> + <xsl:choose> + <xsl:when test="self::meta_attributes[ + not(rule) + and + not( + preceding-sibling::meta_attributes[ + not(rule) + ] + ) + ]"> + <xsl:apply-templates select="@*|node()" + mode="cibtr:main"/> + <xsl:if test="$WhichDefaults = 'op_defaults' + or + $WhichDefaults = 'rsc_defaults'"> + <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="$WhichDefaults"/> + </xsl:call-template> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="@*|node()" + mode="cibtr:main"/> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="( + $WhichDefaults = 'op_defaults' + and + normalize-space($ProcessedOpDefaultsRuleClusterProperties) + != $ProcessedOpDefaultsRuleClusterProperties + ) + or + ( + $WhichDefaults = 'rsc_defaults' + and + normalize-space($ProcessedRscDefaultsRuleClusterProperties) + != $ProcessedRscDefaultsRuleClusterProperties + )"> + <xsl:call-template name="cibtr:ProcessDefaultsRuleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="$WhichDefaults"/> + </xsl:call-template> + </xsl:if> + </xsl:copy> + </xsl:for-each> + <!-- E: special-casing meta_attributes --> + </xsl:copy> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="cibtr:HelperIdentity"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <!-- E: special-casing {op,rsc}_defaults --> + <xsl:if test="not(op_defaults) + and + ( + normalize-space($ProcessedOpDefaultsNonruleClusterProperties) + != $ProcessedOpDefaultsNonruleClusterProperties + or + normalize-space($ProcessedOpDefaultsRuleClusterProperties) + != $ProcessedOpDefaultsRuleClusterProperties + )"> + <op_defaults> + <xsl:if test="normalize-space($ProcessedOpDefaultsNonruleClusterProperties) + != $ProcessedOpDefaultsNonruleClusterProperties"> + <meta_attributes id="{concat('_2TO3_', '-op-defaults')}"> + <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="'op_defaults'"/> + </xsl:call-template> + </meta_attributes> + </xsl:if> + <xsl:call-template name="cibtr:ProcessDefaultsRuleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="'op_defaults'"/> + </xsl:call-template> + <xsl:apply-templates select="text()[position() = last()]" + mode="cibtr:main"/> + </op_defaults> + </xsl:if> + <xsl:if test="not(rsc_defaults) + and + ( + normalize-space($ProcessedRscDefaultsNonruleClusterProperties) + != $ProcessedRscDefaultsNonruleClusterProperties + or + normalize-space($ProcessedRscDefaultsRuleClusterProperties) + != $ProcessedRscDefaultsRuleClusterProperties + )"> + <rsc_defaults> + <xsl:if test="normalize-space($ProcessedRscDefaultsNonruleClusterProperties) + != $ProcessedRscDefaultsNonruleClusterProperties"> + <meta_attributes id="{concat('_2TO3_', '-rsc-defaults')}"> + <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="'rsc_defaults'"/> + </xsl:call-template> + </meta_attributes> + </xsl:if> + <xsl:call-template name="cibtr:ProcessDefaultsRuleClusterProperties"> + <xsl:with-param name="Source" select="$Configuration"/> + <xsl:with-param name="Variant" select="'rsc_defaults'"/> + </xsl:call-template> + <xsl:apply-templates select="text()[position() = last()]" + mode="cibtr:main"/> + </rsc_defaults> + </xsl:if> + </xsl:copy> +</xsl:template> + +<!-- used in test files to allow in-browser on-the-fly upgrade reports --> +<xsl:template match="processing-instruction()[ + name() = 'xml-stylesheet' + and + count(..|/) = 1 + ]" + mode="cibtr:main"/> + +<xsl:template match="@*|node()" mode="cibtr:main"> + <xsl:call-template name="cibtr:HelperIdentity"/> +</xsl:template> + +<!-- mode-less, easy to override kick-off --> +<xsl:template match="/"> + <xsl:call-template name="cibtr:HelperIdentity"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/upgrade-detail.xsl b/xml/upgrade-detail.xsl new file mode 100644 index 0000000..da85116 --- /dev/null +++ b/xml/upgrade-detail.xsl @@ -0,0 +1,129 @@ +<!-- + Copyright 2018 Red Hat, Inc. + Author: Jan Pokorny <jpokorny@redhat.com> + Part of pacemaker project + SPDX-License-Identifier: GPL-2.0-or-later + --> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:cibtr-2="http://clusterlabs.org/ns/pacemaker/cibtr-2"> +<xsl:output method="text" encoding="UTF-8"/> + +<xsl:variable name="NL" select="'
'"/> + +<xsl:template name="MapMsg-2"> + <xsl:param name="Replacement"/> + <xsl:choose> + <xsl:when test="not($Replacement)"/> + <xsl:when test="count($Replacement) != 1"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR:', + $Replacement/../@msg-prefix, + ': count($Replacement) != 1', + ' does not hold (', + count($Replacement), ')')"/> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <cibtr-2:noop> + <xsl:choose> + <xsl:when test="string($Replacement/@with)"> + <xsl:choose> + <xsl:when test="string($Replacement/@where)"> + <xsl:if test="not( + contains( + concat('|', $Replacement/../@where-cases, '|'), + concat('|', $Replacement/@where, '|') + ) + )"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat('INTERNAL ERROR:', + $Replacement/../@msg-prefix, + ': $Replacement/@where (', + $Replacement/@where, ') not in ', + concat('|', + $Replacement/../@where-cases, + '|'))"/> + </xsl:message> + </xsl:if> + <xsl:value-of select="concat('moving ', $Replacement/@what, + ' under ', $Replacement/@where)"/> + </xsl:when> + <xsl:when test="$Replacement/@with = $Replacement/@what"> + <xsl:value-of select="concat('keeping ', $Replacement/@what)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat('renaming ', $Replacement/@what)"/> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="concat(' as ', $Replacement/@with)"/> + <xsl:if test="$Replacement/@where"> + <xsl:value-of select="' unless already defined there'"/> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat('dropping ', $Replacement/@what)"/> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="string($Replacement/@redefined-as)"> + <xsl:value-of select="concat(', redefined as ', + $Replacement/@redefined-as)"/> + <xsl:if test="$Replacement/@in-case-of"> + <xsl:value-of select="','"/> + </xsl:if> + </xsl:if> + <xsl:choose> + <xsl:when test="string($Replacement/@in-case-of)"> + <xsl:value-of select="concat(' for matching ', + $Replacement/@in-case-of)"/> + </xsl:when> + <xsl:when test="$Replacement/@in-case-of"> + <xsl:value-of select="' for matching "empty string"'"/> + </xsl:when> + <xsl:when test="$Replacement/@in-case-of-droppable-prefix"> + <xsl:value-of select="concat(' for matching ', + $Replacement/@in-case-of-droppable-prefix, + ' prefix that will, meanwhile, get dropped' + )"/> + </xsl:when> + </xsl:choose> + </cibtr-2:noop> + <xsl:if test="$Replacement/@msg-extra"> + <cibtr-2:noop> + <xsl:value-of select="concat($NL, ' ... ', + $Replacement/@msg-extra)"/> + </cibtr-2:noop> + </xsl:if> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="cibtr-2:map"> + <xsl:value-of select="concat('Translation tables v2 in detail', $NL, + '===============================', $NL, $NL)"/> + <xsl:apply-templates select="*"/> +</xsl:template> + +<xsl:template match="cibtr-2:table"> + <xsl:value-of select="concat('Details for the ', @for, ' table:', $NL)"/> + <xsl:if test="@where-cases"> + <xsl:value-of select="concat($NL, ' Possible to-move specifiers:', $NL, + ' ',' ', @where-cases, $NL)"/> + </xsl:if> + <xsl:value-of select="concat(string(preceding-sibling::comment()[1]), $NL)"/> + <xsl:apply-templates select="*"/> + <xsl:value-of select="$NL"/> +</xsl:template> + +<xsl:template match="cibtr-2:replace"> + <xsl:value-of select="' - '"/> + <xsl:call-template name="MapMsg-2"> + <xsl:with-param name="Replacement" select="."/> + </xsl:call-template> + <xsl:value-of select="$NL"/> +</xsl:template> + +<xsl:template match="*"> + <xsl:apply-templates select="*"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/xml/xslt_cibtr-2.rng b/xml/xslt_cibtr-2.rng new file mode 100644 index 0000000..e7be9b6 --- /dev/null +++ b/xml/xslt_cibtr-2.rng @@ -0,0 +1,16 @@ +<!-- + Copyright 2018-2019 the Pacemaker project contributors + + The version control history for this file may have further details. + + SPDX-License-Identifier: GPL-2.0-or-later + --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0"> + <include href="https://raw.githubusercontent.com/relaxng/jing-trang/master/eg/xslt.rng"> + <define name="top-level-extension"> + <grammar> + <include href="cibtr-2.rng"/> + </grammar> + </define> + </include> +</grammar> |