Add SonicV2Connector::set method for int value.#648
Add SonicV2Connector::set method for int value.#648liuh-80 merged 7 commits intosonic-net:masterfrom
Conversation
|
Another PR depends on this change: sonic-net/sonic-utilities#2251 |
|
This PR need improve, because following error: NotImplementedError: Wrong number or type of arguments for overloaded function 'SonicV2Connector_Native_set'. |
Fixed by using python method. |
|
Build sai redis failed because UT failed, all build failed after sunday, so not related with this PR. will keep retry and merge after it passed. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
#### Why I did it Following config command in sonic-utility using an API does not exist in swss-common: sudo config rate smoothing-interval 100 https://github.com/Azure/sonic-utilities/blob/e089b964ef0d38d8c691eb3e551e479c0c68dd96/config/main.py#L6548 counters_db.set('COUNTERS_DB', 'RATES:PORT', 'PORT_SMOOTH_INTERVAL', interval) <== interval is an int value. Currently swss-common only support string value: int64_t SonicV2Connector_Native::set(const std::string& db_name, const std::string& _hash, const std::string& key, const std::string& val, bool blocking) #### How I did it Add SonicV2Connector::set method for int value. #### How to verify it Pass all test case. Add UT to cover new API. #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 #### Description for the changelog Add SonicV2Connector::set method for int value. #### Link to config_db schema for YANG module changes #### A picture of a cute animal (not mandatory but encouraged)
Why I did it
Following config command in sonic-utility using an API does not exist in swss-common:
sudo config rate smoothing-interval 100
https://github.com/Azure/sonic-utilities/blob/e089b964ef0d38d8c691eb3e551e479c0c68dd96/config/main.py#L6548
counters_db.set('COUNTERS_DB', 'RATES:PORT', 'PORT_SMOOTH_INTERVAL', interval) <== interval is an int value.
Currently swss-common only support string value:
int64_t SonicV2Connector_Native::set(const std::string& db_name, const std::string& _hash, const std::string& key, const std::string& val, bool blocking)
How I did it
Add SonicV2Connector::set method for int value.
How to verify it
Pass all test case.
Add UT to cover new API.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Add SonicV2Connector::set method for int value.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)