All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next,v1 0/2] tools/net/ynl: enable json configuration
@ 2023-07-27  8:55 mtahhan
  2023-07-27  8:55 ` [net-next,v1 1/2] tools/net/ynl: configuration through json mtahhan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mtahhan @ 2023-07-27  8:55 UTC (permalink / raw)
  To: netdev, kuba, davem, edumazet, pabeni; +Cc: Maryam Tahhan

From: Maryam Tahhan <mtahhan@redhat.com>

Use a json configuration file to pass parameters to ynl to allow
for operations on multiple specs in one go. Additionally, check
this new configuration against a schema to validate it in the cli
module before parsing it and passing info to the ynl module.

Example configs would be:
{
    "yaml-specs-path": "/<path-to>/linux/Documentation/netlink/specs",
    "spec-args": {
        "ethtool.yaml": {
            "do": "rings-get",
            "json-params": {
                "header": {
                    "dev-name": "eno1"
                }
            }
        },
       "netdev.yaml": {
            "do": "dev-get",
            "json-params": {
            "ifindex": 3
            }
        }
    }
}

OR

{
    "yaml-specs-path": "/<path-to>/linux/Documentation/netlink/specs",
    "spec-args": {
        "ethtool.yaml": {
            "subscribe": "monitor",
            "sleep": 10
        },
        "netdev.yaml": {
            "subscribe": "mgmt",
            "sleep": 5
        }
    }
}

Maryam Tahhan (2):
  tools/net/ynl: configuration through json
  tools/net/ynl: validate config against schema

 tools/net/ynl/cli.py            | 135 +++++++++++++++++++++++++++-----
 tools/net/ynl/ynl-config.schema |  72 +++++++++++++++++
 2 files changed, 187 insertions(+), 20 deletions(-)
 create mode 100644 tools/net/ynl/ynl-config.schema

-- 
2.39.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-27  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27  8:55 [net-next,v1 0/2] tools/net/ynl: enable json configuration mtahhan
2023-07-27  8:55 ` [net-next,v1 1/2] tools/net/ynl: configuration through json mtahhan
2023-07-27  8:55 ` [net-next,v1 2/2] tools/net/ynl: validate config against schema mtahhan
2023-07-27  9:38 ` [net-next,v1 0/2] tools/net/ynl: enable json configuration Maryam Tahhan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.