view doc/libervia-cli/pubsub_node_schema.rst @ 4300:7ded09452875

plugin XEP-0077, XEP-0100: Adapt to component, and modernize: - Plugin XEP-0077 can now be used with component, allowing to register methods to return registration form, and to (un)register. - Plugin XEP-0077 now advertises its feature in disco. - Plugin XEP-0100 has been modernized a bit: it is one of the older plugin in Libervia, and it has now some type hints, models and async methods. - Plugin XEP-0100's bridge method `gateways_find` now returns a serialised dict with relevant data. Former XMLUI version has been moved to `gateways_find_xmlui`. rel 449
author Goffi <goffi@goffi.org>
date Fri, 06 Sep 2024 18:01:31 +0200
parents 267e4987b58b
children
line wrap: on
line source

.. _libervia-cli_pubsub_node_schema:

=========================================
pubsub/node/schema: nodes schema handling
=========================================

``node schema`` is an experimental feature to associate a data form with a PubSub node, and
reject items not following this form. This feature is currently only available with Libervia
PubSub.

Those commands can only be used by an owner of the node.

set
===

Set the schema of a node. The raw schema is written directly as positional argument.

example
-------

Set the schema for tickets node using the file ``tickets_schema.xml`` from ``$HOME``
directory. Shell substition is used here to put the content of the file in the positional
argument::

  $ li pubsub node schema set -n org.salut-a-toi.tickets:0 -s pubsub.example.org "$(<~/test_schema.xml)"


edit
====

Edit the schema of a node using your local editor (the one set in ``$EDITOR``).

If you don't change anything or publish an empty schema, the edition will be cancelled.

:ref:`draft_common` commands can be used.

example
-------

Edit the tickets node schema::

  $ li pubsub node schema edit -n org.salut-a-toi.tickets:0 -s pubsub.example.org


example
-------

get
===

Retrieve schema of a node.

example
-------

Get schema of tickets and save it to a file named ``tickets_schema.xml`` in ``$HOME``
directory::

  $ li pubsub node schema get -n org.salut-a-toi.tickets:0 -s pubsub.example.org > ~/tickets_schema.xml