diff --git a/server/src/com/cloud/api/doc/ApiXmlDocReader.java b/server/src/com/cloud/api/doc/ApiXmlDocReader.java index 54f9627478d..29fb22e491b 100644 --- a/server/src/com/cloud/api/doc/ApiXmlDocReader.java +++ b/server/src/com/cloud/api/doc/ApiXmlDocReader.java @@ -110,7 +110,6 @@ public class ApiXmlDocReader { } } - try { FileWriter fstream = new FileWriter(dirName + "/diff.txt"); BufferedWriter out = new BufferedWriter(fstream); @@ -130,12 +129,25 @@ public class ApiXmlDocReader { out.write("\nRemoved commands:\n"); for (Command c : removedCommands) { if (c.getDescription() != null && !c.getDescription().isEmpty()) { - out.write("\n " + c.getName() + " (" + c.getDescription() + ")\n"); + out.write("\n\t" + c.getName() + " (" + c.getDescription() + ")\n"); } else { - out.write("\n " + c.getName() + "\n"); + out.write("\n\t" + c.getName() + "\n"); } } + + out.write("\n Changes in command type (sync versus async"); + //Verify if the command was sync and became async and vice versa + for (String key : stableCommands.keySet()) { + if (commands.get(key).isAsync() != oldCommands.get(key).isAsync()) { + String type = "Sync"; + if (commands.get(key).isAsync()) { + type = "Async"; + } + out.write("\n\t" + stableCommands.get(key).getName() + " became " + type); + } + } + //Print differences between commands arguments out.write("\nChanges in commands arguments:\n"); diff --git a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java index 1cc289c2fea..a41a09e7c5a 100644 --- a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java +++ b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java @@ -314,6 +314,13 @@ public class ApiXmlDocWriter { request = setRequestFields(fields); + //Set Async information for the command + if (superName.equals(BaseAsyncCmd.class.getName()) || superName.equals(BaseAsyncCreateCmd.class.getName())) { + apiCommand.setAsync(true); + } else { + apiCommand.setAsync(false); + } + //Get response parameters Class responseClas = impl.responseObject(); Field[] responseFields = responseClas.getDeclaredFields(); diff --git a/server/src/com/cloud/api/doc/Command.java b/server/src/com/cloud/api/doc/Command.java index 9416919ac06..90f2f92d4c7 100644 --- a/server/src/com/cloud/api/doc/Command.java +++ b/server/src/com/cloud/api/doc/Command.java @@ -24,6 +24,7 @@ public class Command { private String name; private String description; + private boolean isAsync; private ArrayList request; private ArrayList response; @@ -66,7 +67,15 @@ public class Command { this.response = response; } - public Argument getReqArgByName(String name){ + public boolean isAsync() { + return isAsync; + } + + public void setAsync(boolean isAsync) { + this.isAsync = isAsync; + } + + public Argument getReqArgByName(String name){ for (Argument a : this.getRequest()) { if (a.getName().equals(name)) { return a;