docs: adjust map_filter_syntax to rst

This commit is contained in:
Christian Schwarz 2017-11-10 13:20:56 +01:00
parent 828c2982f3
commit 597302de3f
2 changed files with 18 additions and 16 deletions

View File

@ -1,7 +1,9 @@
.. include:: ../global.rst.inc
Mapping & Filter Syntax Mapping & Filter Syntax
======================= =======================
For various job types, a filesystem `mapping` or `filter` needs to be For various job types, a filesystem ``mapping`` or ``filter`` needs to be
specified. specified.
Both have in common that they take a filesystem path (in the ZFS filesystem hierarchy)as parameters and return something. Both have in common that they take a filesystem path (in the ZFS filesystem hierarchy)as parameters and return something.
@ -13,18 +15,19 @@ Common Pattern Syntax
--------------------- ---------------------
A mapping / filter is specified as a **YAML dictionary** with patterns as keys and A mapping / filter is specified as a **YAML dictionary** with patterns as keys and
results as values.<br /> results as values.
The following rules determine which result is chosen for a given filesystem path: The following rules determine which result is chosen for a given filesystem path:
* More specific path patterns win over less specific ones * More specific path patterns win over less specific ones
* Non-wildcard patterns (full path patterns) win over *subtree wildcards* (`<` at end of pattern) * Non-wildcard patterns (full path patterns) win over *subtree wildcards* (`<` at end of pattern)
The **subtree wildcard** `<` means "*the dataset left of `<` and all its children*". The **subtree wildcard** ``<`` means "*the dataset left of ``<`` and all its children*".
Example Example
~~~~~~~ ~~~~~~~
:: ::
# Rule number and its pattern # Rule number and its pattern
1: tank< # tank and all its children 1: tank< # tank and all its children
2: tank/foo/bar # full path pattern (no wildcard) 2: tank/foo/bar # full path pattern (no wildcard)
@ -43,15 +46,16 @@ Mappings
-------- --------
Mappings map a *source filesystem path* to a *target filesystem path*. Mappings map a *source filesystem path* to a *target filesystem path*.
Per pattern, either a target filesystem path or `"!"` is specified as a result. Per pattern, either a target filesystem path or ``"!"`` is specified as a result.
* If no pattern matches, there exists no target filesystem (`NO MATCH`). * If no pattern matches, there exists no target filesystem (``NO MATCH``).
* If the result is a `"!"`, there exists no target filesystem (`NO MATCH`). * If the result is a ``"!"``, there exists no target filesystem (``NO MATCH``).
* If the pattern is a non-wildcard pattern, the source path is mapped to the target path on the right. * If the pattern is a non-wildcard pattern, the source path is mapped to the target path on the right.
* If the pattern ends with a *subtree wildcard* (`<`), the source path is **prefix-trimmed** with the path specified left of `<`. * If the pattern ends with a *subtree wildcard* (``<``), the source path is **prefix-trimmed** with the path specified left of ``<``.
* Note: this means that only for *wildcard-only* patterns (pattern=`<` ) is the source path simply appended to the target path.
The example is from the {{< sampleconflink "localbackup/host1.yml" >}} example config. * Note: this means that only for *wildcard-only* patterns (pattern=``<`` ) is the source path simply appended to the target path.
The example is from the :sampleconf:`localbackup/host1.yml` example config.
:: ::
@ -66,7 +70,6 @@ The example is from the {{< sampleconflink "localbackup/host1.yml" >}} example c
} }
... ...
Results in the following mappings
:: ::
@ -84,13 +87,10 @@ Results in the following mappings
Filters Filters
------- -------
Valid filter results: `ok` or `!`. Valid filter results: ``ok`` or ``!``.
The example below show the source job from the [tutorial]({{< relref "tutorial/_index.md#configure-app-srv" >}}): The example below show the source job from the :ref:`tutorial <tutorial-configure-app-srv>`:
The corresponding pull job is allowed access to ``zroot/var/db``, ``zroot/usr/home`` + children except ``zroot/usr/home/paranoid``::
The client is allowed access to `zroot/var/db`, `zroot/usr/home` + children except `zroot/usr/home/paranoid`.
::
jobs: jobs:
- name: pull_backup - name: pull_backup

View File

@ -96,6 +96,8 @@ Thus, it is sufficient to create one keypair and use it for all ``connect`` dire
Learn more about :ref:`transport-ssh+stdinserver` transport and the :ref:`pull job <job-pull>` format. Learn more about :ref:`transport-ssh+stdinserver` transport and the :ref:`pull job <job-pull>` format.
.. _tutorial-configure-app-srv:
Configure ``app-srv`` Configure ``app-srv``
--------------------- ---------------------