akarneliuk / pygnmi

The pure Python implementation of the gNMI client.
https://training.karneliuk.com
BSD 3-Clause "New" or "Revised" License
126 stars 44 forks source link

pre/post diff: define encoding and datatype #123

Closed XioNoX closed 1 year ago

XioNoX commented 1 year ago

In this patch I re-use in the get() the same encoding defined in the set() (if any). Using the default/automatic encoding the device I'm using it with doesn't return any data, I have to explicitly set it to json_ietf.

The current code shows diff for the states values, for example when enabling an interface. As the "set" action modifies configuration, it seems cleaner to me to only show diffs of configuration elements. For that, this patch sets the "datatype" to "config".