openconfig / gnmic

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

Is it possible to run gnmic as gnmi-server without a subscription #205

Closed arnaudcoquelet closed 6 months ago

arnaudcoquelet commented 1 year ago

I'm new to gnmic, so maybe I'm missing something, But I'm curious if there is a way to start gnmic as a gnmi-server so it behaves as a proxy for SET/GET operations, but without defining a subscription.

Right now the only I get it to work is if I define a subscription and start it like this "gnmic --config config.yml subscribe"

Here is how the config.yml is built:

# cat config.yml 
username: admin
password: NokiaSrl1!
skip-verify: true
encoding: json_ietf
log: true

gnmi-server:
  address: 0.0.0.0:57400
  log: true
  enable-metrics: true

api-server:
  enable-metrics: true

targets:
  spine1:
    address: 10.96.8.70:50052
  spine2:
    address: 10.96.8.67:50052
  leaf1:
    address: 10.96.8.68:50052
  leaf2:
    address: 10.96.8.69:50052
  leaf3:
    address: 10.96.8.72:50052

subscriptions:
  sub1:
    paths:
      - /system/name
    stream-mode: sample
    sample-interval: 60s

If the subscriptions is not defined, the application stops as expected because gnmic was started with the keyword subscribe.

karimra commented 1 year ago

It's not currently possible. The gNMI proxy function was added to allow multiple clients to subscribe to the same data without duplicating subscriptions to the target. Proxying Get/Set was added later on. There was some discussions about adding that functionality as a separate command (gnmic proxy) but it was never implemented. Is this something you would be interested on ?

arnaudcoquelet commented 1 year ago

It would be a nice to have feature on my end

That would allow to solve 2 situations: -When the client is not able to reach directly the gnmi server -When the client use an API that is not fully capable to interop with a server (in my case, pygnmi and gnnmi servers with a certificate without subject/subject alternative name)

karimra commented 6 months ago

This took a bit of time but you can now(v0.37.0) use the proxy command. gNMIc will run as a proxy without the need to define subscriptions.

arnaudcoquelet commented 6 months ago

Thanks a lot Karim to implement itArnaud CoqueletNokiaSent from my iPhoneOn May 13, 2024, at 19:56, Karim Radhouani @.***> wrote: This took a bit of time but you can now(v0.37.0) use the proxy command. gNMIc will run as a proxy without the need to define subscriptions.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>