# README
Usage
$ go install ./gnmidiff
$ gnmidiff setrequest cmd/demo/setrequest.textproto cmd/demo/setrequest2.textproto
SetRequestIntentDiff(-A, +B):
-------- deletes/replaces --------
+ /network-instances/network-instance[name=VrfBlue]: deleted or replaced only in B
-------- updates --------
m /system/config/hostname:
- "violetsareblue"
+ "rosesarered"
$ gnmidiff set-to-notifs cmd/demo/setrequest.textproto cmd/demo/notifs.textproto
SetToNotifsDiff(-want/SetRequest, +got/Notifications):
- /lacp/interfaces/interface[name=Port-Channel9]/config/interval: "FAST"
- /lacp/interfaces/interface[name=Port-Channel9]/config/name: "Port-Channel9"
- /lacp/interfaces/interface[name=Port-Channel9]/name: "Port-Channel9"
- /network-instances/network-instance[name=VrfBlue]/config/name: "VrfBlue"
- /network-instances/network-instance[name=VrfBlue]/config/type: "openconfig-network-instance-types:L3VRF"
- /network-instances/network-instance[name=VrfBlue]/name: "VrfBlue"
m /system/config/hostname:
- "violetsareblue"
+ "rosesarered"
$ gnmidiff set-to-notifs cmd/demo/setrequest.textproto cmd/demo/getresponse.textproto
SetToNotifsDiff(-want/SetRequest, +got/Notifications):
- /lacp/interfaces/interface[name=Port-Channel9]/config/interval: "FAST"
- /lacp/interfaces/interface[name=Port-Channel9]/config/name: "Port-Channel9"
- /lacp/interfaces/interface[name=Port-Channel9]/name: "Port-Channel9"
- /network-instances/network-instance[name=VrfBlue]/config/name: "VrfBlue"
- /network-instances/network-instance[name=VrfBlue]/config/type: "openconfig-network-instance-types:L3VRF"
- /network-instances/network-instance[name=VrfBlue]/name: "VrfBlue"
m /system/config/hostname:
- "violetsareblue"
+ "rosesarered"
# Functions
DiffSetRequest returns a unique and minimal intent diff of two SetRequests.
DiffSetRequestToNotifications returns a diff between a SetRequest and a slice of Notifications representing the state of the target after applying the SetRequest.
# Structs
DeleteDiff contains a set of difference fields representing delete paths.
Format is the string format of any gNMI diff utility in this package.
MismatchedUpdate represents two different update values for the same leaf node.
StructuredDiff contains a set of difference fields that can be used by SetRequests/Notifications.
UpdateDiff contains a set of update fields representing update path/values.
# Type aliases
SetRequestIntentDiff contains the intent difference between two SetRequests.
SetToNotifsDiff contains the difference from the SetRequest to the given Notifications.