sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
724 stars 1.38k forks source link

Incomplete REST API Support for Yang Models on SONiC Target Board #15183

Open Purnimayeggina opened 1 year ago

Purnimayeggina commented 1 year ago

Description: I have encountered an issue with the REST API on the SONiC target board, where the yang models located in the usr/local/yang-models path are not fully supported. Currently, only four yang models in the rest_ui folder are receiving support from the REST API. I am seeking assistance from the community to resolve this issue and determine if any modifications are required in the source code.

Issue Details:

The usr/local/yang-models path contains yang models that are not supported by the REST API on the SONiC target board. Below are the yang models present in usr/local/yang-models path: root@sonic:/usr/local/yang-models# ls sonic-acl.yang sonic-auto_techsupport.yang sonic-bgp-allowed-prefix.yang sonic-bgp-common.yang sonic-bgp-device-global.yang sonic-bgp-global.yang sonic-bgp-internal-neighbor.yang sonic-bgp-monitor.yang sonic-bgp-neighbor.yang sonic-bgp-peergroup.yang sonic-bgp-peerrange.yang sonic-bgp-voq-chassis-neighbor.yang sonic-breakout_cfg.yang sonic-buffer-pg.yang sonic-buffer-pool.yang sonic-buffer-port-egress-profile-list.yang sonic-buffer-port-ingress-profile-list.yang sonic-buffer-profile.yang sonic-buffer-queue.yang sonic-cable-length.yang sonic-copp.yang sonic-crm.yang sonic-default-lossless-buffer-parameter.yang sonic-device_metadata.yang sonic-device_neighbor.yang sonic-dhcpv6-relay.yang sonic-dot1p-tc-map.yang sonic-dscp-fc-map.yang sonic-dscp-tc-map.yang sonic-exp-fc-map.yang sonic-extension.yang sonic-feature.yang sonic-flex_counter.yang sonic-interface.yang sonic-kdump.yang sonic-lldp.yang sonic-loopback-interface.yang sonic-lossless-traffic-pattern.yang sonic-macsec.yang sonic-mclag.yang sonic-mgmt_interface.yang sonic-mgmt_port.yang sonic-mgmt_vrf.yang sonic-mirror-session.yang sonic-nac.yang sonic-nat.yang sonic-ntp.yang sonic-nvgre-tunnel.yang sonic-passwh.yang sonic-pbh.yang sonic-pfc-priority-priority-group-map.yang sonic-pfc-priority-queue-map.yang sonic-pfcwd.yang sonic-policer.yang sonic-port-qos-map.yang sonic-port.yang sonic-portchannel.yang sonic-queue.yang sonic-route-common.yang sonic-route-map.yang sonic-routing-policy-sets.yang sonic-scheduler.yang sonic-sflow.yang sonic-storm-control.yang sonic-syslog.yang sonic-system-aaa.yang sonic-system-tacacs.yang sonic-tc-priority-group-map.yang sonic-tc-queue-map.yang sonic-telemetry.yang sonic-types.yang sonic-versions.yang sonic-vlan-sub-interface.yang sonic-vlan.yang sonic-vrf.yang sonic-warm-restart.yang sonic-wred-profile.yang

Only the yang models in the rest_ui folder are receiving proper support from the REST API. The RESTAPI supported Yang models in rest_ui folder are listed in the below attachment.

Assistance is needed to enable support for the remaining yang models and determine if any modifications are necessary in the source code. Expected Outcome: I would like to achieve full REST API support for all the yang models present in the usr/local/yang-models path on the SONiC target board.

Request for Help:

Recommendations: I would appreciate any suggestions or advice on how to enable REST API support for the yang models that are currently not supported. Required Modifications: If any modifications are required in the source code to resolve this issue, please provide guidance on the specific changes that need to be made. Additional Information:

Yang Models Location: usr/local/yang-models Supported Yang Models Location: rest_ui folder I kindly request the community's assistance in resolving this issue and ensuring full REST API support for all yang models on the SONiC target board. Thank you for your help and expertise.

MicrosoftTeams-image (11)
adyeung commented 1 year ago

Multiple fixes needed in CVL and transformer. DELL and BRCM will upstream the change thru code PRs targeting for 202311 release

toreanderson commented 1 week ago

Multiple fixes needed in CVL and transformer. DELL and BRCM will upstream the change thru code PRs targeting for 202311 release

That didn't happen - as of SONiC 202405, the REST API is still limited to the point where it is not really a feasible way of configuring the device, as you can't even do the most basic things like set a loopback IP (as the sonic-loopback-interface endpoint is missing):

$ show version | grep 'SONiC Software Version'
SONiC Software Version: SONiC.202405.636516-ad8dc5f16
$ curl -sk https://localhost/ui/ | grep 'REST APIs for'
                <td>REST APIs for ietf-yang-library</td>
                <td>REST APIs for openconfig-acl</td>
                <td>REST APIs for openconfig-interfaces</td>
                <td>REST APIs for openconfig-lldp</td>
                <td>REST APIs for openconfig-platform</td>
                <td>REST APIs for openconfig-sampling-sflow</td>
                <td>REST APIs for openconfig-system</td>
                <td>REST APIs for sonic-acl</td>
                <td>REST APIs for sonic-interface</td>
                <td>REST APIs for sonic-port</td>
                <td>REST APIs for sonic-sflow</td>
                <td>REST APIs for sonic-show-techsupport</td>

Hopefully the missing API endpoints will be enabled soon.