This is an automated email from the ASF dual-hosted git repository. sureshanaparti pushed a commit to branch api-docs-improvements in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit fb010ac3a8dbc7919323359d937d9321ca30b5cd Author: Suresh Kumar Anaparti <[email protected]> AuthorDate: Sat Jan 17 14:43:01 2026 +0530 improvements / cleanup --- .../main/java/com/cloud/api/doc/ApiXmlDocWriter.java | 6 ++---- tools/apidoc/gen_toc.py | 19 +++---------------- tools/apidoc/generatecommands.xsl | 18 ------------------ 3 files changed, 5 insertions(+), 38 deletions(-) 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 e8e2373d4a1..a20d33356d5 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 @@ public class ApiXmlDocWriter { 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 1988f4052c8..0c83596ff29 100644 --- a/tools/apidoc/gen_toc.py +++ b/tools/apidoc/gen_toc.py @@ -46,9 +46,7 @@ dirname_to_dirname = { 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', @@ -206,8 +204,8 @@ known_categories = { '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 +236,12 @@ known_categories = { '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 e6def6007dd..80cc0603b8e 100644 --- a/tools/apidoc/generatecommands.xsl +++ b/tools/apidoc/generatecommands.xsl @@ -61,16 +61,10 @@ version="1.0"> <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 @@ version="1.0"> <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 @@ version="1.0"> <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 @@ version="1.0"> </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 @@ version="1.0"> <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>
