From: Wesley Coakley Date: Fri, 22 May 2020 15:36:52 +0000 (-0400) Subject: doc: document json for remaining `show pbr` cmds X-Git-Tag: base_7.5~324^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=144fd50f64f60590bc47efe28b64c7b406a073ab;p=matthieu%2Ffrr.git doc: document json for remaining `show pbr` cmds Signed-off-by: Wesley Coakley --- diff --git a/doc/user/pbr.rst b/doc/user/pbr.rst index b07cc259d7..af4c7c932b 100644 --- a/doc/user/pbr.rst +++ b/doc/user/pbr.rst @@ -59,8 +59,33 @@ Showing Nexthop Group Information .. clicmd:: show pbr nexthop-groups [NAME] [json] Display information on a PBR nexthop-group. If ``NAME`` is omitted, all - nexthop groups are shown. Setting ``json`` will provide the same information - in a predictable and parsable format. + nexthop groups are shown. Setting ``json`` will provide the same + information in an array of objects which obey the schema below: + + +-------------+----------------------------+---------+ + | Key | Description | Type | + +=============+============================+=========+ + | id | Unique ID | Integer | + +-------------+----------------------------+---------+ + | name | Name of this group | String | + +-------------+----------------------------+---------+ + | isValud | Is this group well-formed? | Boolean | + +-------------+----------------------------+---------+ + | isInstalled | ... and is it installed? | Boolean | + +-------------+----------------------------+---------+ + | nexthops | Nexthops within this group | Array | + +-------------+----------------------------+---------+ + + Each element within ``nexthops`` describes a single target within this + group, and its structure is described by the JSON below: + + +---------+------------------------------+---------+ + | Key | Description | Type | + +=========+==============================+=========+ + | target | Name of this nexthop | String | + +---------+------------------------------+---------+ + | isValid | Is this nexthop well-formed? | Boolean | + +---------+------------------------------+---------+ .. _pbr-maps: @@ -121,8 +146,63 @@ end destination. Display pbr maps either all or by ``NAME``. If ``detail`` is set, it will give information about the rules unique ID used internally and some extra debugging information about install state for the nexthop/nexthop group. - Setting ``json`` will provide the same information in a predictable and - parsable format. + Setting ``json`` will provide the same information in an array of objects + which obey the schema below: + + +--------------+--------------------------------+---------+ + | Key | Description | Type | + +==============+================================+=========+ + | name | Map name | String | + +--------------+--------------------------------+---------+ + | isValid | Is the map well-formed? | Boolean | + +--------------+--------------------------------+---------+ + | sequences | Rules to match packets against | Array | + +--------------+--------------------------------+---------+ + + Each element of the ``sequences`` array is composed of a handful of objects + representing the policies associated with this map. Each policy is + described as below (not all fields are required): + + +-----------------+-------------------------------------------+---------+ + | Key | Description | Type | + +=================+===========================================+=========+ + | id | Unique ID | Integer | + +-----------------+-------------------------------------------+---------+ + | sequenceNumber | Order of this policy within the map | Integer | + +-----------------+-------------------------------------------+---------+ + | ruleNumber | Rule number to install into | Integer | + +-----------------+-------------------------------------------+---------+ + | vrfUnchanged | Use interface's VRF | Boolean | + +-----------------+-------------------------------------------+---------+ + | isInstalled | Is this policy installed? | Boolean | + +-----------------+-------------------------------------------+---------+ + | installedReason | Why (or why not?) | String | + +-----------------+-------------------------------------------+---------+ + | matchSrc | Match packets with this source address | String | + +-----------------+-------------------------------------------+---------+ + | matchDst | ... or with this destination address | String | + +-----------------+-------------------------------------------+---------+ + | matchMark | ... or with this marker | Integer | + +-----------------+-------------------------------------------+---------+ + | vrfName | Associated VRF (if relevant) | String | + +-----------------+-------------------------------------------+---------+ + | nexthopGroup | This policy's nexthop group (if relevant) | Object | + +-----------------+-------------------------------------------+---------+ + + Finally, the ``nexthopGroup`` object above cotains information we know + about the configured nexthop for this policy: + + +-----------------------+--------------------------------------+---------+ + | Key | Description | Type | + +=======================+======================================+=========+ + | id | Nexthop table ID | Integer | + +-----------------------+--------------------------------------+---------+ + | name | Name of the nexthop group | String | + +-----------------------+--------------------------------------+---------+ + | isInstalled | Is this nexthop group installed? | Boolean | + +-----------------------+--------------------------------------+---------+ + | isInstalledInternally | Do we think this group is installed? | Integer | + +-----------------------+--------------------------------------+---------+ .. _pbr-policy: