Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PUT on leaf not working as expected #252

Open
anand-kumar-subramanian opened this issue Nov 6, 2019 · 3 comments
Open

PUT on leaf not working as expected #252

anand-kumar-subramanian opened this issue Nov 6, 2019 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@anand-kumar-subramanian
Copy link
Collaborator

curl -v -X PUT "http://10.175.125.43:4443/restconf/data/openconfig-network-instance:network-instances/network-instance=INST2/protocols/protocol=IGMP_SNOOPING,IGMP-SNOOPING/openconfig-network-instance-deviation:igmp-snooping/interfaces/interface=Vlan10/config/version" -H "accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -d "{ "openconfig-network-instance-deviation:version": 1}"

In the above REST API, the target node of the URI is leaf "version", but when we execute this command, transformer replaces the whole redis table with leaf version with value 1, that is it removes all the entries in the redis db table and set only the leaf version value.

Actually transformer should update only the field version and should not remove other fields in the redis db table as the target node of the URI is leaf version.

Before issuing this request:
HGETALL CFG_L2MC_TABLE|Vlan10

  1. "version"
  2. "3"
  3. "query-interval"
  4. "50"

After we execute the above REST API:
HGETALL CFG_L2MC_TABLE|Vlan10

  1. "version"
  2. "1"
@s-mari
Copy link
Collaborator

s-mari commented Nov 6, 2019

Currently sub-oper support is not there. This issue will be resolved with sub-oper support.
We are currently working on it.

@kwangsuk
Copy link
Collaborator

kwangsuk commented Nov 9, 2019

@anand-kumar-subramanian
Can you please share the log?
The data map passed to the common-app should have a specific filed, i.e. version, with REPLACE. The common-app calls the d.SetEntry() to replace the version field only, expecting that the d.SetEntry updates the given filed only, and not intended to change the remaining fields. As confirmed with @a-barboza

@kwangsuk kwangsuk added the need more info Further information is requested label Nov 9, 2019
@a-barboza
Copy link
Collaborator

@anand-kumar-subramanian
Can you please share the log?
The data map passed to the common-app should have a specific filed, i.e. version, with REPLACE. The common-app calls the d.SetEntry() to replace the version field only, expecting that the d.SetEntry updates the given filed only, and not intended to change the remaining fields. As confirmed with @a-barboza

@kwangsuk, @anand-kumar-subramanian : d.SetEntry() will set the value of the hash exactly as provided. Please see the HLD under: https://github.com/project-arlo/SONiC/blob/master/doc/mgmt/Management%20Framework.md#32264-db-access-layer, DB access layer, Redis, CVL Interaction: very first row. It gives the exact algorithm. If you want to modify only one field in an existing hash, please use the 3rd row for d.ModEntry().

@anand-kumar-subramanian anand-kumar-subramanian added bug Something isn't working and removed need more info Further information is requested labels Nov 11, 2019
dell-engops pushed a commit that referenced this issue Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants