improvements / cleanup
diff --git a/server/src/main/java/com/cloud/api/doc/ApiXmlDocWriter.java b/server/src/main/java/com/cloud/api/doc/ApiXmlDocWriter.java index e8e2373..a20d333 100644 --- a/server/src/main/java/com/cloud/api/doc/ApiXmlDocWriter.java +++ b/server/src/main/java/com/cloud/api/doc/ApiXmlDocWriter.java
@@ -97,10 +97,8 @@ if (curCmd.isAssignableFrom(cmdClass)) { // api_cmd map always keep the admin cmd class to get full response and parameters s_apiNameCmdClassMap.put(apiName, cmdClass); - } else if (cmdClass.isAssignableFrom(curCmd)) { - System.out.println("Info: API Cmd class " + cmdClass.getName() + " is assignable from " + curCmd.getName() + ", skip this one"); - } else { - System.out.println("Warning: API Cmd class " + cmdClass.getName() + " has non-unique apiname " + apiName); + } else if (!cmdClass.isAssignableFrom(curCmd)) { + System.out.println("Warning: API Cmd class " + cmdClass.getName() + " has non-unique api name " + apiName); } } else { s_apiNameCmdClassMap.put(apiName, cmdClass);
diff --git a/tools/apidoc/gen_toc.py b/tools/apidoc/gen_toc.py index 1988f40..1f5a79b 100644 --- a/tools/apidoc/gen_toc.py +++ b/tools/apidoc/gen_toc.py
@@ -46,9 +46,7 @@ known_categories = { - # Use the category definition formats below: - # keyword or api: category - to choose category based on keyword or api in the api call - # api: (category, True|False) - True - use the category defined (i.e. direct api to category mapping), False - choose category same as above + # Category definition format: api keyword or api name: category 'Cisco' : 'External Device', 'SystemVm': 'System VM', 'VirtualMachine': 'Virtual Machine', @@ -129,8 +127,6 @@ 'saml': 'Authentication', 'getSPMetadata': 'Authentication', 'listIdps': 'Authentication', - # 'authorizeSamlSso': 'Authentication', - # 'listSamlAuthorization': 'Authentication', 'oauthlogin': 'Authentication', 'OauthProvider': 'OAuth', 'quota': 'Quota', @@ -206,8 +202,8 @@ 'UnmanagedInstance': 'Virtual Machine', 'Kubernetes': 'Kubernetes Service', 'Rolling': 'Rolling Maintenance', - 'vsphereStoragePolicy' : 'vSphere storage policies', - 'vsphereStoragePolicies' : 'vSphere storage policies', + 'vsphereStoragePolicy' : 'vSphere Storage Policies', + 'vsphereStoragePolicies' : 'vSphere Storage Policies', 'createConsoleEndpoint': 'Console Session', 'listConsoleSessions': 'Console Session', 'importVm': 'Virtual Machine', @@ -238,23 +234,12 @@ 'CustomAction' : 'Extension' } - categories = {} -choosing_category = 1 - - def choose_category(fn): - global choosing_category - print("choosing_category - " + str(choosing_category) + " , for fn: " + fn) - choosing_category = choosing_category + 1 possible_known_categories = [] - i = 1 for k, v in known_categories.items(): - print(str(i) + " - k:" + k + ", v:" + v + " fn: " + fn + "\n") - i = i + 1 if k.lower() in fn.lower(): - print("add to possible_known_categories - " + k + "\n") possible_known_categories.append(k) if len(possible_known_categories) > 0:
diff --git a/tools/apidoc/generatecommands.xsl b/tools/apidoc/generatecommands.xsl index e6def60..80cc060 100644 --- a/tools/apidoc/generatecommands.xsl +++ b/tools/apidoc/generatecommands.xsl
@@ -61,16 +61,10 @@ <p></p> <h1><xsl:value-of select="name"/></h1> <xsl:if test="sinceVersion"> - <h1>(since: <xsl:value-of select="sinceVersion"/>)</h1> <h2>(since: <xsl:value-of select="sinceVersion"/>)</h2> - <h2>since: <xsl:value-of select="sinceVersion"/></h2> - <h3>(since: <xsl:value-of select="sinceVersion"/>)</h3> </xsl:if> <span> <xsl:value-of select="description"/> - <xsl:if test="sinceVersion"> - <xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>) - </xsl:if> </span> </xsl:for-each> </div> @@ -101,9 +95,6 @@ <td style="width:500px;"> <strong> <xsl:value-of select="description"/> - <xsl:if test="sinceVersion"> - <xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>) - </xsl:if> </strong> </td> <td style="width:180px;"><strong><xsl:value-of select="required"/></strong></td> @@ -118,9 +109,6 @@ <td style="width:500px;"> <i> <xsl:value-of select="description"/> - <xsl:if test="sinceVersion"> - <xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>) - </xsl:if> </i> </td> <td style="width:180px;"><i><xsl:value-of select="required"/></i></td> @@ -149,9 +137,6 @@ </td> <td style="width:500px;"> <xsl:value-of select="description"/> - <xsl:if test="sinceVersion"> - <xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>) - </xsl:if> </td> <xsl:for-each select="./arguments/arg"> <tr> @@ -168,9 +153,6 @@ <td style="width:165px; padding-left:40px;"><xsl:value-of select="name"/></td> <td style="width:500px;"> <xsl:value-of select="description"/> - <xsl:if test="sinceVersion"> - <xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>) - </xsl:if> </td> </tr> </xsl:for-each>