You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/12/31 13:55:48 UTC

[GitHub] [cloudstack] ezntt opened a new pull request, #7022: Cleanup APIs getCommandName

ezntt opened a new pull request, #7022:
URL: https://github.com/apache/cloudstack/pull/7022

   ### Description
   
   It was noticed that the APIs (most of them) follow a pattern in which the *response name* equals to `APINAME.toLowerCase() + 'response'`, which is the value returned by `getCommandName` method.
   
   Therefore, I am proposing the removal of the different repeated `getCommandName` instructions throughout the APIs. Additionally, it also removed API name/_response name_ declarations from the affected classes; the API name values were moved to the `name` parameter in `@APICommand`.
   
   To help me in the process of normalizing the code base, I created a script that iterates through the APIs using the existing method in class `ApiXmlDocWriter`. The number of APIs that did not follow the standard is 88, so they weren't changed, and they can be seen in the collapse below with their respective _response name_ and how they would be if they were in the majority standard:
   
   <details><summary>Unchanged APIs</summary>
   <p>
   
   ```
   1. Class org.apache.cloudstack.api.command.LdapCreateAccountCmd unchanged.
   	 actual  response name - createaccountresponse
   	expected response name - ldapcreateaccountresponse
   
   2. Class org.apache.cloudstack.api.command.admin.iso.CopyIsoCmdByAdmin unchanged.
   	 actual  response name - copytemplateresponse
   	expected response name - copyisoresponse
   
   3. Class org.apache.cloudstack.api.command.LdapImportUsersCmd unchanged.
   	 actual  response name - ldapuserresponse
   	expected response name - importldapusersresponse
   
   4. Class org.apache.cloudstack.storage.datastore.util.ListElastistorPoolCmd unchanged.
   	 actual  response name - listElastistorPoolResponse
   	expected response name - listelastistorpoolresponse
   
   5. Class com.cloud.api.commands.ListSrxFirewallsCmd unchanged.
   	 actual  response name - listsrxfirewallresponse
   	expected response name - listsrxfirewallsresponse
   
   6. Class org.apache.cloudstack.api.command.admin.vm.RestoreVMCmdByAdmin unchanged.
   	 actual  response name - restorevmresponse
   	expected response name - restorevirtualmachineresponse
   
   7. Class org.apache.cloudstack.api.ListUcsBladeCmd unchanged.
   	 actual  response name - listucsbladeresponse
   	expected response name - listucsbladesresponse
   
   8. Class org.apache.cloudstack.api.BaremetalProvisionDoneNotificationCmd unchanged.
   	 actual  response name - baremetalprovisiondone
   	expected response name - notifybaremetalprovisiondoneresponse
   
   9. Class com.cloud.api.commands.DeleteServicePackageOfferingCmd unchanged.
   	 actual  response name - deleteServicePackage
   	expected response name - deleteservicepackageofferingresponse
   
   10. Class org.apache.cloudstack.api.command.admin.systemvm.ScaleSystemVMCmd unchanged.
   	 actual  response name - changeserviceforsystemvmresponse
   	expected response name - scalesystemvmresponse
   
   11. Class org.apache.cloudstack.api.command.LdapListConfigurationCmd unchanged.
   	 actual  response name - ldapconfigurationresponse
   	expected response name - listldapconfigurationsresponse
   
   12. Class org.apache.cloudstack.api.command.admin.storage.ListSecondaryStagingStoresCmd unchanged.
   	 actual  response name - listsecondarystagingstoreresponse
   	expected response name - listsecondarystagingstoresresponse
   
   13. Class org.apache.cloudstack.api.command.user.autoscale.CreateAutoScalePolicyCmd unchanged.
   	 actual  response name - autoscalepolicyresponse
   	expected response name - createautoscalepolicyresponse
   
   14. Class org.apache.cloudstack.api.commands.DeleteSspCmd unchanged.
   	 actual  response name - deleteStratosphereSsp
   	expected response name - deletestratospheresspresponse
   
   15. Class org.apache.cloudstack.api.command.admin.resource.CleanVMReservationsCmd unchanged.
   	 actual  response name - cleanvmreservationresponse
   	expected response name - cleanvmreservationsresponse
   
   16. Class org.apache.cloudstack.storage.datastore.util.ListElastistorInterfaceCmd unchanged.
   	 actual  response name - listElastistorInterfaceResponse
   	expected response name - listelastistorinterfaceresponse
   
   17. Class org.apache.cloudstack.api.command.admin.internallb.StartInternalLBVMCmd unchanged.
   	 actual  response name - startinternallbvmresponse
   	expected response name - startinternalloadbalancervmresponse
   
   18. Class org.apache.cloudstack.api.command.LdapUserSearchCmd unchanged.
   	 actual  response name - ldapuserresponse
   	expected response name - searchldapresponse
   
   19. Class org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmGroupCmd unchanged.
   	 actual  response name - autoscalevmgroupresponse
   	expected response name - createautoscalevmgroupresponse
   
   20. Class org.apache.cloudstack.api.AddBaremetalPxePingServerCmd unchanged.
   	 actual  response name - addbaremetalpxeresponse
   	expected response name - addbaremetalpxepingserverresponse
   
   21. Class org.apache.cloudstack.api.command.admin.region.ListPortableIpRangesCmd unchanged.
   	 actual  response name - listportableipresponse
   	expected response name - listportableiprangesresponse
   
   22. Class org.apache.cloudstack.api.command.user.vm.AddIpToVmNicCmd unchanged.
   	 actual  response name - addiptovmnicresponse
   	expected response name - addiptonicresponse
   
   23. Class com.cloud.api.commands.StopNetScalerVMCmd unchanged.
   	 actual  response name - stopNetScalerVmresponse
   	expected response name - stopnetscalervpxresponse
   
   24. Class org.apache.cloudstack.api.DeleteUcsManagerCmd unchanged.
   	 actual  response name - deleteUcsManagerResponse
   	expected response name - deleteucsmanagerresponse
   
   25. Class org.apache.cloudstack.api.command.user.autoscale.DisableAutoScaleVmGroupCmd unchanged.
   	 actual  response name - disableautoscalevmGroupresponse
   	expected response name - disableautoscalevmgroupresponse
   
   26. Class com.cloud.api.commands.AddCiscoVnmcResourceCmd unchanged.
   	 actual  response name - addCiscoVnmcResource
   	expected response name - addciscovnmcresourceresponse
   
   27. Class org.apache.cloudstack.api.command.LdapListUsersCmd unchanged.
   	 actual  response name - ldapuserresponse
   	expected response name - listldapusersresponse
   
   28. Class org.apache.cloudstack.api.command.GetServiceProviderMetaDataCmd unchanged.
   	 actual  response name - spmetadataresponse
   	expected response name - getspmetadataresponse
   
   29. Class org.apache.cloudstack.network.opendaylight.api.commands.ListOpenDaylightControllersCmd unchanged.
   	 actual  response name - listOpenDaylightControllers
   	expected response name - listopendaylightcontrollersresponse
   
   30. Class org.apache.cloudstack.api.command.admin.storage.UpdateImageStoreCmd unchanged.
   	 actual  response name - updateImageStore
   	expected response name - updateimagestoreresponse
   
   31. Class com.cloud.api.commands.DeleteCiscoVnmcResourceCmd unchanged.
   	 actual  response name - deleteCiscoVnmcResource
   	expected response name - deleteciscovnmcresourceresponse
   
   32. Class org.apache.cloudstack.api.command.admin.internallb.StopInternalLBVMCmd unchanged.
   	 actual  response name - stopinternallbvmresponse
   	expected response name - stopinternalloadbalancervmresponse
   
   33. Class org.apache.cloudstack.api.command.SAML2LoginAPIAuthenticatorCmd unchanged.
   	 actual  response name - loginresponse
   	expected response name - samlssoresponse
   
   34. Class com.cloud.api.commands.ListNiciraNvpDeviceNetworksCmd unchanged.
   	 actual  response name - listniciranvpdevicenetworks
   	expected response name - listniciranvpdevicenetworksresponse
   
   35. Class com.cloud.api.commands.ListNetscalerControlCenterCmd unchanged.
   	 actual  response name - listNetscalerControlCenter
   	expected response name - listnetscalercontrolcenterresponse
   
   36. Class org.apache.cloudstack.api.command.admin.network.ListNetworkDeviceCmd unchanged.
   	 actual  response name - listnetworkdevice
   	expected response name - listnetworkdeviceresponse
   
   37. Class org.apache.cloudstack.network.opendaylight.api.commands.DeleteOpenDaylightControllerCmd unchanged.
   	 actual  response name - deleteOpenDaylightController
   	expected response name - deleteopendaylightcontrollerresponse
   
   38. Class org.apache.cloudstack.api.ListUcsManagerCmd unchanged.
   	 actual  response name - listucsmanagerreponse
   	expected response name - listucsmanagersresponse
   
   39. Class org.apache.cloudstack.api.command.LdapDeleteConfigurationCmd unchanged.
   	 actual  response name - ldapconfigurationresponse
   	expected response name - deleteldapconfigurationresponse
   
   40. Class org.apache.cloudstack.api.command.user.snapshot.ArchiveSnapshotCmd unchanged.
   	 actual  response name - createsnapshotresponse
   	expected response name - archivesnapshotresponse
   
   41. Class org.apache.cloudstack.api.command.admin.address.AcquirePodIpCmdByAdmin unchanged.
   	 actual  response name - acquirepodipaddress
   	expected response name - acquirepodipaddressresponse
   
   42. Class com.cloud.api.commands.ListBrocadeVcsDevicesCmd unchanged.
   	 actual  response name - listbrocadevcsdeviceresponse
   	expected response name - listbrocadevcsdevicesresponse
   
   43. Class org.apache.cloudstack.api.command.admin.vm.ResetVMSSHKeyCmdByAdmin unchanged.
   	 actual  response name - resetSSHKeyforvirtualmachineresponse
   	expected response name - resetsshkeyforvirtualmachineresponse
   
   44. Class org.apache.cloudstack.api.command.admin.internallb.ListInternalLBVMsCmd unchanged.
   	 actual  response name - listinternallbvmsresponse
   	expected response name - listinternalloadbalancervmsresponse
   
   45. Class com.cloud.api.commands.ListCiscoVnmcResourcesCmd unchanged.
   	 actual  response name - listCiscoVnmcResources
   	expected response name - listciscovnmcresourcesresponse
   
   46. Class org.apache.cloudstack.api.command.user.volume.GetUploadParamsForVolumeCmd unchanged.
   	 actual  response name - postuploadvolumeresponse
   	expected response name - getuploadparamsforvolumeresponse
   
   47. Class org.apache.cloudstack.api.command.user.autoscale.EnableAutoScaleVmGroupCmd unchanged.
   	 actual  response name - enableautoscalevmGroupresponse
   	expected response name - enableautoscalevmgroupresponse
   
   48. Class com.cloud.api.commands.DeleteCiscoAsa1000vResourceCmd unchanged.
   	 actual  response name - deleteCiscoAsa1000vResource
   	expected response name - deleteciscoasa1000vresourceresponse
   
   49. Class org.apache.cloudstack.api.ListUcsProfileCmd unchanged.
   	 actual  response name - listucsprofileresponse
   	expected response name - listucsprofilesresponse
   
   50. Class org.apache.cloudstack.api.command.user.autoscale.CreateConditionCmd unchanged.
   	 actual  response name - conditionresponse
   	expected response name - createconditionresponse
   
   51. Class com.cloud.api.commands.ListCiscoAsa1000vResourcesCmd unchanged.
   	 actual  response name - listCiscoAsa1000vResources
   	expected response name - listciscoasa1000vresourcesresponse
   
   52. Class com.cloud.api.commands.DeployNetscalerVpxCmd unchanged.
   	 actual  response name - deployNetscalerVpx
   	expected response name - deploynetscalervpxresponse
   
   53. Class org.apache.cloudstack.storage.datastore.util.ListElastistorVolumeCmd unchanged.
   	 actual  response name - listElastistorVolumeResponse
   	expected response name - listelastistorvolumeresponse
   
   54. Class org.apache.cloudstack.api.command.admin.region.DeletePortableIpRangeCmd unchanged.
   	 actual  response name - deleteportablepublicipresponse
   	expected response name - deleteportableiprangeresponse
   
   55. Class com.cloud.api.commands.ListNiciraNvpDevicesCmd unchanged.
   	 actual  response name - listniciranvpdeviceresponse
   	expected response name - listniciranvpdevicesresponse
   
   56. Class org.apache.cloudstack.api.AddBaremetalKickStartPxeCmd unchanged.
   	 actual  response name - addbaremetalpxeresponse
   	expected response name - addbaremetalpxekickstartserverresponse
   
   57. Class org.apache.cloudstack.api.command.user.loadbalancer.DeleteLBStickinessPolicyCmd unchanged.
   	 actual  response name - deleteLBstickinessrruleresponse
   	expected response name - deletelbstickinesspolicyresponse
   
   58. Class org.apache.cloudstack.api.command.admin.affinitygroup.UpdateVMAffinityGroupCmdByAdmin unchanged.
   	 actual  response name - updatevirtualmachineresponse
   	expected response name - updatevmaffinitygroupresponse
   
   59. Class com.cloud.api.commands.RegisterServicePackageCmd unchanged.
   	 actual  response name - registerNetscalerServicePackage
   	expected response name - registernetscalerservicepackageresponse
   
   60. Class org.apache.cloudstack.api.command.SAML2LogoutAPIAuthenticatorCmd unchanged.
   	 actual  response name - logoutresponse
   	expected response name - samlsloresponse
   
   61. Class org.apache.cloudstack.api.command.LdapAddConfigurationCmd unchanged.
   	 actual  response name - ldapconfigurationresponse
   	expected response name - addldapconfigurationresponse
   
   62. Class com.cloud.api.commands.ListBigSwitchBcfDevicesCmd unchanged.
   	 actual  response name - listbigswitchbcfdeviceresponse
   	expected response name - listbigswitchbcfdevicesresponse
   
   63. Class com.cloud.api.commands.ListRegisteredServicePackageCmd unchanged.
   	 actual  response name - listregisteredservicepackage
   	expected response name - listregisteredservicepackagesresponse
   
   64. Class org.apache.cloudstack.api.command.user.template.GetUploadParamsForTemplateCmd unchanged.
   	 actual  response name - postuploadtemplateresponse
   	expected response name - getuploadparamsfortemplateresponse
   
   65. Class org.apache.cloudstack.api.command.user.autoscale.ListCountersCmd unchanged.
   	 actual  response name - counterresponse
   	expected response name - listcountersresponse
   
   66. Class org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd unchanged.
   	 actual  response name - createLBStickinessPolicy
   	expected response name - createlbstickinesspolicyresponse
   
   67. Class com.cloud.api.commands.AddCiscoAsa1000vResourceCmd unchanged.
   	 actual  response name - addCiscoAsa1000vResource
   	expected response name - addciscoasa1000vresourceresponse
   
   68. Class org.apache.cloudstack.api.command.user.network.UpdateNetworkACLItemCmd unchanged.
   	 actual  response name - createnetworkaclresponse
   	expected response name - updatenetworkaclitemresponse
   
   69. Class com.cloud.api.commands.ListBrocadeVcsDeviceNetworksCmd unchanged.
   	 actual  response name - listbrocadevcsdevicenetworks
   	expected response name - listbrocadevcsdevicenetworksresponse
   
   70. Class com.cloud.api.commands.DeleteNetscalerControlCenterCmd unchanged.
   	 actual  response name - deleteNetscalerControlCenter
   	expected response name - deletenetscalercontrolcenterresponse
   
   71. Class org.apache.cloudstack.api.commands.AddSspCmd unchanged.
   	 actual  response name - addStratosphereSsp
   	expected response name - addstratospheresspresponse
   
   72. Class org.apache.cloudstack.network.opendaylight.api.commands.AddOpenDaylightControllerCmd unchanged.
   	 actual  response name - addOpenDaylightController
   	expected response name - addopendaylightcontrollerresponse
   
   73. Class org.apache.cloudstack.api.command.admin.storage.AddImageStoreS3CMD unchanged.
   	 actual  response name - addImageStoreS3Response
   	expected response name - addimagestores3response
   
   74. Class org.apache.cloudstack.api.command.user.network.MoveNetworkAclItemCmd unchanged.
   	 actual  response name - moveNetworkAclItemResponse
   	expected response name - movenetworkaclitemresponse
   
   75. Class org.apache.cloudstack.api.command.admin.storage.PreparePrimaryStorageForMaintenanceCmd unchanged.
   	 actual  response name - prepareprimarystorageformaintenanceresponse
   	expected response name - enablestoragemaintenanceresponse
   
   76. Class org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaintenanceCmd unchanged.
   	 actual  response name - cancelprimarystoragemaintenanceresponse
   	expected response name - cancelstoragemaintenanceresponse
   
   77. Class org.apache.cloudstack.api.command.admin.autoscale.CreateCounterCmd unchanged.
   	 actual  response name - counterresponse
   	expected response name - createcounterresponse
   
   78. Class org.apache.cloudstack.api.command.user.project.ActivateProjectCmd unchanged.
   	 actual  response name - activaterojectresponse
   	expected response name - activateprojectresponse
   
   79. Class org.apache.cloudstack.api.command.user.iso.GetUploadParamsForIsoCmd unchanged.
   	 actual  response name - postuploadisoresponse
   	expected response name - getuploadparamsforisoresponse
   
   80. Class com.cloud.api.commands.ListPaloAltoFirewallsCmd unchanged.
   	 actual  response name - listpaloaltofirewallresponse
   	expected response name - listpaloaltofirewallsresponse
   
   81. Class org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmProfileCmd unchanged.
   	 actual  response name - autoscalevmprofileresponse
   	expected response name - createautoscalevmprofileresponse
   
   82. Class org.apache.cloudstack.api.AddUcsManagerCmd unchanged.
   	 actual  response name - addUcsManagerResponse
   	expected response name - adducsmanagerresponse
   
   83. Class com.cloud.api.commands.ListNetscalerLoadBalancersCmd unchanged.
   	 actual  response name - listnetscalerloadbalancerresponse
   	expected response name - listnetscalerloadbalancersresponse
   
   84. Class org.apache.cloudstack.api.command.admin.iso.ListIsoPermissionsCmdByAdmin unchanged.
   	 actual  response name - listtemplatepermissionsresponse
   	expected response name - listisopermissionsresponse
   
   85. Class com.cloud.api.commands.ListCiscoNexusVSMsCmd unchanged.
   	 actual  response name - listcisconexusvsmscmdresponse
   	expected response name - listcisconexusvsmsresponse
   
   86. Class org.apache.cloudstack.api.command.admin.address.ReleasePodIpCmdByAdmin unchanged.
   	 actual  response name - releasepodipresponse
   	expected response name - releasepodipaddressresponse
   
   87. Class org.apache.cloudstack.api.command.ListSamlAuthorizationCmd unchanged.
   	 actual  response name - listsamlauthorizationsresponse
   	expected response name - listsamlauthorizationresponse
   
   88. Class org.apache.cloudstack.api.command.user.region.ha.gslb.RemoveFromGlobalLoadBalancerRuleCmd unchanged.
   	 actual  response name - removefromloadbalancerruleresponse
   	expected response name - removefromgloballoadbalancerruleresponse
   
   Total of APIs verified: 693.
   Total of unchanged APIs: 88.
   
   ```
   
   </p>
   </details>
   
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [x] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   
   ### How Has This Been Tested?
   After the changes, I've built the project locally and succeeded.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1366549885

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 5116


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] ezntt commented on a diff in pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
ezntt commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1057732297


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -270,9 +267,22 @@ public String getActualCommandName() {
         } else {
             cmdName = this.getClass().getName();
         }
