GithubHelp home page GithubHelp logo

Comments (5)

samribeiro avatar samribeiro commented on August 19, 2024 1

Should be fixed now. Please reopen if something is amiss.

from gnxi.

samribeiro avatar samribeiro commented on August 19, 2024

Hi CoCumis, you should get an encoded subtree as per gNMI spec:
https://github.com/google/gnxi/blob/master/gnmi/server.go#L530

which client and target are you using? Can you provide examples of the get and the response?

from gnxi.

CoCumis avatar CoCumis commented on August 19, 2024

Thanks for response.

I am using docker image provided by faucet which you are mentioning in your README. For get request I use script provided in this docker image. Here is example:

#!/bin/sh
gnmi_get \
  -target_addr $GNMI_TARGET:$GNMI_PORT \
  -key $HOME/certs/client.key \
  -cert $HOME/certs/client.crt \
  -ca $HOME/certs/ca.crt \
  -target_name server.com \
  -alsologtostderr \
  -xpath "/system/openflow/controllers/controller[name=main]/"

I would expect it will send response with one update message which contains JSON encoded subtree. But instead I get this (just excerpt):

notification: <                                                                                                                                                
  timestamp: 1530705017155554011                                                                                                                               
  prefix: <                                                                                                                                                    
    elem: <                                                                                                                                                    
      name: "system"                                                                                                                                           
    >                                                                                                                                                          
    elem: <                                                                                                                                                    
      name: "openflow"                                                                                                                                         
    >                                                                                                                                                          
    elem: <                                                                                                                                                    
      name: "controllers"                                                                                                                                      
    >                                                                                                                                                          
    elem: <                                                                                                                                                    
      name: "controller"                                                                                                                                       
      key: <                                                                                                                                                   
        key: "name"                                                                                                                                            
        value: "main"                                                                                                                                          
      >                                                                                                                                                        
    >                                                                                                                                                          
  >                                                                                                                                                            
  update: <                                                                                                                                                    
    path: <                                                                                                                                                    
      elem: <                                                                                                                                                  
        name: "connections"                                                                                                                                    
      >                                                                                                                                                        
      elem: <                                                                                                                                                  
        name: "connection"                                                                                                                                     
        key: <
          key: "aux-id"
          value: "0"
        >
      >
      elem: <
        name: "config"
      >
      elem: <
        name: "transport"
      >
    >
    val: <
      string_val: "TLS"
    >
  >
  update: <
    path: <
      elem: <
        name: "connections"
      >
      elem: <
        name: "connection"
        key: <
          key: "aux-id"
          value: "0"
        >
      >
      elem: <
        name: "state"
      >
      elem: <
        name: "address"
      >
    >
    val: <
      string_val: "192.0.2.10"
    >
  >
  update: <
    path: <
      elem: <
        name: "connections"
      >
      elem: <
        name: "connection"
        key: <
          key: "aux-id"
          value: "0"
        >
      >
      elem: <
        name: "state"
      >
      elem: <
        name: "aux-id"
      >
    >
    val: <
      uint_val: 0
    >
  >
...                                                                                                                                                                                                                                             

I also get the same result, if I try it with java client (generated from gnmi.proto). Is there something I had to configure in order to get whole subtree encoded as JSON instead of separate update message for each leaf?

from gnxi.

Pyro2266 avatar Pyro2266 commented on August 19, 2024

Hi, bugfix you provided fixes this problem only when the encoding is set to IETF_JSON (as title says). However I encountered this problem again when the encoding is set to JSON, which is the default one (is used when no encoding is specified).

Please, can you reopen this issue?

from gnxi.

samribeiro avatar samribeiro commented on August 19, 2024

Thanks I have a potential fix here: https://github.com/samribeiro/gnxi/tree/gnmi
But I need to test it first.

from gnxi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.