If you have worked with access permissions, you have encountered the concept of CRUD (Create, Read, Update, Delete) data access controls. One user may have permission to only read certain data while another user may have permission to only read and update existing data and yet another user can read and update existing plus also create new data or delete existing data. CRUD applies to more than just access permissions.
Corresponding to the access control permissions, there are CRUD operations built into NETCONF and RESTCONF as well. In NETCONF, you can build up a transaction using multiple separate operations (i.e. Network API calls). In NETCONF, as well, you can populate different types of CRUD operations into one NETCONF RPC. However, in RESTCONF, as originally defined in RFC 8040, neither of these use cases is possible.
In order to be RESTful, each RESTCONF call is its own transaction. Therefore, you cannot use multiple calls in RESTCONF to, e.g., update some data in one call, delete some other data in another call, and then commit the transaction. It all must be done in one call in order to be in the same transaction. Additionally, as originally defined, RESTCONF could only carry one type of CRUD operation in each call. Therefore, you could not update some data and delete some other data within the same RESTCONF call and, hence, one transaction.
The IETF NETCONF Working Group, which maintains the RESTCONF standards, recognized that this was a limitation which needed to be addressed. While the limitation of multiple calls to build up a transaction could not be changed, as otherwise RESTCONF would violate core RESTful principles, a solution was found to remove the limitation on mixing different types of CRUD operations in one RESTCONF call. The result was RFC 8072 “YANG Patch Media Type” which is referred to as “YANG Patch”.
Our latest application note, “YANG Patch and RESTCONF”, looks at and explains this feature which is an important part of the RESTCONF toolbox.