API discovery: Prevent overwrite of API parameters in cases where API names are same#4609
Conversation
|
This sounds like a bugfix can you open against 4.15 @Pearl1594 ? |
DaanHoogland
left a comment
There was a problem hiding this comment.
trivial enough, should do as described
2ae3595 to
b727825
Compare
done @rhtyd |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2599 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Previous job failed, rekicking |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3432)
|
Description
This PR addresses an issue that crops up during API discovery when we have the same API name pointing to 2 command classes, namely, xxxCmdByAdmin and xxxCmd.
During api discovery we create a map of the apiNames and their corresponding parameters, however, in cases of api's like createNetwork which point to both CreateNetworkCmd and CreateNetworkCmdByAdmin classes, though in ManagementServerImpl care has been taken to place the xxxCmdByAdmin classes after the regular xxxCmd classes, since we copy this list of command classes into a HashSet, is so happens, that sometimes the xxxCmdByAdmin Classes get discovered before their generic counterpart. Hence, parameters defined in the xxxCmdByAdmin class gets overwritten. This can be easily fixed by ensuring that the order of the API classes is maintained.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
Cases when this can be seen:

This issue becomes predominant in the new UI as we use discovered API parameters to define the form fields:
Also,when logged in as admin via cmk and after doing a sync, listing params of createNetwork sometimes doesn't list the parameters defined in the CreateNetworkCmdByAdmin class - e.g., vlan, bypassoverlapcheck, etc