mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Added deprecated API indication in the API doc (#6545)
* Added deprecated command indication as (D) in the API doc * Fixed line allignment
This commit is contained in:
parent
7a1401a111
commit
12ecfa88cd
@ -214,9 +214,11 @@ public class ApiXmlDocWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean isAsync = ReflectUtil.isCmdClassAsync(clas, new Class<?>[] {BaseAsyncCmd.class, BaseAsyncCreateCmd.class});
|
boolean isAsync = ReflectUtil.isCmdClassAsync(clas, new Class<?>[] {BaseAsyncCmd.class, BaseAsyncCreateCmd.class});
|
||||||
|
|
||||||
apiCommand.setAsync(isAsync);
|
apiCommand.setAsync(isAsync);
|
||||||
|
|
||||||
|
boolean isDeprecated = clas.getAnnotation(Deprecated.class) != null;
|
||||||
|
apiCommand.setDeprecated(isDeprecated);
|
||||||
|
|
||||||
Set<Field> fields = ReflectUtil.getAllFieldsForClass(clas, new Class<?>[] {BaseCmd.class, BaseAsyncCmd.class, BaseAsyncCreateCmd.class});
|
Set<Field> fields = ReflectUtil.getAllFieldsForClass(clas, new Class<?>[] {BaseCmd.class, BaseAsyncCmd.class, BaseAsyncCreateCmd.class});
|
||||||
|
|
||||||
request = setRequestFields(fields);
|
request = setRequestFields(fields);
|
||||||
|
|||||||
@ -32,6 +32,7 @@ public class Command implements Serializable{
|
|||||||
private String sinceVersion = null;
|
private String sinceVersion = null;
|
||||||
private ArrayList<Argument> request;
|
private ArrayList<Argument> request;
|
||||||
private ArrayList<Argument> response;
|
private ArrayList<Argument> response;
|
||||||
|
private boolean isDeprecated;
|
||||||
|
|
||||||
public Command(String name, String description) {
|
public Command(String name, String description) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@ -114,4 +115,12 @@ public class Command implements Serializable{
|
|||||||
public void setUsage(String usage) {
|
public void setUsage(String usage) {
|
||||||
this.usage = usage;
|
this.usage = usage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDeprecated() {
|
||||||
|
return isDeprecated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeprecated(boolean deprecated) {
|
||||||
|
isDeprecated = deprecated;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -234,6 +234,7 @@ for f in sys.argv:
|
|||||||
dom = minidom.parse(data)
|
dom = minidom.parse(data)
|
||||||
name = dom.getElementsByTagName('name')[0].firstChild.data
|
name = dom.getElementsByTagName('name')[0].firstChild.data
|
||||||
isAsync = dom.getElementsByTagName('isAsync')[0].firstChild.data
|
isAsync = dom.getElementsByTagName('isAsync')[0].firstChild.data
|
||||||
|
isDeprecated = dom.getElementsByTagName('isDeprecated')[0].firstChild.data
|
||||||
category = choose_category(fn)
|
category = choose_category(fn)
|
||||||
if category not in categories:
|
if category not in categories:
|
||||||
categories[category] = []
|
categories[category] = []
|
||||||
@ -241,6 +242,7 @@ for f in sys.argv:
|
|||||||
'name': name,
|
'name': name,
|
||||||
'dirname': dirname_to_dirname[dirname],
|
'dirname': dirname_to_dirname[dirname],
|
||||||
'async': isAsync == 'true',
|
'async': isAsync == 'true',
|
||||||
|
'deprecated': isDeprecated == 'true',
|
||||||
'user': dirname_to_user[dirname],
|
'user': dirname_to_user[dirname],
|
||||||
})
|
})
|
||||||
except ExpatError as e:
|
except ExpatError as e:
|
||||||
@ -252,9 +254,10 @@ for f in sys.argv:
|
|||||||
def xml_for(command):
|
def xml_for(command):
|
||||||
name = command['name']
|
name = command['name']
|
||||||
isAsync = command['async'] and ' (A)' or ''
|
isAsync = command['async'] and ' (A)' or ''
|
||||||
|
isDeprecated = command['deprecated'] and ' (D)' or ''
|
||||||
dirname = command['dirname']
|
dirname = command['dirname']
|
||||||
return '''<xsl:if test="name=\'%(name)s\'">
|
return '''<xsl:if test="name=\'%(name)s\'">
|
||||||
<li><a href="%(dirname)s/%(name)s.html"><xsl:value-of select="name"/>%(isAsync)s</a></li>
|
<li><a href="%(dirname)s/%(name)s.html"><xsl:value-of select="name"/>%(isAsync)s %(isDeprecated)s</a></li>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
''' % locals()
|
''' % locals()
|
||||||
|
|
||||||
|
|||||||
@ -66,5 +66,6 @@ version="1.0">
|
|||||||
<span>Commands available through the developer API URL and the integration API URL.</span>
|
<span>Commands available through the developer API URL and the integration API URL.</span>
|
||||||
<div class="api_legends">
|
<div class="api_legends">
|
||||||
<p><span class="api_legends_async">(A)</span> implies that the command is asynchronous.</p>
|
<p><span class="api_legends_async">(A)</span> implies that the command is asynchronous.</p>
|
||||||
|
<p><span class="api_legends_async">(D)</span> implies that the command is deprecated.</p>
|
||||||
<p>(*) implies element has a child.</p>
|
<p>(*) implies element has a child.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user