google / google/gnxi

Question about gnmi_get and Unmarsha JSON_IETF

Open
#87 0 comments 0 reactions 0 assignees View on GitHub
clarify gnmi
Dominant language
Python
Stars
289
Forks
131
Avg merge
1d 28m
Merged PRs (30d)
1

Description

I am using GetJsonIetfVal()on pb.Update inside a GetRespose.Notification and, I am able to the JSON payload coming back from the node.
Is there a method to Unmarshell and assign this payload to YANG go struct (ygot generated bindings)? I am not able to see the go struct getting populated with the JSON data.

For example,
gNMI Get for xPath "openconfig-interfaces:interfaces/"

for _, pbNotification := range GetRespose.Notification {
for _, update := range pbNotification.GetUpdate() {
InterfaceByteVal := val.GetJsonIetfVal() <<<<<<<<<<<<<

ocInterface := &yangmodels.Interface{} // /openconfig-interfaces/interfaces/interface YANG schema element.

err = json.Unmarshal(InterfaceByteVal, ocInterface)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.