Hi Team,
I am getting a gNMI subscribe response in str representation of protobuf. I
want to create a entity with this data based on YDK models.
Could you please help me in converting below data to pure JSON removing all
update/elem/path hierarchy.
*Sample data:*
update {
timestamp: 1569824857471000000
prefix {
origin: "openconfig-interfaces"
elem {
name: "interfaces"
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "in-octets"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "out-octets"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "in-multicast-pkts"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "in-broadcast-pkts"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "out-multicast-pkts"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "out-broadcast-pkts"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "in-unknown-protos"
}
}
val {
uint_val: 2482
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "in-errors"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "out-errors"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "in-unicast-pkts"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "in-discards"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "out-unicast-pkts"
}
}
val {
uint_val: 0
}
}
update {
path {
elem {
name: "interface"
key {
key: "name"
value: "FourHundredGigE0/0/0/0"
}
}
elem {
name: "state"
}
elem {
name: "counters"
}
elem {
name: "out-discards"
}
}
val {
uint_val: 0
}
}
}
Thanks in advance !!
Regards,
Kousalya
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/d9236bcc-9620-46da-9ade-699614acc3ca%40googlegroups.com.