openconfig / gnmic

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

Question : Set delete operation for CLI origin #102

Open bpchoi opened 1 year ago

bpchoi commented 1 year ago

Hi,

I'm trying to find a way to use delete operation for CLI origin, but couldn't find. Would you advise how gnmic can do delete operation for CLI origin?

Thanks in advance, Phil

karimra commented 1 year ago

@bpchoi How would you see deletion to work with a cli origin? The semantics of deletion should be part of the cli command. There is not much sense into using a gNMI Set delete for that.

bpchoi commented 1 year ago

Hi Karim, In case of Juniper, would you check the following doc if it makes any sense? https://www.juniper.net/documentation/us/en/software/junos/junos-xml-protocol/topics/task/junos-xml-protocol-configuration-data-elements-deleting.html Thanks, Phil

hellt commented 1 year ago

As noted above, gnmi specification doesn't define delete operations with CLI origin.

bpchoi commented 1 year ago

I understand there is no gnmi spec, but I see Get operation works with cli origin path in somehow. I think if it would make the utility complete and useful if it support delete cli instead of using Replace operation with bulk of cli config as the workaround.

For reference,

gnmic -a sup-tb3-geodc3-4-scapa1:50051 -u regress -p MaRtInI --insecure --timeout 120s get --encoding ascii --path "cli:/chassis/aggregated-devices/ethernet" --log --debug 2023/05/18 15:18:12.608762 /home/runner/work/gnmic/gnmic/app/app.go:216: [gnmic] version=0.30.0, commit=0acd332, date=2023-04-18T17:56:21Z, gitURL=https://github.com/openconfig/gnmic, docs=https://gnmic.openconfig.net 2023/05/18 15:18:12.608819 /home/runner/work/gnmic/gnmic/app/app.go:221: [gnmic] using config file "" 2023/05/18 15:18:12.610768 /home/runner/work/gnmic/gnmic/app/app.go:259: [gnmic] set flags/config: address:

  • sup-tb3-geodc3-4-scapa1:50051 api: "" capabilities-version: false cluster-name: default-cluster config: "" debug: true diff-compare: [] diff-model: [] diff-path: [] diff-prefix: "" diff-qos: "0" diff-ref: "" diff-set-to-notifs-full: false diff-set-to-notifs-response: "" diff-set-to-notifs-setrequest: "" diff-setrequest-full: false diff-setrequest-new: "" diff-setrequest-ref: "" diff-sub: false diff-target: "" diff-type: ALL dir: [] encoding: ascii exclude: [] file: [] format: "" generate-camel-case: false generate-config-only: false generate-path: "" generate-snake-case: false get-model: [] get-path:
  • cli:/chassis/aggregated-devices/ethernet get-prefix: "" get-processor: [] get-target: "" get-type: ALL get-values-only: false getset-condition: any([true]) getset-delete: "" getset-get: "" getset-model: [] getset-prefix: "" getset-replace: "" getset-target: "" getset-type: ALL getset-update: "" getset-value: "" gzip: false insecure: true instance-name: "" listen-max-concurrent-streams: "256" listen-prometheus-address: "" log: true log-file: "" log-tls-secret: false max-msg-size: 536870912 no-prefix: false password: MaRtInI path-config-only: false path-descr: false path-path-type: xpath path-search: false path-state-only: false path-types: false path-with-non-leaves: false path-with-prefix: false port: "57400" print-request: false prompt-description-bg-color: dark_gray prompt-description-with-prefix: false prompt-description-with-types: false prompt-max-suggestions: "10" prompt-prefix-color: dark_blue prompt-suggest-all-flags: false prompt-suggest-with-origin: false prompt-suggestions-bg-color: dark_blue proto-dir: [] proto-file: [] proxy-from-env: false retry: 10s set-delete: [] set-delimiter: ':::' set-dry-run: false set-prefix: "" set-replace: [] set-replace-cli: [] set-replace-cli-file: "" set-replace-file: [] set-replace-path: [] set-replace-value: [] set-request-file: [] set-request-replace: [] set-request-update: [] set-request-vars: "" set-target: "" set-update: [] set-update-cli: [] set-update-cli-file: "" set-update-file: [] set-update-path: [] set-update-value: [] skip-verify: false subscribe-backoff: 0s subscribe-heartbeat-interval: 0s subscribe-history-end: "" subscribe-history-snapshot: "" subscribe-history-start: "" subscribe-lock-retry: 5s subscribe-mode: stream subscribe-model: [] subscribe-name: [] subscribe-output: [] subscribe-path: [] subscribe-prefix: "" subscribe-qos: "0" subscribe-quiet: false subscribe-sample-interval: 0s subscribe-set-target: false subscribe-stream-mode: target-defined subscribe-suppress-redundant: false subscribe-target: "" subscribe-updates-only: false subscribe-watch-config: false targets-file: "" timeout: 2m0s tls-ca: "" tls-cert: "" tls-key: "" tls-max-version: "" tls-min-version: "" tls-version: "" token: "" upgrade-use-pkg: false use-tunnel-server: false username: regress

