Skip to content

Commit

Permalink
doc: Update MGMTd documentation
Browse files Browse the repository at this point in the history
This commit updates the existing MGMTd user and developer documentations
with details regarding the new support for retrieving operational
data via the MGMT Front-end interface.

Signed-off-by: Pushpasis Sarkar <pushpasis@gmail.com>
  • Loading branch information
pushpasis committed Sep 14, 2023
1 parent 25984bf commit c0b19f0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
29 changes: 29 additions & 0 deletions doc/developer/mgmtd-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,35 @@ Below are the strings added for staticd support:
#endif
};
The abobe example adds 'staticd' as a configuration validator for certain xpaths
under the overall data subtree in 'running' and 'candidate' datastores.
However, sometimes daemons may also need to provide operational data and state
via the MGMT frontend interface. Below is an example how the zebra daemon
can add support for retrieveing oprational data for the data subtree it
represents under the entire data tree in the operational datastore.

.. code-block:: c
static struct mgmt_be_client_xpath zebra_xpaths[] = {
{
.xpath = "/frr-zebra:zebra/*",
.subscribed = MGMT_SUBSCR_VALIDATE_CFG | MGMT_SUBSCR_NOTIFY_CFG
| MGMT_SUBSCR_OPER_OWN,
},
{
.xpath = "/frr-vrf:lib/vrf[name='*']/frr-zebra:zebra/*",
.subscribed = MGMT_SUBSCR_VALIDATE_CFG | MGMT_SUBSCR_NOTIFY_CFG
| MGMT_SUBSCR_OPER_OWN,
},
};
static struct mgmt_be_client_xpath_map
mgmt_client_xpaths[MGMTD_BE_CLIENT_ID_MAX] = {
...
[MGMTD_BE_CLIENT_ID_ZEBRA] = {zebra_xpaths,
array_size(zebra_xpaths)},
...
};
MGMTD Internals
^^^^^^^^^^^^^^^
Expand Down
20 changes: 12 additions & 8 deletions doc/user/mgmtd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -347,19 +347,23 @@ MGMT Show commands
.. clicmd:: show mgmt get-config [candidate|running] XPATH

This command uses the GET_CONFIG operation over the MGMT Frontend interface and
returns the xpaths and values of the nodes of the subtree pointed by the <xpath>.
returns the xpaths and values of the nodes of the subtree pointed by the <xpath>
from the specifed datastore. Currenlty only supported values for datastore are
'candidate' and 'running'.

.. clicmd:: show mgmt get-data [candidate|operation|running] XPATH
.. clicmd:: show mgmt get-data operational XPATH

This command uses the GET_DATA operation over the MGMT Frontend interface and
returns the xpaths and values of the nodes of the subtree pointed by the <xpath>.
Currenlty supported values for 'candidate' and 'running' only
('operational' shall be supported in future soon).
returns the xpaths and values of the nodes of the subtree pointed by the <xpath>
from a specified datastore. Currenlty only supported values for datastore is
'operational'. GET-DATA operation on 'running' and 'candidate' are not allowed
(use the 'show mgmt get-config [candidate|running]' instead).

.. clicmd:: show mgmt database-contents [candidate|operation|running] [xpath WORD] [file WORD] json|xml
.. clicmd:: show mgmt database-contents [candidate|running] [xpath WORD] [file WORD] json|xml

This command dumps the subtree pointed by the xpath in JSON or XML format. If filepath is
not present then the tree will be printed on the shell.
This command dumps the subtree pointed by the xpath from a specifed datastore
in JSON or XML format. If filepath is not present then the tree will be printed on the
shell. Currenlty only supported values for datastore are 'candidate' and 'running'.

.. clicmd:: show mgmt commit-history

Expand Down

0 comments on commit c0b19f0

Please sign in to comment.