Skip to content

tools/net/ynl: enable json configuration

Maryam Tahhan netdev 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesIn review
  2. v12 patches 1 replySuperseded

Changes in v2 from the cover letter

- Removed From:... that was preceding the commit description.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tools/net/ynl: configuration through jsontools/net/ynl/cli.py+87 -211 reply
2/2tools/net/ynl: validate config against schematools/net/ynl/cli.py tools/net/ynl/ynl-config.schema+108 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH net-next v2 0/2] tools/net/ynl: enable json configuration

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
        }
    }
}

v2:
- Removed From:... that was preceding the commit description.

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
Signature · 1 line
2.41.0