openconfig / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.openconfig.net
Apache License 2.0
192 stars 57 forks source link

Trying to understand the use of models in subscriptions #530

Open Sparc0 opened 1 month ago

Sparc0 commented 1 month ago

Trying to understand what the benefits is of adding models under a subscription. I have subs one using models and one is not and the result seems to be the same. I read this and made it little what they can be used for https://openconfig.net/docs/gnmi/gnmi-specification/#26-schema-definition-models

I have tried to look into e.g https://openconfig.net/projects/models/schemadocs/jstree/openconfig-interfaces.html# And the path i get there for counters is not working. /oc-if:interfaces/oc-if:interface/oc-if:state/oc-if:counters Not working /interfaces/interface/state/counters Working

One of many gnmic examples

interface_state_with:                                        
  paths:                                                 
    - "openconfig-interfaces:/interfaces"                
  models:                                                
    - "openconfig-interfaces"                            
  mode: stream                                           
  stream-mode: sample                                    
  sample-interval: 15s                                   
  heartbeat-interval: 15s                                
  encoding: proto                                        
interface_state_without:                                        
  paths:                                                 
    - "/interfaces"                                      
  mode: stream                                           
  stream-mode: sample                                    
  sample-interval: 15s                                        
  heartbeat-interval: 15s                                
  encoding: proto                                        
karimra commented 1 month ago

This question is probably better asked in the reference repo.