- Changed media name: yang.collection+xml/yang to application-collection+xml/json

- Modified ietf-netconf-list-pagination.yang:
     - changed get-pagable ->  get-pageable
     - renamed count -> limit
     - renamed skip -> offset
     - added import ietf-yang-metadata
     - added md:annotation remaining
This commit is contained in:
Olof hagsand 2021-08-05 18:08:32 +02:00
parent 0c7f2043f3
commit 76e59873c2
11 changed files with 57 additions and 29 deletions

View file

@ -1664,7 +1664,7 @@ from_client_get_pageable_list(clicon_handle h,
goto done;
if (xml_prefix_set(xa, "lpg") < 0)
goto done;
if (xmlns_set(x, "lpg", "urn:ietf:params:xml:ns:yang:ietf-list-pagination") < 0)
if (xmlns_set(x, "ycoll", "urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination") < 0)
goto done;
}
/* Top level is data, so add 1 to depth if significant */
@ -2326,7 +2326,7 @@ backend_rpc_init(clicon_handle h)
#ifdef LIST_PAGINATION
/* draft-ietf-netconf-restconf-collection-00 */
if (rpc_callback_register(h, from_client_get_pageable_list, NULL,
NETCONF_COLLECTION_NAMESPACE, "get-pagable-list") < 0)
NETCONF_COLLECTION_NAMESPACE, "get-pageable-list") < 0)
goto done;
#endif
/* In backend_client.? RPC from RFC 5277 */

View file

@ -85,7 +85,7 @@ restconf_reply_header(void *req0,
int retval = -1;
restconf_stream_data *sd = (restconf_stream_data *)req0;
restconf_conn *rc;
size_t vlen;
size_t vlen;
char *value = NULL;
va_list ap;
@ -128,7 +128,7 @@ restconf_reply_header(void *req0,
/*! Send HTTP reply with potential message body
* @param[in] req http request handle
* @param[in] cb Body as a cbuf if non-NULL. Note is consumed
* @param[in] cb Body as a cbuf if non-NULL. Note: is consumed, dont free or reset after call
* @param[in] head Only send headers, dont send body.
*
* Prerequisites: status code set, headers given, body if wanted set

View file

@ -207,8 +207,8 @@ static const map_str2int http_media_map[] = {
{"application/yang-data+json", YANG_DATA_JSON},
{"application/yang-patch+xml", YANG_PATCH_XML},
{"application/yang-patch+json", YANG_PATCH_JSON},
{"application/yang.collection+xml", YANG_COLLECTION_XML},
{"application/yang.collection+json", YANG_COLLECTION_JSON},
{"application/yang-collection+xml", YANG_COLLECTION_XML},
{"application/yang-collection+json", YANG_COLLECTION_JSON},
{NULL, -1}
};

View file

@ -507,6 +507,7 @@ api_data_collection(clicon_handle h,
goto done;
if (restconf_reply_send(req, 200, cbx, 0 /* XXX head */) < 0)
goto done;
cbx = NULL; /* is consumed by above */
ok:
retval = 0;
done: