sonic-net / sonic-mgmt-common Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Hi, I've been working on this for a week now, trying to understand the code and the relationship between the mgmt-common, mgmt-telemetry, and gnxi. I have used the different examples with openconfig that are shown in the "tests" dir with no success. I think there might be an issue there seeing that there are two semi-colons there (which seems to be contradicting to how gnxi parses the request: https://github.com/jipanyang/gnxi/blob/f0a90cca6fd0041625bcce561b71f849c9b65a8d/gnmi_set/gnmi_set.go#L62).
My question is, what is the format to send Set commands for SONiC data (Ports, interfaces, etc.) and is it possible to add the different yang models in the yang-models dir under sonic-buildimage/src also here?
This is the command I am sending (I have tried may others as well):
gnmi_set -replace /sonic-port/sonic-port:@./vlan_config.json -target_addr :8080 -target_name -alsologtostderr -insecure true -pretty
vlan_config.json -> {"PORT": {"PORT_LIST": [{"ifname": "Ethernet111" ,"index": 111}]}}
This pull request addresses the issue of incomplete support for Yang models in the REST API on the SONiC target board. The changes made in this pull request ensure that all Yang models are properly supported by the REST API.
The problem revolves around the REST API on the SONiC target board, which is not providing full support for all the Yang models present in the usr/local/yang-model path. While some Yang models are successfully supported by the REST API in the rest_ui folder, we are experiencing limitations with other Yang models.
To overcome this issue thought of doing modifications in sonic-mgmt-framework by doing modification.
Modifications Made:
Added all the Yang models that require REST API support to the sonic-build-image/src/sonic-mgmt-common/models/yang/sonic directory in the sonic-mgmt-common repository.
So is there any other modifications to be done in sonic-mgmt-common to get support from rest api for yang models on SONiC target board. Can you please suggest some advice regarding tis issue?
Thank you for reviewing this pull request.
After building the package, git status
indicates there are changes to go.sum:
diff --git a/go.sum b/go.sum
index 77b875b..4f0831d 100644
--- a/go.sum
+++ b/go.sum
@@ -35,6 +35,7 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4 h1:+EOh4OY6tjM6ZueeUKinl1f0U2820HzQOuf1iqMnsks=
github.com/golang/protobuf v1.4.0-rc.4/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0 h1:aRz0NBceriICVtjhCgKkDvl+RudKu1CT6h0ZvUTrNfE=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
@@ -121,6 +122,7 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.20.1 h1:ESRXHgpUBG5D2I5mmsQIyYxB/tQIZfSZ8wLyFDf/N/U=
google.golang.org/protobuf v1.20.1/go.mod h1:KqelGeouBkcbcuB3HCk4/YH2tmNLk6YSWA5LIWeI/lY=
+google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
It appears as though the file needs to be updated to reflect this.
When trying to get the list of OpenConfig interfaces, I get a 404 errror which reads more like an internal application problem:
$ curl -I -k -X GET "https://$IP/restconf/data/openconfig-interfaces:interfaces" -H "accept: application/yang-data+json"
HTTP/2 404
content-type: application/yang-data+json
content-length: 127
date: Fri, 30 Sep 2022 09:18:55 GMT
$ curl -k -X GET "https://$IP/restconf/data/openconfig-interfaces:interfaces" -H "accept: application/yang-data+json"
{"ietf-restconf:errors":{"error":[{"error-type":"application","error-tag":"invalid-value","error-message":"Entry not found"}]}}
Using "strace" shows that the problem is related to a COUNTERS_PORT_NAME_MAP item in Redis:
[pid 12369] write(2, "E0930 09:47:56.851061 18 in"..., 102) = 102
| 00000 45 30 39 33 30 20 30 39 3a 34 37 3a 35 36 2e 38 E0930 09:47:56.8 |
| 00010 35 31 30 36 31 20 20 20 20 20 20 31 38 20 69 6e 51061 18 in |
| 00020 74 66 5f 61 70 70 2e 67 6f 3a 37 31 39 5d 20 50 tf_app.go:719] P |
| 00030 6f 72 74 2d 4f 49 44 20 28 43 6f 75 6e 74 65 72 ort-OID (Counter |
| 00040 73 29 20 67 65 74 20 66 6f 72 20 61 6c 6c 20 74 s) get for all t |
| 00050 68 65 20 69 6e 74 65 72 66 61 63 65 73 20 66 61 he interfaces fa |
| 00060 69 6c 65 64 21 0a iled!. |
[pid 12369] epoll_ctl(4, EPOLL_CTL_DEL, 9, 0xc0057b2ae4) = 0
[pid 12369] close(9) = 0
[pid 12369] epoll_ctl(4, EPOLL_CTL_DEL, 10, 0xc0057b2ae4) = 0
[pid 12369] close(10) = 0
[pid 12369] write(2, "E0930 09:47:56.851635 18 ha"..., 178) = 178
| 00000 45 30 39 33 30 20 30 39 3a 34 37 3a 35 36 2e 38 E0930 09:47:56.8 |
| 00010 35 31 36 33 35 20 20 20 20 20 20 31 38 20 68 61 51635 18 ha |
| 00020 6e 64 6c 65 72 2e 67 6f 3a 35 39 5d 20 5b 52 45 ndler.go:59] [RE |
| 00030 53 54 2d 33 33 5d 20 54 72 61 6e 73 6c 69 62 20 ST-33] Translib |
| 00040 65 72 72 6f 72 20 74 6c 65 72 72 2e 54 72 61 6e error tlerr.Tran |
| 00050 73 6c 69 62 52 65 64 69 73 43 6c 69 65 6e 74 45 slibRedisClientE |
| 00060 6e 74 72 79 4e 6f 74 45 78 69 73 74 20 2d 20 54 ntryNotExist - T |
| 00070 72 61 6e 73 6c 69 62 20 52 65 64 69 73 20 45 72 ranslib Redis Er |
| 00080 72 6f 72 3a 20 45 6e 74 72 79 20 64 6f 65 73 20 ror: Entry does |
| 00090 6e 6f 74 20 65 78 69 73 74 3a 20 43 4f 55 4e 54 not exist: COUNT |
| 000a0 45 52 53 5f 50 4f 52 54 5f 4e 41 4d 45 5f 4d 41 ERS_PORT_NAME_MA |
| 000b0 50 0a P. |
[pid 12369] write(2, "I0930 09:47:56.851940 18 ha"..., 243) = 243
| 00000 49 30 39 33 30 20 30 39 3a 34 37 3a 35 36 2e 38 I0930 09:47:56.8 |
| 00010 35 31 39 34 30 20 20 20 20 20 20 31 38 20 68 61 51940 18 ha |
| 00020 6e 64 6c 65 72 2e 67 6f 3a 37 32 5d 20 5b 52 45 ndler.go:72] [RE |
| 00030 53 54 2d 33 33 5d 20 53 65 6e 64 69 6e 67 20 72 ST-33] Sending r |
| 00040 65 73 70 6f 6e 73 65 20 34 30 34 2c 20 74 79 70 esponse 404, typ |
| 00050 65 3d 61 70 70 6c 69 63 61 74 69 6f 6e 2f 79 61 e=application/ya |
| 00060 6e 67 2d 64 61 74 61 2b 6a 73 6f 6e 2c 20 64 61 ng-data+json, da |
| 00070 74 61 3d 7b 22 69 65 74 66 2d 72 65 73 74 63 6f ta={"ietf-restco |
| 00080 6e 66 3a 65 72 72 6f 72 73 22 3a 7b 22 65 72 72 nf:errors":{"err |
| 00090 6f 72 22 3a 5b 7b 22 65 72 72 6f 72 2d 74 79 70 or":[{"error-typ |
| 000a0 65 22 3a 22 61 70 70 6c 69 63 61 74 69 6f 6e 22 e":"application" |
| 000b0 2c 22 65 72 72 6f 72 2d 74 61 67 22 3a 22 69 6e ,"error-tag":"in |
| 000c0 76 61 6c 69 64 2d 76 61 6c 75 65 22 2c 22 65 72 valid-value","er |
| 000d0 72 6f 72 2d 6d 65 73 73 61 67 65 22 3a 22 45 6e ror-message":"En |
| 000e0 74 72 79 20 6e 6f 74 20 66 6f 75 6e 64 22 7d 5d try not found"}] |
| 000f0 7d 7d 0a }}. |
[pid 12369] write(2, "I0930 09:47:56.852237 18 ro"..., 106) = 106
| 00000 49 30 39 33 30 20 30 39 3a 34 37 3a 35 36 2e 38 I0930 09:47:56.8 |
| 00010 35 32 32 33 37 20 20 20 20 20 20 31 38 20 72 6f 52237 18 ro |
| 00020 75 74 65 72 2e 67 6f 3a 31 32 38 5d 20 5b 52 45 uter.go:128] [RE |
| 00030 53 54 2d 33 33 5d 20 47 65 74 4f 70 65 6e 63 6f ST-33] GetOpenco |
| 00040 6e 66 69 67 49 6e 74 65 72 66 61 63 65 73 49 6e nfigInterfacesIn |
| 00050 74 65 72 66 61 63 65 73 20 74 6f 6f 6b 20 33 37 terfaces took 37 |
| 00060 2e 31 38 35 34 39 33 6d 73 0a .185493ms. |
The counter table is empty:
root@sonic:~# redis-cli
127.0.0.1:6379> hgetall COUNTERS_PORT_NAME_MAP
(empty array)
So I presume that
sonic-mgmt-common/translib/intf_app.go
Line 717 in ec32690
sonic-mgmt-common/translib/db/map.go
Line 70 in ec32690
I'm running this against a nightly VM image (sonic-vs.img).
Hi, @faraazbrcm
I am using version 202012
When I use restful to send delete messages, sometimes the following error occurs
URL:
restconf/data/openconfig-network-instance:network-instances/network-instance=DEFAULT/protocols/protocol=oc-pol-types:ISIS,DEFAULT/isis/interfaces/interface=Ethernet8/levels/level=2/afi-safi/af=oc-isis-types:IPV4,oc-isis-types:UNICAST/segment-routing/adjacency-sids/adjacency-sid=172.60.61.1,321536
Code1:
baseTreeNode, err := ytypes.GetNode(ygSchema.RootSchema(), deviceObj, path)
basePathObj, ok := (baseTreeNode[0].Data).(ygot.ValidatedGoStruct)
if ok {
err := basePathObj.Validate(&ytypes.LeafrefOptions{IgnoreMissingData: true})
......
Code2:
In the following code, 'fieldVal(321536)' can be converted to both int32 and string, which was committed in ygot patch (
49e5a22)
in sonic-mgmt-common/vendor/github.com/openconfig/ygot/ytypes/list.go
if keyLeafKind == yang.Yunion && strings.HasSuffix(ft.Name(), "_Union") {
sks, err := getUnionKindsNotEnums(cschema)
if err != nil {
return err
}
for _, sk := range sks {
gv, err := StringToType(reflect.TypeOf(yangBuiltinTypeToGoType(sk)), fieldVal)
if err == nil {
mn := "To_" + ft.Name()
mapMethod := val.MethodByName(mn)
if !mapMethod.IsValid() {
return fmt.Errorf("%s does not have a %s function", val, mn)
}
ec := mapMethod.Call([]reflect.Value{gv})
if len(ec) != 2 {
return fmt.Errorf("%s %s function returns %d params", ft.Name(), mn, len(ec))
}
ei := ec[0].Interface()
ee := ec[1].Interface()
if ee != nil {
return fmt.Errorf("unmarshaled %v type %T does not have a union type: %v", fieldVal, fieldVal, ee)
}
nv = reflect.ValueOf(ei)
break
}
}
...
}
error-message
"/device/network-instances/network-instance: /device/network-instances/network-instance/protocols/protocol: /device/network-instances/network-instance/protocols/protocol/isis/interfaces: /device/network-instances/network-instance/protocols/protocol/isis/interfaces/interface: /device/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level: /device/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/afi-safi/af: /device/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/afi-safi/af/segment-routing/adjacency-sids: /device/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/afi-safi/af/segment-routing/adjacency-sids/adjacency-sid: "321536" does not match regular expression pattern "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$" for schema "
yang info:
sid-id is in openconfig-segment-routing.yang,and it's type union
leaf sid-id {
type oc-srt:sr-sid-type;
description
"The Segment Identifier to be used when advertising the IGP Prefix SID.";
}
typedef sr-sid-type {
type union {
type oc-mplst:mpls-label; ===》openconfig-mpls-types.yang
type oc-inet:ipv6-address; ===》openconfig-inet-types.yang
}
description
"The defined value of a segment identifier.";
}
Hi all
There is a key named "**fec**" in APP_DB for Ethernet interface , which was missing in https://github.com/Azure/sonic-mgmt-common/blob/master/models/yang/sonic/sonic-port.yang.
It would affect REST API on interface via sonic-mgmt-framwork causing failed during CVL check.
https://access.redhat.com/security/cve/cve-2021-3121
protobuf before 1.3.2 is unsafe.
this repo has related dependencies.
For example: github.com/go-redis/redis/v7 depends on [email protected], [email protected] depends on [email protected]
Add OpenConfig YANG model support for physical interfaces. Establish the translation/mapping from SONiC YANG to OpenConfig YANG, declare what is not/supported and any SONiC-specific deviations.
Code PRs:
Repo | PR title | State |
---|---|---|
SONiC | Adding HLD for OC Yang interfaces. | |
sonic-mgmt-common | Adding support for OC YANG interfaces |
[Question] I tried to add extended yang for an Openconfig Yang, but found that leaf in extended yang cannot be operated (set/get operations by executing REST command). Can you make an example ? Or help me, thanks.
I met some questions, the steps are as follows:
Result : test-bool value is not set to redis db, and an error occures in syslog:
Jul 28 03:16:50.993116 sonic INFO mgmt-framework#/supervisord: rest-server W0728 03:16:50.992765 19 xlate_to_db.go:94] Table for yang-path("/openconfig-optical-attenuator:optical-attenuator/attenuators/attenuator/config/test-bool") not found.
fullSpec.txt
[openconfig-optical-attenuator-annot.yan
create_voa2.txt
g.txt](https://github.com/sonic-net/sonic-mgmt-common/files/9207507/openconfig-optical-attenuator-annot.yang.txt)
[openconfig-optical-attenuator-ext.yang.t
openconfig-optical-attenuator.yang.txt
xt](https://github.com/sonic-net/sonic-mgmt-common/files/9207519/openconfig-optical-attenuator-ext.yang.txt)
Support additional SONiC YANG structure concepts such as:
Add UT logic for the above YANG structures.
From README.md, we can see the follow description:
README.md
Install latest version of pyang tool.
Install libyang from https://github.com/CESNET/libyang along with its dependency.
But Unfortunately, I compile sonic-gnmi (https://github.com/sonic-net/sonic-gnmi) failed.
From the https://github.com/CESNET/libyang, we can see many version:
② complie sonic-gnmi, it failed
ubuntu@VM-40-95-ubuntu:~/sonic-community/sonic-gnmi (master)$ dpkg-buildpackage -rfakeroot -b -us -uc
......
ome/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:93: undefined reference to lyd_new_leaf' /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:109: undefined reference to
lyd_validate_value'
/tmp/go-link-1722060546/000028.o: In function lyd_node_leafref_match_in_union': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:174: undefined reference to
lyd_validate_value'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cmacro_ly_errno': /tmp/go-build/cgo-gcc-prolog:115: undefined reference to
ly_errno_glob_address'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_ly_verb': /tmp/go-build/cgo-gcc-prolog:135: undefined reference to
ly_verb'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_merge_to_ctx': /tmp/go-build/cgo-gcc-prolog:231: undefined reference to
lyd_merge_to_ctx'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_new': /tmp/go-build/cgo-gcc-prolog:274: undefined reference to
lyd_new'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_new_leaf': /tmp/go-build/cgo-gcc-prolog:295: undefined reference to
lyd_new_leaf'
/tmp/go-link-1722060546/000028.o: In function lyd_parse_data_path': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:46: undefined reference to
lyd_parse_path'
/tmp/go-link-1722060546/000028.o: In function lyd_parse_data_mem': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:51: undefined reference to
lyd_parse_mem'
/tmp/go-link-1722060546/000028.o: In function lyd_data_validate': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:66: undefined reference to
lyd_validate'
/tmp/go-link-1722060546/000028.o: In function lyd_change_leaf_data': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:193: undefined reference to
lyd_change_leaf'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_free_withsiblings': /tmp/go-build/cgo-gcc-prolog:211: undefined reference to
lyd_free_withsiblings'
/tmp/go-link-1722060546/000030.o: In function ly_set_log_callback': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/util/util.go:37: undefined reference to
ly_verb'
/home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/util/util.go:35: undefined reference to `ly_verb'
collect2: error: ld returned 1 exit status
I try libyang-2.0.194, it failed to compile sonic-gnmi too.
buntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:93: undefined reference to lyd_new_leaf' /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:109: undefined reference to
lyd_validate_value'
/tmp/go-link-3776435132/000028.o: In function lyd_node_leafref_match_in_union': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:174: undefined reference to
lyd_validate_value'
/tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cmacro_ly_errno': /tmp/go-build/cgo-gcc-prolog:115: undefined reference to
ly_errno_glob_address'
/tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_ly_verb': /tmp/go-build/cgo-gcc-prolog:135: undefined reference to
ly_verb'
/tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_merge_to_ctx': /tmp/go-build/cgo-gcc-prolog:231: undefined reference to
lyd_merge_to_ctx'
/tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_new': /tmp/go-build/cgo-gcc-prolog:274: undefined reference to
lyd_new'
/tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_new_leaf': /tmp/go-build/cgo-gcc-prolog:295: undefined reference to
lyd_new_leaf'
/tmp/go-link-3776435132/000028.o: In function lyd_parse_data_path': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:46: undefined reference to
lyd_parse_path'
/tmp/go-link-3776435132/000028.o: In function lyd_parse_data_mem': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:51: undefined reference to
lyd_parse_mem'
/tmp/go-link-3776435132/000028.o: In function lyd_data_validate': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:66: undefined reference to
lyd_validate'
/tmp/go-link-3776435132/000028.o: In function lyd_change_leaf_data': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:193: undefined reference to
lyd_change_leaf'
/tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_free_withsiblings': /tmp/go-build/cgo-gcc-prolog:211: undefined reference to
lyd_free_withsiblings'
/tmp/go-link-3776435132/000030.o: In function ly_set_log_callback': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/util/util.go:37: undefined reference to
ly_verb'
/home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/util/util.go:35: undefined reference to `ly_verb'
I try libyang-1.0.225 it failed to compile sonic-gnmi too.
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libyang.so.1 (used by debian/sonic-gnmi/usr/sbin/dialout_client_cli)
Hint: check if the library actually comes from a package.
dh_shlibdeps: dpkg-shlibdeps -Tdebian/sonic-gnmi.substvars debian/sonic-gnmi/usr/sbin/gnmi_cli debian/sonic-gnmi/usr/sbin/gnmi_get debian/sonic-gnmi/usr/sbin/gnmi_set debian/sonic-gnmi/usr/sbin/gnoi_client debian/sonic-gnmi/usr/sbin/dialout_client_cli returned exit code 255
dh_shlibdeps: Aborting due to earlier error
debian/rules:7: recipe for target 'binary' failed
make: *** [binary] Error 25
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
ubuntu@VM-40-95-ubuntu:~/sonic-community/sonic-gnmi (master)$ ls -l /usr/local/lib/libyang.so.1
lrwxrwxrwx 1 root root 18 Nov 8 21:15 /usr/local/lib/libyang.so.1 -> libyang.so.1.10.17
I don't know how to install libyang for sonic-gnmi
Hi mgmt-common team, does this repo's translib common_app.go support clear command, yang scheme maybe show as below:
rpc sonic-clearmac {
input {
....
}
output {
....
}
}
When using a subscribe-once call to read all entries of a multi-key list we noticed that some entries are not returned. This happens because the code in handleYangToDbKeyXfmr
uses a map iteration to build the database key, since the map is unordered the key fields are sometimes added to the key in the incorrect order leading to those entries not being found in the database, or worse, the wrong entry being found.
Relevant code is here:
sonic-mgmt-common/translib/transformer/subscribe_req_xlate.go
Lines 1055 to 1062 in fbb5fcd
Notice sys_app translib code in 202305 branch implement GET support for /openconfig-system/processes
subtree only. What are the plans to add GET (and/or SET if relevant) for other openconfig-system subtrees?
Debian control file is strcted to amd64: https://github.com/Azure/sonic-mgmt-common/blob/master/debian/control.
This will cause the ARM64 platform to fail to compile.
Please help to fix it and support ARM/ARM64 platform compile, Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.