* Added defaults parameter to clicon_rpc_get_pageable_list()

* Test: Replaced bash coverage script with binary
This commit is contained in:
Olof hagsand 2022-09-28 15:16:02 +02:00
parent e3f3d772c7
commit bae92488e9
6 changed files with 30 additions and 6 deletions

View file

@ -1,6 +1,6 @@
# Clixon Changelog
* [6.0.0](#600) Expected: November 2022
* [6.0.0](#600) Expected: End of 2022
* [5.9.0](#590) 24 September 2022
* [5.8.0](#580) 28 July 2022
* [5.7.0](#570) 17 May 2022
@ -38,7 +38,21 @@
* [3.3.1](#331) June 7 2017
## 6.0.0
Expected: November 2022
Expected: End of 2022
### API changes on existing protocol/config features
Users may have to change how they access the system
* NETCONF: Removed `message-id` from hello protocol following RFC 6241
* See [message-id present on netconf app "hello"](https://github.com/clicon/clixon/issues/369)
### C/CLI-API changes on existing features
Developers may need to change their code
* C API changes
* Added `defaults` parameter to `clicon_rpc_get_pageable_list()`
### Corrected Bugs
@ -103,6 +117,9 @@ Users may have to change how they access the system
Developers may need to change their code
* C API changes
* Added `defaults` parameter to `clicon_rpc_get()` and `clicon_rpc_get_config()`
* For upgrade, add new sixth parameter and set it to `NULL`.
* CLISPEC changes of cli show functions
* For details of updated API, see https://clixon-docs.readthedocs.io/en/latest/cli.html#show-commands
* Changed `cli_show_auto()`

View file

@ -1187,7 +1187,8 @@ cli_pagination(clicon_handle h,
for (i = 0;; i++){
if (clicon_rpc_get_pageable_list(h, "running", xpath, nsc,
CONTENT_ALL,
-1, /* depth */
-1, /* depth */
NULL, /* with-default */
limit*i, /* offset */
limit, /* limit */
NULL, NULL, NULL, /* nyi */

View file

@ -486,7 +486,7 @@ api_data_pagination(clicon_handle h,
sort = cvec_find_str(qvec, "sort-by");
where = cvec_find_str(qvec, "where");
if (clicon_rpc_get_pageable_list(h, "running", xpath, nsc, content,
depth, offset, limit, direction, sort, where,
depth, NULL, offset, limit, direction, sort, where,
&xret) < 0){
if (netconf_operation_failed_xml(&xerr, "protocol", clicon_err_reason) < 0)
goto done;

View file

@ -56,7 +56,7 @@ int clicon_rpc_lock(clicon_handle h, char *db);
int clicon_rpc_unlock(clicon_handle h, char *db);
int clicon_rpc_get(clicon_handle h, char *xpath, cvec *nsc, netconf_content content, int32_t depth, char *defaults, cxobj **xret);
int clicon_rpc_get_pageable_list(clicon_handle h, char *datastore, char *xpath,
cvec *nsc, netconf_content content, int32_t depth,
cvec *nsc, netconf_content content, int32_t depth, char *defaults,
uint32_t offset, uint32_t limit,
char *direction, char *sort, char *where,
cxobj **xt);

View file

@ -982,6 +982,7 @@ clicon_rpc_get(clicon_handle h,
* @param[in] nsc Namespace context for filter
* @param[in] content Clixon extension: all, config, noconfig. -1 means all
* @param[in] depth Nr of XML levels to get, -1 is all, 0 is none
* @param[in] defaults Value of the with-defaults mode, rfc6243, or NULL
* @param[in] offset uint32, 0 means none
* @param[in] limit uint32, 0 means unbounded
* @param[in] direction Collection/clixon extension
@ -1002,6 +1003,7 @@ clicon_rpc_get_pageable_list(clicon_handle h,
cvec *nsc, /* namespace context for xpath */
netconf_content content,
int32_t depth,
char *defaults,
uint32_t offset,
uint32_t limit,
char *direction,
@ -1053,6 +1055,10 @@ clicon_rpc_get_pageable_list(clicon_handle h,
goto done;
cprintf(cb, "/>");
}
if (defaults != NULL)
cprintf(cb, "<with-defaults xmlns=\"%s\">%s</with-defaults>",
IETF_NETCONF_WITH_DEFAULTS_YANG_NAMESPACE,
defaults);
/* Explicit use of list-pagination */
cprintf(cb, "<list-pagination xmlns=\"%s\">", IETF_PAGINATON_NC_NAMESPACE);
if (offset != 0)

View file

@ -36,7 +36,7 @@ find . -name "*.gcda" | xargs sudo chmod 777
(cd test; clixon_restconf="clixon_restconf -r" ./sum.sh)
# Push coverage
bash <(curl -s https://codecov.io/bash) -t ${TOKEN}
codecov -t ${CODECOV_TOKEN} -g -f *.gcda -r clicon/clixon.git
# Remove all coverage files (after gcov push)
find . -name "*.gcda" | xargs rm