Closed Andrea-Campanella closed 5 years ago
Currently the simulator does not support namespaces in paths. See attached examples as proof:
gnmi_cli -address localhost:10161 \ -proto "subscribe:<mode: 0, prefix:<>, subscription:<path: <elem:<name:'openconfig-system:system' > elem:<name:'openconfig-openflow:openflow' > elem:<name:'controllers' > elem:<name:'controller' key:<key:'name' value:'main' > > elem:<name:'connections' > elem:<name:'connection' key:<key:'aux-id' value:'0' > > elem:<name:'state' > elem:<name:'address' > >>>" \ -timeout 5s -alsologtostderr \ -polling_interval 5s \ -client_crt certs/client1.crt -client_key certs/client1.key -ca_crt certs/onfca.crt
Andreas-MacBook-Pro:onos-config andrea$ gnmi_cli -address localhost:5150 -set -proto "update: <path: <target: 'localhost-1', elem: <name: 'openconfig-interfaces:interfaces'> elem: <name:'interface' key:<key:'name' value:'admin'>> elem: <name:'config'> elem: <name:'enabled'>> val: <bool_val: true>>" -timeout 5s -alsologtostderr -client_crt pkg/southbound/testdata/client1.crt -client_key pkg/southbound/testdata/client1.key -ca_crt pkg/southbound/testdata/onfca.crt E0724 13:55:31.644355 74953 gnmi_cli.go:180] target returned RPC error for Set("update:<path:<elem:<name:\"openconfig-interfaces:interfaces\" > elem:<name:\"interface\" key:<key:\"name\" value:\"admin\" > > elem:<name:\"config\" > elem:<name:\"enabled\" > target:\"localhost-1\" > val:<bool_val:true > > ") : rpc error: code = Internal desc = Can't complete set operation on target localhost-1 due to Issue in setting config target returned RPC error for Set("update:<path:<elem:<name:\"openconfig-interfaces:interfaces\" > elem:<name:\"interface\" key:<key:\"name\" value:\"admin\" > > elem:<name:\"config\" > elem:<name:\"enabled\" > > val:<bool_val:true > > ") : rpc error: code = NotFound desc = path elem:<name:"openconfig-interfaces:interfaces" > elem:<name:"interface" key:<key:"name" value:"admin" > > elem:<name:"config" > elem:<name:"enabled" > is not found in the config structure: {5 could not find path in tree beyond type *gostruct.Device, remaining path elem:<name:"openconfig-interfaces:interfaces" > elem:<name:"interface" key:<key:"name" value:"admin" > > elem:<name:"config" > elem:<name:"enabled" > [] {} [] 0}, rolling back changes []
gnmi_cli -get -address localhost:10161 \ -proto " path: <elem:<name:'openconfig-system:system' > elem:<name:'openconfig-openflow:openflow' > elem:<name:'controllers' > elem:<name:'controller' key:<key:'name' value:'main' > > elem:<name:'connections' > elem:<name:'connection' key:<key:'aux-id' value:'0' > > elem:<name:'state' > elem:<name:'address' > >" \ -timeout 5s -alsologtostderr \ -polling_interval 5s \ -client_crt certs/client1.crt -client_key certs/client1.key -ca_crt certs/onfca.crt
because of https://github.com/openconfig/ygot/issues/300 and https://github.com/onosproject/onos-config/pull/574
Currently the simulator does not support namespaces in paths. See attached examples as proof:
gnmi_cli -address localhost:10161 \ -proto "subscribe:<mode: 0, prefix:<>, subscription:<path: <elem:<name:'openconfig-system:system' > elem:<name:'openconfig-openflow:openflow' > elem:<name:'controllers' > elem:<name:'controller' key:<key:'name' value:'main' > > elem:<name:'connections' > elem:<name:'connection' key:<key:'aux-id' value:'0' > > elem:<name:'state' > elem:<name:'address' > >>>" \ -timeout 5s -alsologtostderr \ -polling_interval 5s \ -client_crt certs/client1.crt -client_key certs/client1.key -ca_crt certs/onfca.crt
Andreas-MacBook-Pro:onos-config andrea$ gnmi_cli -address localhost:5150 -set -proto "update: <path: <target: 'localhost-1', elem: <name: 'openconfig-interfaces:interfaces'> elem: <name:'interface' key:<key:'name' value:'admin'>> elem: <name:'config'> elem: <name:'enabled'>> val: <bool_val: true>>" -timeout 5s -alsologtostderr -client_crt pkg/southbound/testdata/client1.crt -client_key pkg/southbound/testdata/client1.key -ca_crt pkg/southbound/testdata/onfca.crt E0724 13:55:31.644355 74953 gnmi_cli.go:180] target returned RPC error for Set("update:<path:<elem:<name:\"openconfig-interfaces:interfaces\" > elem:<name:\"interface\" key:<key:\"name\" value:\"admin\" > > elem:<name:\"config\" > elem:<name:\"enabled\" > target:\"localhost-1\" > val:<bool_val:true > > ") : rpc error: code = Internal desc = Can't complete set operation on target localhost-1 due to Issue in setting config target returned RPC error for Set("update:<path:<elem:<name:\"openconfig-interfaces:interfaces\" > elem:<name:\"interface\" key:<key:\"name\" value:\"admin\" > > elem:<name:\"config\" > elem:<name:\"enabled\" > > val:<bool_val:true > > ") : rpc error: code = NotFound desc = path elem:<name:"openconfig-interfaces:interfaces" > elem:<name:"interface" key:<key:"name" value:"admin" > > elem:<name:"config" > elem:<name:"enabled" > is not found in the config structure: {5 could not find path in tree beyond type *gostruct.Device, remaining path elem:<name:"openconfig-interfaces:interfaces" > elem:<name:"interface" key:<key:"name" value:"admin" > > elem:<name:"config" > elem:<name:"enabled" > [] {} [] 0}, rolling back changes []
gnmi_cli -get -address localhost:10161 \ -proto " path: <elem:<name:'openconfig-system:system' > elem:<name:'openconfig-openflow:openflow' > elem:<name:'controllers' > elem:<name:'controller' key:<key:'name' value:'main' > > elem:<name:'connections' > elem:<name:'connection' key:<key:'aux-id' value:'0' > > elem:<name:'state' > elem:<name:'address' > >" \ -timeout 5s -alsologtostderr \ -polling_interval 5s \ -client_crt certs/client1.crt -client_key certs/client1.key -ca_crt certs/onfca.crt