From 68e132c275248b7f40431032d6bb6f99b5bc2e22 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Thu, 21 Nov 2024 10:58:30 +0100 Subject: [PATCH] Re-arranged yang, minor docs github actions, re-balanced jobs --- .github/workflows/ci.yml | 4 +- apps/cli/cli_generate.c | 2 +- example/main/README.md | 4 +- yang/clixon/clixon-config@2024-11-01.yang | 46 ++++++++++++----------- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 307529d2..f5fa4f32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: - name: start container run: ./start.sh - name: run test a-m,p - run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_a*.sh test_c*.sh test_d*.sh test_f*.sh test_h*.sh test_i*.sh test_j*.sh test_l*.sh test_m*.sh test_o*.sh" ./sum.sh' + run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_a*.sh test_c*.sh test_d*.sh test_f*.sh test_h*.sh test_i*.sh test_j*.sh test_l*.sh test_m*.sh test_o*.sh test_x*.sh test_y*.sh" ./sum.sh' docker-alpine-test-2: runs-on: ubuntu-latest @@ -143,7 +143,7 @@ jobs: - name: start container run: ./start.sh - name: run test r-y - run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_r*.sh test_s*.sh test_t*.sh test_u*.sh test_w*.sh test_x*.sh test_y*.sh" ./sum.sh' + run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_r*.sh test_s*.sh test_t*.sh test_u*.sh test_w*.sh" ./sum.sh' docker-alpine-test-fcgi-r: runs-on: ubuntu-latest diff --git a/apps/cli/cli_generate.c b/apps/cli/cli_generate.c index f31485e3..0420b13f 100644 --- a/apps/cli/cli_generate.c +++ b/apps/cli/cli_generate.c @@ -1970,7 +1970,7 @@ yang2cli_grouping_wrap(cligen_handle ch, /*! Init yang2cli * * Initialize CLIgen generation from YANG models. - * Some logic around grouping-treeref: if enabled, then groupings are sperate trees with lazy + * Some logic around grouping-treeref: if enabled, then groupings are separate trees with lazy * evaluation. Only expanded when referenced, but need a callback. If one is not already installed. * @param[in] h Clixon handle */ diff --git a/example/main/README.md b/example/main/README.md index 9c696498..e5d61eb2 100644 --- a/example/main/README.md +++ b/example/main/README.md @@ -5,7 +5,7 @@ * [Compile and run](#compile) * [Using the CLI](#using-the-cli) * [Using netconf](#using-netconf) - * [Streams](#streams) + * [Event Streams](#event-streams) * [RPC Operations](#rpc-operations) * [State data](#state-data) * [Extensions](#extension) @@ -265,7 +265,7 @@ then access using curl or wget: curl -X GET http://127.0.0.1/restconf/data/clixon-example:table/parameter=a/value ``` -## Streams +## Event streams The example has an EXAMPLE stream notification triggering every 5s. To start a notification stream in the session using netconf, create a subscription: diff --git a/yang/clixon/clixon-config@2024-11-01.yang b/yang/clixon/clixon-config@2024-11-01.yang index 79838fdd..57598cba 100644 --- a/yang/clixon/clixon-config@2024-11-01.yang +++ b/yang/clixon/clixon-config@2024-11-01.yang @@ -1365,7 +1365,21 @@ module clixon-config { in module ietf-restconf-monitoring.yang Note that the name of this option is misleading, the monitoring module defines state for both capabilities and streams, not only streams which the name indicates. - Also, consider changinf default to true."; + Also, consider changing default to true."; + } + leaf CLICON_STREAM_URL { + type string; + default "https://localhost"; + description + "Stream URL + See RFC 8040 Sec 9.3 location leaf: + 'Contains a URL that represents the entry point for + establishing notification delivery via server-sent events.' + Prepend this constant to name of stream. + Example: https://localhost/streams/NETCONF. Note this is the + external URL, not local behind a reverse-proxy. + Note that -s command-line option to clixon_restconf + should correspond to last path of url (eg 'streams')"; } leaf CLICON_STREAM_PATH { type string; @@ -1376,34 +1390,24 @@ module clixon-config { See CLICON_RESTCONF_API_ROOT and CLICON_HTTP_DATA_ROOT Should be changed to include '/' "; } - leaf CLICON_STREAM_URL { - type string; - default "https://localhost"; - description "Prepend this to CLICON_STREAM_PATH to form URL. - See RFC 8040 Sec 9.3 location leaf: - 'Contains a URL that represents the entry point for - establishing notification delivery via server-sent events.' - Prepend this constant to name of stream. - Example: https://localhost/streams/NETCONF. Note this is the - external URL, not local behind a reverse-proxy. - Note that -s command-line option to clixon_restconf - should correspond to last path of url (eg 'streams')"; + leaf CLICON_STREAM_RETENTION { + type uint32; + default 3600; + units s; + description + "Retention for stream replay buffers in seconds, ie how much + data to store before dropping. 0 means no retention"; } leaf CLICON_STREAM_PUB { type string; - description "For stream publish using eg nchan, the base address + description + "For stream publish using eg nchan, the base address to publish to. Example value: http://localhost/pub Example: stream NETCONF would then be pushed to http://localhost/pub/NETCONF. Note this may be a local/provate URL behind reverse-proxy. If not given, do NOT enable stream publishing using NCHAN."; - } - leaf CLICON_STREAM_RETENTION { - type uint32; - default 3600; - units s; - description "Retention for stream replay buffers in seconds, ie how much - data to store before dropping. 0 means no retention"; + status obsolete; } /* Log and debug */ leaf CLICON_DEBUG{