incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: refs/heads/master - Revert "api: Include cloudstack-version in both xml and json api response"
Date Thu, 31 Jan 2013 00:12:35 GMT
Updated Branches:
  refs/heads/master 0f130e15c -> 85aa3a997


Revert "api: Include cloudstack-version in both xml and json api response"

This reverts commit f8a483fc5a47cb66ac4788fcd7d53da0c9d6ea2b.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/85aa3a99
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/85aa3a99
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/85aa3a99

Branch: refs/heads/master
Commit: 85aa3a9977ce9486827ab57b985cc847cf729887
Parents: 0f130e1
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Wed Jan 30 14:27:11 2013 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Wed Jan 30 16:12:21 2013 -0800

----------------------------------------------------------------------
 api/src/org/apache/cloudstack/api/BaseCmd.java     |    8 ++++----
 server/src/com/cloud/api/ApiServlet.java           |   14 ++++----------
 .../cloud/api/response/ApiResponseSerializer.java  |    6 ++----
 3 files changed, 10 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/85aa3a99/api/src/org/apache/cloudstack/api/BaseCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java
index ef72af9..966e39c 100644
--- a/api/src/org/apache/cloudstack/api/BaseCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCmd.java
@@ -289,14 +289,14 @@ public abstract class BaseCmd {
         StringBuffer sb = new StringBuffer();
         if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
             // JSON response
-            sb.append("{ \"" + getCommandName() + "\" : { " + "\"@attributes\":{\"cloudstack-version\":\""
+ _mgr.getVersion() + "\"},");
+            sb.append("{ \"" + getCommandName() + "\" : { " + "\"@attributes\":{\"cloud-stack-version\":\""
+ _mgr.getVersion() + "\"},");
             sb.append("\"errorcode\" : \"" + apiException.getErrorCode() + "\", \"description\"
: \"" + apiException.getDescription() + "\" } }");
         } else {
             sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
             sb.append("<" + getCommandName() + ">");
             sb.append("<errorcode>" + apiException.getErrorCode() + "</errorcode>");
             sb.append("<description>" + escapeXml(apiException.getDescription()) +
"</description>");
-            sb.append("</" + getCommandName() + " cloudstack-version=\"" + _mgr.getVersion()
+ "\">");
+            sb.append("</" + getCommandName() + " cloud-stack-version=\"" + _mgr.getVersion()
+ "\">");
         }
         return sb.toString();
     }
@@ -307,10 +307,10 @@ public abstract class BaseCmd {
 
         // set up the return value with the name of the response
         if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
-            prefixSb.append("{ \"" + getCommandName() + "\" : { \"@attributes\":{\"cloudstack-version\":\""
+ _mgr.getVersion() + "\"},");
+            prefixSb.append("{ \"" + getCommandName() + "\" : { \"@attributes\":{\"cloud-stack-version\":\""
+ _mgr.getVersion() + "\"},");
         } else {
             prefixSb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
-            prefixSb.append("<" + getCommandName() + " cloudstack-version=\"" + _mgr.getVersion()
+ "\">");
+            prefixSb.append("<" + getCommandName() + " cloud-stack-version=\"" + _mgr.getVersion()
+ "\">");
         }
 
         int i = 0;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/85aa3a99/server/src/com/cloud/api/ApiServlet.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServlet.java b/server/src/com/cloud/api/ApiServlet.java
index 0f8924a..3244351 100755
--- a/server/src/com/cloud/api/ApiServlet.java
+++ b/server/src/com/cloud/api/ApiServlet.java
@@ -402,13 +402,10 @@ public class ApiServlet extends HttpServlet {
                     }
                 }
             }
-            sb.append(" }");
-            sb.append(", \"cloudstack-version\": \"");
-            sb.append(ApiDBUtils.getVersion());
-            sb.append("\" }");
+            sb.append(" } }");
         } else {
             sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
-            sb.append("<loginresponse cloudstack-version=\"" + ApiDBUtils.getVersion()
+ "\">");
+            sb.append("<loginresponse cloud-stack-version=\"" + ApiDBUtils.getVersion()
+ "\">");
             sb.append("<timeout>" + inactiveInterval + "</timeout>");
             Enumeration attrNames = session.getAttributeNames();
             if (attrNames != null) {
@@ -435,13 +432,10 @@ public class ApiServlet extends HttpServlet {
     private String getLogoutSuccessResponse(String responseType) {
         StringBuffer sb = new StringBuffer();
         if (BaseCmd.RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
-            sb.append("{ \"logoutresponse\" : { \"description\" : \"success\" }");
-            sb.append(", \"cloudstack-version\": \"");
-            sb.append(ApiDBUtils.getVersion());
-            sb.append("\" }");
+            sb.append("{ \"logoutresponse\" : { \"description\" : \"success\" } }");
         } else {
             sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
-            sb.append("<logoutresponse cloudstack-version=\"" + ApiDBUtils.getVersion()
+ "\">");
+            sb.append("<logoutresponse cloud-stack-version=\"" + ApiDBUtils.getVersion()
+ "\">");
             sb.append("<description>success</description>");
             sb.append("</logoutresponse>");
         }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/85aa3a99/server/src/com/cloud/api/response/ApiResponseSerializer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/response/ApiResponseSerializer.java b/server/src/com/cloud/api/response/ApiResponseSerializer.java
index 11aee3d..3b1d9a6 100644
--- a/server/src/com/cloud/api/response/ApiResponseSerializer.java
+++ b/server/src/com/cloud/api/response/ApiResponseSerializer.java
@@ -122,9 +122,7 @@ public class ApiResponseSerializer {
                     sb.append("{ }");
                 }
             }
-            sb.append(", \"cloudstack-version\": \"");
-            sb.append(ApiDBUtils.getVersion());
-            sb.append("\" }");
+            sb.append(" }");
             return sb.toString();
         }
         return null;
@@ -133,7 +131,7 @@ public class ApiResponseSerializer {
     private static String toXMLSerializedString(ResponseObject result) {
         StringBuilder sb = new StringBuilder();
         sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-        sb.append("<").append(result.getResponseName()).append(" cloudstack-version=\"").append(ApiDBUtils.getVersion()).append("\">");
+        sb.append("<").append(result.getResponseName()).append(" cloud-stack-version=\"").append(ApiDBUtils.getVersion()).append("\">");
 
         if (result instanceof ListResponse) {
             Integer count = ((ListResponse) result).getCount();


Mime
View raw message