Skip to content

Commit 5482fdf

Browse files
improvements / cleanup
1 parent 958e1b4 commit 5482fdf

File tree

3 files changed

+5
-40
lines changed

3 files changed

+5
-40
lines changed

server/src/main/java/com/cloud/api/doc/ApiXmlDocWriter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ public static void main(String[] args) {
9797
if (curCmd.isAssignableFrom(cmdClass)) {
9898
// api_cmd map always keep the admin cmd class to get full response and parameters
9999
s_apiNameCmdClassMap.put(apiName, cmdClass);
100-
} else if (cmdClass.isAssignableFrom(curCmd)) {
101-
System.out.println("Info: API Cmd class " + cmdClass.getName() + " is assignable from " + curCmd.getName() + ", skip this one");
102-
} else {
103-
System.out.println("Warning: API Cmd class " + cmdClass.getName() + " has non-unique apiname " + apiName);
100+
} else if (!cmdClass.isAssignableFrom(curCmd)) {
101+
System.out.println("Warning: API Cmd class " + cmdClass.getName() + " has non-unique api name " + apiName);
104102
}
105103
} else {
106104
s_apiNameCmdClassMap.put(apiName, cmdClass);

tools/apidoc/gen_toc.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@
4646

4747

4848
known_categories = {
49-
# Use the category definition formats below:
50-
# keyword or api: category - to choose category based on keyword or api in the api call
51-
# api: (category, True|False) - True - use the category defined (i.e. direct api to category mapping), False - choose category same as above
49+
# Category definition format: api keyword or api name: category
5250
'Cisco' : 'External Device',
5351
'SystemVm': 'System VM',
5452
'VirtualMachine': 'Virtual Machine',
@@ -129,8 +127,6 @@
129127
'saml': 'Authentication',
130128
'getSPMetadata': 'Authentication',
131129
'listIdps': 'Authentication',
132-
# 'authorizeSamlSso': 'Authentication',
133-
# 'listSamlAuthorization': 'Authentication',
134130
'oauthlogin': 'Authentication',
135131
'OauthProvider': 'OAuth',
136132
'quota': 'Quota',
@@ -206,8 +202,8 @@
206202
'UnmanagedInstance': 'Virtual Machine',
207203
'Kubernetes': 'Kubernetes Service',
208204
'Rolling': 'Rolling Maintenance',
209-
'vsphereStoragePolicy' : 'vSphere storage policies',
210-
'vsphereStoragePolicies' : 'vSphere storage policies',
205+
'vsphereStoragePolicy' : 'vSphere Storage Policies',
206+
'vsphereStoragePolicies' : 'vSphere Storage Policies',
211207
'createConsoleEndpoint': 'Console Session',
212208
'listConsoleSessions': 'Console Session',
213209
'importVm': 'Virtual Machine',
@@ -238,23 +234,12 @@
238234
'CustomAction' : 'Extension'
239235
}
240236

241-
242237
categories = {}
243238

244-
choosing_category = 1
245-
246-
247239
def choose_category(fn):
248-
global choosing_category
249-
print("choosing_category - " + str(choosing_category) + " , for fn: " + fn)
250-
choosing_category = choosing_category + 1
251240
possible_known_categories = []
252-
i = 1
253241
for k, v in known_categories.items():
254-
print(str(i) + " - k:" + k + ", v:" + v + " fn: " + fn + "\n")
255-
i = i + 1
256242
if k.lower() in fn.lower():
257-
print("add to possible_known_categories - " + k + "\n")
258243
possible_known_categories.append(k)
259244

260245
if len(possible_known_categories) > 0:

tools/apidoc/generatecommands.xsl

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,10 @@ version="1.0">
6161
<p></p>
6262
<h1><xsl:value-of select="name"/></h1>
6363
<xsl:if test="sinceVersion">
64-
<h1>(since: <xsl:value-of select="sinceVersion"/>)</h1>
6564
<h2>(since: <xsl:value-of select="sinceVersion"/>)</h2>
66-
<h2>since: <xsl:value-of select="sinceVersion"/></h2>
67-
<h3>(since: <xsl:value-of select="sinceVersion"/>)</h3>
6865
</xsl:if>
6966
<span>
7067
<xsl:value-of select="description"/>
71-
<xsl:if test="sinceVersion">
72-
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
73-
</xsl:if>
7468
</span>
7569
</xsl:for-each>
7670
</div>
@@ -101,9 +95,6 @@ version="1.0">
10195
<td style="width:500px;">
10296
<strong>
10397
<xsl:value-of select="description"/>
104-
<xsl:if test="sinceVersion">
105-
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
106-
</xsl:if>
10798
</strong>
10899
</td>
109100
<td style="width:180px;"><strong><xsl:value-of select="required"/></strong></td>
@@ -118,9 +109,6 @@ version="1.0">
118109
<td style="width:500px;">
119110
<i>
120111
<xsl:value-of select="description"/>
121-
<xsl:if test="sinceVersion">
122-
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
123-
</xsl:if>
124112
</i>
125113
</td>
126114
<td style="width:180px;"><i><xsl:value-of select="required"/></i></td>
@@ -149,9 +137,6 @@ version="1.0">
149137
</td>
150138
<td style="width:500px;">
151139
<xsl:value-of select="description"/>
152-
<xsl:if test="sinceVersion">
153-
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
154-
</xsl:if>
155140
</td>
156141
<xsl:for-each select="./arguments/arg">
157142
<tr>
@@ -168,9 +153,6 @@ version="1.0">
168153
<td style="width:165px; padding-left:40px;"><xsl:value-of select="name"/></td>
169154
<td style="width:500px;">
170155
<xsl:value-of select="description"/>
171-
<xsl:if test="sinceVersion">
172-
<xsl:text> </xsl:text>(since: <xsl:value-of select="sinceVersion"/>)
173-
</xsl:if>
174156
</td>
175157
</tr>
176158
</xsl:for-each>

0 commit comments

Comments
 (0)