2023/05/18 15:18:12.611284 /home/runner/work/gnmic/gnmic/app/app.go:269: [gnmic] address='[sup-tb3-geodc3-4-scapa1:50051]'([]string) 2023/05/18 15:18:12.611313 /home/runner/work/gnmic/gnmic/app/app.go:269: [gnmic] debug='true'(bool) 2023/05/18 15:18:12.611360 /home/runner/work/gnmic/gnmic/app/app.go:269: [gnmic] encoding='ascii'(string) 2023/05/18 15:18:12.611402 /home/runner/work/gnmic/gnmic/app/app.go:269: [gnmic] get-path='[cli:/chassis/aggregated-devices/ethernet]'([]string) 2023/05/18 15:18:12.611451 /home/runner/work/gnmic/gnmic/app/app.go:269: [gnmic] insecure='true'(bool) 2023/05/18 15:18:12.611471 /home/runner/work/gnmic/gnmic/app/app.go:269: [gnmic] log='true'(bool) 2023/05/18 15:18:12.611492 /home/runner/work/gnmic/gnmic/app/app.go:269: [gnmic] password='MaRtInI'(string) 2023/05/18 15:18:12.611639 /home/runner/work/gnmic/gnmic/app/app.go:269: [gnmic] timeout='2m0s'(string) 2023/05/18 15:18:12.611669 /home/runner/work/gnmic/gnmic/app/app.go:269: [gnmic] username='regress'(string) 2023/05/18 15:18:12.611742 /home/runner/work/gnmic/gnmic/config/config.go:374: [config] cmd=get, flagName=help, changed=false, isSetInFile=false 2023/05/18 15:18:12.611781 /home/runner/work/gnmic/gnmic/config/config.go:374: [config] cmd=get, flagName=model, changed=false, isSetInFile=false 2023/05/18 15:18:12.611802 /home/runner/work/gnmic/gnmic/config/config.go:374: [config] cmd=get, flagName=path, changed=true, isSetInFile=true 2023/05/18 15:18:12.611817 /home/runner/work/gnmic/gnmic/config/config.go:374: [config] cmd=get, flagName=prefix, changed=false, isSetInFile=false 2023/05/18 15:18:12.611833 /home/runner/work/gnmic/gnmic/config/config.go:374: [config] cmd=get, flagName=processor, changed=false, isSetInFile=false 2023/05/18 15:18:12.611849 /home/runner/work/gnmic/gnmic/config/config.go:374: [config] cmd=get, flagName=target, changed=false, isSetInFile=false 2023/05/18 15:18:12.611866 /home/runner/work/gnmic/gnmic/config/config.go:374: [config] cmd=get, flagName=type, changed=false, isSetInFile=false 2023/05/18 15:18:12.611882 /home/runner/work/gnmic/gnmic/config/config.go:374: [config] cmd=get, flagName=values-only, changed=false, isSetInFile=false 2023/05/18 15:18:12.612108 /home/runner/work/gnmic/gnmic/config/targets.go:45: [config] targets: map[sup-tb3-geodc3-4-scapa1:50051:{"name":"sup-tb3-geodc3-4-scapa1:50051","address":"sup-tb3-geodc3-4-scapa1:50051","username":"regress","password":"****","timeout":120000000000,"insecure":true,"skip-verify":false,"buffer-size":100,"retry-timer":10000000000,"log-tls-secret":false,"gzip":false,"token":""}] 2023/05/18 15:18:12.612140 /home/runner/work/gnmic/gnmic/config/actions.go:49: [config] actions: map[] 2023/05/18 15:18:12.612159 /home/runner/work/gnmic/gnmic/config/processors.go:45: [config] processors: map[] 2023/05/18 15:18:12.612819 /home/runner/work/gnmic/gnmic/app/get.go:125: [gnmic] sending gNMI GetRequest: prefix='', path='[origin:"cli" elem:{name:"chassis"} elem:{name:"aggregated-devices"} elem:{name:"ethernet"}]', type='ALL', encoding='ASCII', models='[]', extension='[]' to sup-tb3-geodc3-4-scapa1:50051 2023/05/18 15:18:12.612850 /home/runner/work/gnmic/gnmic/app/app.go:511: [gnmic] creating gRPC client for target "sup-tb3-geodc3-4-scapa1:50051" 2023/05/18 15:18:12.612966 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel created 2023/05/18 15:18:12.613019 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] original dial target is: "sup-tb3-geodc3-4-scapa1:50051" 2023/05/18 15:18:12.613058 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] parsed dial target is: {Scheme:sup-tb3-geodc3-4-scapa1 Authority: URL:{Scheme:sup-tb3-geodc3-4-scapa1 Opaque:50051 User: Host: Path: RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}} 2023/05/18 15:18:12.613074 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] fallback to scheme "passthrough" 2023/05/18 15:18:12.613101 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] parsed dial target is: {Scheme:passthrough Authority: URL:{Scheme:passthrough Opaque: User: Host: Path:/sup-tb3-geodc3-4-scapa1:50051 RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}} 2023/05/18 15:18:12.613117 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel authority set to "sup-tb3-geodc3-4-scapa1:50051" 2023/05/18 15:18:12.613325 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Resolver state updated: { "Addresses": [ { "Addr": "sup-tb3-geodc3-4-scapa1:50051", "ServerName": "", "Attributes": null, "BalancerAttributes": null, "Type": 0, "Metadata": null } ], "ServiceConfig": null, "Attributes": null } (resolver returned new addresses) 2023/05/18 15:18:12.613388 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel switches to new LB policy "pick_first" 2023/05/18 15:18:12.613420 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel created 2023/05/18 15:18:12.613442 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel Connectivity change to CONNECTING 2023/05/18 15:18:12.613560 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING 2023/05/18 15:18:12.613614 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel picks a new address "sup-tb3-geodc3-4-scapa1:50051" to connect 2023/05/18 15:18:12.613764 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] pickfirstBalancer: UpdateSubConnState: 0xc000d85998, {CONNECTING } 2023/05/18 15:18:12.617059 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY 2023/05/18 15:18:12.617103 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] pickfirstBalancer: UpdateSubConnState: 0xc000d85998, {READY } 2023/05/18 15:18:12.617118 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.53.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel Connectivity change to READY [ { "source": "sup-tb3-geodc3-4-scapa1:50051", "timestamp": 1684448292631338150, "time": "2023-05-18T15:18:12.63133815-07:00", "updates": [ { "Path": "cli:chassis/aggregated-devices/ethernet", "values": { "chassis/aggregated-devices/ethernet": "\ndevice-count 9;\n" } } ] } ]

chassis aggregated-devices ethernet textjuniper

]]>]]>

May 18 15:18:12 [NETCONF] - [13047] Outgoing: May 18 15:18:13 [NETCONF] - [13047] Outgoing: May 18 15:18:13 [NETCONF] - [13047] Outgoing: May 18 15:18:13 [NETCONF] - [13047] Outgoing: device-count 9; May 18 15:18:13 [NETCONF] - [13047] Outgoing: May 18 15:18:13 [NETCONF] - [13047] Outgoing: May 18 15:18:13 [NETCONF] - [13047] Outgoing: May 18 15:18:13 [NETCONF] - [13047] Outgoing: ]]>]]>

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 12 months with no activity.