Search code examples
jsongrpcietf-netmod-yang

What is the type of below mention data?


I am receiving below mention data type as a result of service call. I need to parse this data, It doesn't seems like JSON or YANG, wondering what it is?

update {
  timestamp: 1513187126024174850
  prefix {
    elem {
      name: "interfaces"
    }
    elem {
      name: "interface"
      key {
        key: "name"
        value: "interface-0/0/0"
      }
   }

  }

Solution

  • That looks like "text format" Protocol Buffers. The format is used with proto2 for human-readable display. In proto3 JSON is preferred, although text format is still available. The protoc tool is able to convert between text and binary protobuf.

    I'm not aware of a formal definition of the syntax, but it is fairly simplistic. There's some examples on this other question: What does the protobuf text format look like?