-       return cmdName;
+        return cmdName;
     }
 
+    public static String getCommandNameByClass(Class<?> clazz) {
+        String cmdName = null;
+        if (clazz.getAnnotation(APICommand.class) != null) {
+            cmdName = clazz.getAnnotation(APICommand.class).name();
+        } else {
+            cmdName = clazz.getName();
+        }
+        return cmdName;
+    }
+
+    public static String getResponseNameByClass(Class<?> clazz) {

Review Comment:
   > @ezntt , good initiative. What do you propose we do with the remaining 88?
   
   As the PR is intended to clean up the repeated code (it will not change the APIs behavior), I would rather not touch those 88 APIs here. My proposal for those remaining 88 APIs is a later discussion on how we should handle them and if changing them would affect any other place.
   
   
   > is this being used?
   
   Yes, it is used in class `UploadListener.java`:
   ```java
       public static final Map<String, String> responseNameMap;
       static {
           Map<String, String> tempMap = new HashMap<String, String>();
           tempMap.put(Type.ISO.toString(), BaseCmd.getResponseNameByClass(ExtractIsoCmd.class));
           tempMap.put(Type.TEMPLATE.toString(), BaseCmd.getResponseNameByClass(ExtractTemplateCmd.class));
           tempMap.put(Type.VOLUME.toString(), BaseCmd.getResponseNameByClass(ExtractVolumeCmd.class));
           tempMap.put("DEFAULT", "extractresponse");
           responseNameMap = Collections.unmodifiableMap(tempMap);
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1367182430

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 5126


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1369110400

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=7022)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7022&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7022&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7022&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=CODE_SMELL)
   
   [![55.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/50-16px.png '55.6%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_coverage&view=list) [55.6% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7022: Normalize APIs getCommandName

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1057556701


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -270,9 +267,22 @@ public String getActualCommandName() {
         } else {
             cmdName = this.getClass().getName();
         }
-       return cmdName;
+        return cmdName;
     }
 
+    public static String getCommandNameByClass(Class<?> clazz) {
+        String cmdName = null;
+        if (clazz.getAnnotation(APICommand.class) != null) {

Review Comment:
   ```suggestion
           if (clazz.getAnnotation(APICommand.class) != null && clazz.getAnnotation(APICommand.class).name() != null) {
               cmdName = clazz.getAnnotation(APICommand.class).name();
           } else {
               cmdName = clazz.getName();
               // TODO: remove "Cmd" and "CmdByAdmin" from class name.
           }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368330585

   <b>Trillian test result (tid-5725)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
   Total time taken: 45662 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7022-t5725-vmware-67u3.zip
   Smoke tests completed. 106 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368218396

   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1366451034

   @DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1060355453


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -247,30 +247,36 @@ public void setResponseType(final String responseType) {
         this.responseType = responseType;
     }
 
-    /**
-     * For some reason this method does not return the actual command name, but more a name that
-     * is used to create the response. So you can expect for a XCmd a value like xcmdresponse. Anyways
-     * this methods is used in too many places so for now instead of changing it we just create another
-     * method {@link BaseCmd#getActualCommandName()} that returns the value from {@link APICommand#name()}
-     *
-     * @return
-     */
-    public abstract String getCommandName();
-
-
     /**
      * Gets the CommandName based on the class annotations: the value from {@link APICommand#name()}
      *
      * @return the value from {@link APICommand#name()}
      */
-    public String getActualCommandName() {
+    public static String getCommandNameByClass(Class<?> clazz) {
         String cmdName = null;
-        if (this.getClass().getAnnotation(APICommand.class) != null) {
-            cmdName = this.getClass().getAnnotation(APICommand.class).name();
+        APICommand apiClassAnnotation = clazz.getAnnotation(APICommand.class);
+
+        if (apiClassAnnotation != null && apiClassAnnotation.name() != null) {
+            cmdName = apiClassAnnotation.name();
         } else {
-            cmdName = this.getClass().getName();
+            cmdName = clazz.getName();

Review Comment:
   @ezntt thanks for checking. it looks good to me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368218540

   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1367749084

   @ezntt  are you done with the changes you want for this PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1366956131

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=7022)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7022&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7022&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7022&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=CODE_SMELL)
   
   [![55.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/50-16px.png '55.6%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_coverage&view=list) [55.6% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1366450870

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1367152111

   @DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1367218133

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368350167

   <b>Trillian test result (tid-5729)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 51282 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7022-t5729-kvm-centos7.zip
   Smoke tests completed. 104 look OK, 2 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 558.12 | test_kubernetes_clusters.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 468.18 | test_vpc_redundant.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1366573132

   @blueroangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368218418

   @DaanHoogland a Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1059655625


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -247,30 +247,36 @@ public void setResponseType(final String responseType) {
         this.responseType = responseType;
     }
 
-    /**
-     * For some reason this method does not return the actual command name, but more a name that
-     * is used to create the response. So you can expect for a XCmd a value like xcmdresponse. Anyways
-     * this methods is used in too many places so for now instead of changing it we just create another
-     * method {@link BaseCmd#getActualCommandName()} that returns the value from {@link APICommand#name()}
-     *
-     * @return
-     */
-    public abstract String getCommandName();
-
-
     /**
      * Gets the CommandName based on the class annotations: the value from {@link APICommand#name()}
      *
      * @return the value from {@link APICommand#name()}
      */
-    public String getActualCommandName() {
+    public static String getCommandNameByClass(Class<?> clazz) {
         String cmdName = null;
-        if (this.getClass().getAnnotation(APICommand.class) != null) {
-            cmdName = this.getClass().getAnnotation(APICommand.class).name();
+        APICommand apiClassAnnotation = clazz.getAnnotation(APICommand.class);
+
+        if (apiClassAnnotation != null && apiClassAnnotation.name() != null) {
+            cmdName = apiClassAnnotation.name();
         } else {
-            cmdName = this.getClass().getName();
+            cmdName = clazz.getName();

Review Comment:
   @ezntt 
   can you please check if there is an api that the apiClassAnnotation is null or name is null ?
   
   in other apis,  the command name is not class name.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368308031

   <b>Trillian test result (tid-5724)</b>
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 38227 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7022-t5724-xenserver-71.zip
   Smoke tests completed. 106 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Normalize APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1365790480

   @ezntt please note, most actions fail. Maybe  some compilation issue?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] ezntt commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
ezntt commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368012497

   > @ezntt are you done with the changes you want for this PR?
   
   @DaanHoogland yes, I'm done with these changes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland closed pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland closed pull request #7022: Cleanup APIs getCommandName
URL: https://github.com/apache/cloudstack/pull/7022


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] ezntt commented on a diff in pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
ezntt commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1060195337


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -247,30 +247,36 @@ public void setResponseType(final String responseType) {
         this.responseType = responseType;
     }
 
-    /**
-     * For some reason this method does not return the actual command name, but more a name that
-     * is used to create the response. So you can expect for a XCmd a value like xcmdresponse. Anyways
-     * this methods is used in too many places so for now instead of changing it we just create another
-     * method {@link BaseCmd#getActualCommandName()} that returns the value from {@link APICommand#name()}
-     *
-     * @return
-     */
-    public abstract String getCommandName();
-
-
     /**
      * Gets the CommandName based on the class annotations: the value from {@link APICommand#name()}
      *
      * @return the value from {@link APICommand#name()}
      */
-    public String getActualCommandName() {
+    public static String getCommandNameByClass(Class<?> clazz) {
         String cmdName = null;
-        if (this.getClass().getAnnotation(APICommand.class) != null) {
-            cmdName = this.getClass().getAnnotation(APICommand.class).name();
+        APICommand apiClassAnnotation = clazz.getAnnotation(APICommand.class);
+
+        if (apiClassAnnotation != null && apiClassAnnotation.name() != null) {
+            cmdName = apiClassAnnotation.name();
         } else {
-            cmdName = this.getClass().getName();
+            cmdName = clazz.getName();

Review Comment:
   @weizhouapache, I checked the code and did not find `APICommand` annotations with null name. Regarding the fallback to the class name, it is an already existing behavior, it was not introduced by this PR; therefore, if we had this situation, we probably would have catch it before.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368335017

   <b>Trillian test result (tid-5726)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 46350 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7022-t5726-kvm-centos7.zip
   Smoke tests completed. 105 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 574.06 | test_kubernetes_clusters.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1367630344

   <b>Trillian test result (tid-5691)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 44721 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7022-t5691-kvm-centos7.zip
   Smoke tests completed. 106 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] ezntt commented on a diff in pull request #7022: Normalize APIs getCommandName

Posted by GitBox <gi...@apache.org>.
ezntt commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1057713031


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -270,9 +267,22 @@ public String getActualCommandName() {
         } else {
             cmdName = this.getClass().getName();
         }
-       return cmdName;
+        return cmdName;
     }
 
+    public static String getCommandNameByClass(Class<?> clazz) {

Review Comment:
   I noticed there was kind of a duplicated code,  I changed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] ezntt commented on a diff in pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
ezntt commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1057732417


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -270,9 +267,22 @@ public String getActualCommandName() {
         } else {
             cmdName = this.getClass().getName();
         }
-       return cmdName;
+        return cmdName;
     }
 
+    public static String getCommandNameByClass(Class<?> clazz) {

Review Comment:
   Hello, @weizhouapache.
   
   With these new changes, `getActualCommandName` will be a facade to `getCommandNameByClass`, passing `this.getClass` as parameter.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] ezntt commented on a diff in pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
ezntt commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1060190770


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -247,30 +247,36 @@ public void setResponseType(final String responseType) {
         this.responseType = responseType;
     }
 
-    /**
-     * For some reason this method does not return the actual command name, but more a name that
-     * is used to create the response. So you can expect for a XCmd a value like xcmdresponse. Anyways
-     * this methods is used in too many places so for now instead of changing it we just create another
-     * method {@link BaseCmd#getActualCommandName()} that returns the value from {@link APICommand#name()}
-     *
-     * @return
-     */
-    public abstract String getCommandName();
-
-
     /**
      * Gets the CommandName based on the class annotations: the value from {@link APICommand#name()}
      *
      * @return the value from {@link APICommand#name()}
      */
-    public String getActualCommandName() {
+    public static String getCommandNameByClass(Class<?> clazz) {
         String cmdName = null;
-        if (this.getClass().getAnnotation(APICommand.class) != null) {
-            cmdName = this.getClass().getAnnotation(APICommand.class).name();
+        APICommand apiClassAnnotation = clazz.getAnnotation(APICommand.class);
+
+        if (apiClassAnnotation != null && apiClassAnnotation.name() != null) {
+            cmdName = apiClassAnnotation.name();
         } else {
-            cmdName = this.getClass().getName();
+            cmdName = clazz.getName();

Review Comment:
   @weizhouapache 
   
   No. as far as I've seen, there are no null annotations or null names throughout the APIs.
   In my view, the main purpose of this PR is just to clean up the code and not change its behaviors if needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] ezntt commented on a diff in pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
ezntt commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1060190770


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -247,30 +247,36 @@ public void setResponseType(final String responseType) {
         this.responseType = responseType;
     }
 
-    /**
-     * For some reason this method does not return the actual command name, but more a name that
-     * is used to create the response. So you can expect for a XCmd a value like xcmdresponse. Anyways
-     * this methods is used in too many places so for now instead of changing it we just create another
-     * method {@link BaseCmd#getActualCommandName()} that returns the value from {@link APICommand#name()}
-     *
-     * @return
-     */
-    public abstract String getCommandName();
-
-
     /**
      * Gets the CommandName based on the class annotations: the value from {@link APICommand#name()}
      *
      * @return the value from {@link APICommand#name()}
      */
-    public String getActualCommandName() {
+    public static String getCommandNameByClass(Class<?> clazz) {
         String cmdName = null;
-        if (this.getClass().getAnnotation(APICommand.class) != null) {
-            cmdName = this.getClass().getAnnotation(APICommand.class).name();
+        APICommand apiClassAnnotation = clazz.getAnnotation(APICommand.class);
+
+        if (apiClassAnnotation != null && apiClassAnnotation.name() != null) {
+            cmdName = apiClassAnnotation.name();
         } else {
-            cmdName = this.getClass().getName();
+            cmdName = clazz.getName();

Review Comment:
   @weizhouapache, I checked the code and did not find `APICommand` annotations with null name. Regarding the fallback to the class name, it is an already existing behavior, it was not introduced by this PR; therefore, if we had this situation, we probably would have catch it before.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1060357939


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -247,30 +247,36 @@ public void setResponseType(final String responseType) {
         this.responseType = responseType;
     }
 
-    /**
-     * For some reason this method does not return the actual command name, but more a name that
-     * is used to create the response. So you can expect for a XCmd a value like xcmdresponse. Anyways
-     * this methods is used in too many places so for now instead of changing it we just create another
-     * method {@link BaseCmd#getActualCommandName()} that returns the value from {@link APICommand#name()}
-     *
-     * @return
-     */
-    public abstract String getCommandName();
-
-
     /**
      * Gets the CommandName based on the class annotations: the value from {@link APICommand#name()}
      *
      * @return the value from {@link APICommand#name()}
      */
-    public String getActualCommandName() {
+    public static String getCommandNameByClass(Class<?> clazz) {
         String cmdName = null;
-        if (this.getClass().getAnnotation(APICommand.class) != null) {
-            cmdName = this.getClass().getAnnotation(APICommand.class).name();
+        APICommand apiClassAnnotation = clazz.getAnnotation(APICommand.class);
+
+        if (apiClassAnnotation != null && apiClassAnnotation.name() != null) {
+            cmdName = apiClassAnnotation.name();
         } else {
-            cmdName = this.getClass().getName();
+            cmdName = clazz.getName();

Review Comment:
   @ezntt 
   just a suggestion, maybe we can remove the `name` value from `APICommand` annotations in most apis.
   As I commented before, the api name is same as
   ```
   // TODO: remove "Cmd" and "CmdByAdmin" from class name.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7022: Normalize APIs getCommandName

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1057557404


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -270,9 +267,22 @@ public String getActualCommandName() {
         } else {
             cmdName = this.getClass().getName();
         }
-       return cmdName;
+        return cmdName;
     }
 
+    public static String getCommandNameByClass(Class<?> clazz) {

Review Comment:
   getActualCommandName is not needed then



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1367218584

   @DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] codecov[bot] commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1366003725

   # [Codecov](https://codecov.io/gh/apache/cloudstack/pull/7022?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#7022](https://codecov.io/gh/apache/cloudstack/pull/7022?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e656d27) into [main](https://codecov.io/gh/apache/cloudstack/commit/ca7e1ac1abbe78513bfdd57b990d58e018f8d65d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ca7e1ac) will **decrease** coverage by `0.00%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #7022      +/-   ##
   ============================================
   - Coverage     11.31%   11.31%   -0.01%     
   + Complexity     7334     7323      -11     
   ============================================
     Files          2494     2494              
     Lines        246787   246678     -109     
     Branches      38533    38533              
   ============================================
   - Hits          27933    27920      -13     
   + Misses       215255   215160      -95     
   + Partials       3599     3598       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/cloudstack/pull/7022?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...dstack/network/contrail/model/ModelObjectBase.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9uZXR3b3JrLWVsZW1lbnRzL2p1bmlwZXItY29udHJhaWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Nsb3Vkc3RhY2svbmV0d29yay9jb250cmFpbC9tb2RlbC9Nb2RlbE9iamVjdEJhc2UuamF2YQ==) | `21.15% <0.00%> (-7.70%)` | :arrow_down: |
   | [...e/cloudstack/api/command/QuotaTariffUpdateCmd.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9kYXRhYmFzZS9xdW90YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hcGkvY29tbWFuZC9RdW90YVRhcmlmZlVwZGF0ZUNtZC5qYXZh) | `41.66% <0.00%> (-2.34%)` | :arrow_down: |
   | [...ache/cloudstack/api/command/QuotaStatementCmd.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9kYXRhYmFzZS9xdW90YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hcGkvY29tbWFuZC9RdW90YVN0YXRlbWVudENtZC5qYXZh) | `29.03% <0.00%> (-2.22%)` | :arrow_down: |
   | [...apache/cloudstack/api/command/QuotaBalanceCmd.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9kYXRhYmFzZS9xdW90YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hcGkvY29tbWFuZC9RdW90YUJhbGFuY2VDbWQuamF2YQ==) | `44.44% <0.00%> (-1.99%)` | :arrow_down: |
   | [...che/cloudstack/api/command/QuotaTariffListCmd.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9kYXRhYmFzZS9xdW90YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hcGkvY29tbWFuZC9RdW90YVRhcmlmZkxpc3RDbWQuamF2YQ==) | `65.21% <0.00%> (-1.45%)` | :arrow_down: |
   | [...he/cloudstack/api/command/LinkDomainToLdapCmd.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy91c2VyLWF1dGhlbnRpY2F0b3JzL2xkYXAvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Nsb3Vkc3RhY2svYXBpL2NvbW1hbmQvTGlua0RvbWFpblRvTGRhcENtZC5qYXZh) | `51.42% <0.00%> (-1.35%)` | :arrow_down: |
   | [...e/cloudstack/api/command/LinkAccountToLdapCmd.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy91c2VyLWF1dGhlbnRpY2F0b3JzL2xkYXAvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Nsb3Vkc3RhY2svYXBpL2NvbW1hbmQvTGlua0FjY291bnRUb0xkYXBDbWQuamF2YQ==) | `47.50% <0.00%> (-1.29%)` | :arrow_down: |
   | [...apache/cloudstack/api/command/QuotaCreditsCmd.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9kYXRhYmFzZS9xdW90YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hcGkvY29tbWFuZC9RdW90YUNyZWRpdHNDbWQuamF2YQ==) | `66.66% <0.00%> (-0.91%)` | :arrow_down: |
   | [...stack/api/command/QuotaEmailTemplateUpdateCmd.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9kYXRhYmFzZS9xdW90YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hcGkvY29tbWFuZC9RdW90YUVtYWlsVGVtcGxhdGVVcGRhdGVDbWQuamF2YQ==) | `81.81% <0.00%> (-0.54%)` | :arrow_down: |
   | [server/src/main/java/com/cloud/api/ApiServlet.java](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL2FwaS9BcGlTZXJ2bGV0LmphdmE=) | `39.28% <0.00%> (ø)` | |
   | ... and [101 more](https://codecov.io/gh/apache/cloudstack/pull/7022/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7022: Normalize APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on code in PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#discussion_r1057539760


##########
api/src/main/java/org/apache/cloudstack/api/BaseCmd.java:
##########
@@ -270,9 +267,22 @@ public String getActualCommandName() {
         } else {
             cmdName = this.getClass().getName();
         }
-       return cmdName;
+        return cmdName;
     }
 
+    public static String getCommandNameByClass(Class<?> clazz) {
+        String cmdName = null;
+        if (clazz.getAnnotation(APICommand.class) != null) {
+            cmdName = clazz.getAnnotation(APICommand.class).name();
+        } else {
+            cmdName = clazz.getName();
+        }
+        return cmdName;
+    }
+
+    public static String getResponseNameByClass(Class<?> clazz) {

Review Comment:
   is this being used?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Normalize APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1365723837

   @ezntt , good initiative. What do you propose we do with the remaining 88?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1366008747

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=7022)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7022&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7022&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7022&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=CODE_SMELL) [8 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7022&resolved=false&types=CODE_SMELL)
   
   [![55.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/50-16px.png '55.6%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_coverage&view=list) [55.6% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7022&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland merged pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland merged PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1366490089

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_multiplication_x: el9 :heavy_check_mark: debian :heavy_multiplication_x: suse15. SL-JID 5103


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368314914

   <b>Trillian test result (tid-5727)</b>
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 39768 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7022-t5727-xenserver-71.zip
   Smoke tests completed. 106 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368218614

   @DaanHoogland a Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368218850

   @weizhouapache do you approve now?
   What testing would we need for this? other than a full regression test suite, that is. cc @ezntt 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1367151848

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7022: Cleanup APIs getCommandName

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7022:
URL: https://github.com/apache/cloudstack/pull/7022#issuecomment-1368330974

   <b>Trillian test result (tid-5728)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
   Total time taken: 45798 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7022-t5728-vmware-67u3.zip
   Smoke tests completed. 105 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 667.70 | test_kubernetes_clusters.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org