File tree Expand file tree Collapse file tree
server/src/com/cloud/api/doc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,10 +105,21 @@ public static void main(String[] args) {
105105 for (Class <?> cmdClass : cmdClasses ) {
106106 String apiName = cmdClass .getAnnotation (APICommand .class ).name ();
107107 if (s_apiNameCmdClassMap .containsKey (apiName )) {
108- System .out .println ("Warning, API Cmd class " + cmdClass .getName () + " has non-unique apiname" + apiName );
109- continue ;
108+ // handle API cmd separation into admin cmd and user cmd with the common api name
109+ Class <?> curCmd = s_apiNameCmdClassMap .get (apiName );
110+ if (curCmd .isAssignableFrom (cmdClass )) {
111+ // api_cmd map always keep the admin cmd class to get full response and parameters
112+ s_apiNameCmdClassMap .put (apiName , cmdClass );
113+ } else if (cmdClass .isAssignableFrom (curCmd )) {
114+ // just skip this one without warning
115+ continue ;
116+ } else {
117+ System .out .println ("Warning, API Cmd class " + cmdClass .getName () + " has non-unique apiname " + apiName );
118+ continue ;
119+ }
120+ } else {
121+ s_apiNameCmdClassMap .put (apiName , cmdClass );
110122 }
111- s_apiNameCmdClassMap .put (apiName , cmdClass );
112123 }
113124
114125 LinkedProperties preProcessedCommands = new LinkedProperties ();
You can’t perform that action at this time.
0 commit comments