Skip to content

Commit 4c351cf

Browse files
authored
Merge pull request sonic-net#1 from project-arlo/eric-wip
Add gnmi doc
2 parents 66c43bb + 81a3d92 commit 4c351cf

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

doc/mgmt/gnmi.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
gRPC Network Management Interface (gNMI)
2+
========================================
3+
4+
gNMI Is a gRPC based protocol to manage netowork devices. Sonic provides the gNMI server, while the client must be provided by the user. Although the protocol allows for many encodings and models to be used, our usage is restricted to JSON encoding and openconfig based yang models. All paths and values come from the openconfig models.
5+
6+
Supported Openconfig Models:
7+
-----------------
8+
- Openconfig Interfaces
9+
- Openconfig ACLs
10+
- Openconfig System
11+
12+
Supported RPC Operations:
13+
---------------------
14+
- Get: Get one or more paths and have value(s) returned in a GetResponse.
15+
- Set: Update, replace or delete objects
16+
+ Update: List of one or more objects to update
17+
+ Replace: List of one or objects to replace existing objects, any unspecified fields wil be defaulted.
18+
+ Delete: List of one or more object paths to delete
19+
- Capabilities: Return gNMI version and list of supported models
20+
- Subscribe:
21+
+ Subscribe to paths using either streaming or poll, or once based subscription, with either full current state or updated values only.
22+
* Once: Get single subscription message.
23+
* Poll: Get one subscription message for each poll request from the client.
24+
* Stream: Get one subscription message for each object update, or at each sample interval if using sample mode.
25+
26+
27+
Example Client Operations:
28+
--------------------------
29+
Using opensource clients, these are example client operations. The .json test payload files are available here: https://github.com/project-arlo/sonic-mgmt-framework/tree/master/src/translib/test
30+
31+
Get:
32+
----
33+
`./gnmi_get -xpath /openconfig-acl:acl/interfaces -target_addr 127.0.0.1:8080 -alsologtostderr -insecure true -pretty`
34+
35+
Set:
36+
----
37+
Replace:
38+
--------
39+
`./gnmi_set -replace /openconfig-acl:acl/:@./test/01_create_MyACL1_MyACL2.json -target_addr 127.0.0.1:8080 -alsologtostderr -insecure true -pretty`
40+
Delete:
41+
-------
42+
`./gnmi_set -delete /openconfig-acl:acl/ -target_addr 127.0.0.1:8080 -insecure`
43+
44+
Subscribe:
45+
----------
46+
Streaming sample based:
47+
-----------------------
48+
`./gnmi_cli -insecure -logtostderr -address 127.0.0.1:8080 -query_type s -streaming_sample_interval 3000000000 -streaming_type 2 -q /openconfig-acl:acl/ -v 0 -target OC-YANG`
49+
50+
Poll based:
51+
-----------
52+
`./gnmi_cli -insecure -logtostderr -address 127.0.0.1:8080 -query_type p -polling_interval 1s -count 5 -q /openconfig-acl:acl/ -v 0 -target OC-YANG`
53+
54+
Once based:
55+
-----------
56+
`./gnmi_cli -insecure -logtostderr -address 127.0.0.1:8080 -query_type o -q /openconfig-acl:acl/ -v 0 -target OC-YANG`

0 commit comments

Comments
 (0)