cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [28/44] git commit: updated refs/heads/4.9-bountycastle-daan to a001d75
Date Mon, 02 May 2016 14:36:49 GMT
Log responses from asynchronous api commands

This is mainly useful so that we can see the job ids in the logs
whenever the job is created via the API.


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

Branch: refs/heads/4.9-bountycastle-daan
Commit: 7778e24bf7bb7bd2c1a19fde5fb711b8d8086446
Parents: 5c1ad90
Author: Nathan Johnson <njohnson@ena.com>
Authored: Wed Apr 27 14:49:50 2016 -0500
Committer: Nathan Johnson <njohnson@ena.com>
Committed: Wed Apr 27 19:43:57 2016 -0500

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiServer.java | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7778e24b/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java
index f76b851..6ec2f18 100644
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@ -686,14 +686,21 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler,
ApiSer
                 s_logger.warn(errorMsg);
                 throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, errorMsg);
             }
-
+            final String response;
             if (objectId != null) {
                 final String objUuid = (objectUuid == null) ? objectId.toString() : objectUuid;
-                return getBaseAsyncCreateResponse(jobId, (BaseAsyncCreateCmd)asyncCmd, objUuid);
+                response = getBaseAsyncCreateResponse(jobId, (BaseAsyncCreateCmd)asyncCmd,
objUuid);
             } else {
                 SerializationContext.current().setUuidTranslation(true);
-                return getBaseAsyncResponse(jobId, asyncCmd);
+                response = getBaseAsyncResponse(jobId, asyncCmd);
             }
+            // Always log response for async for now, I don't think any sensitive data will
be in here.
+            // It might be nice to send this through scrubbing similar to how
+            // ApiResponseSerializer.toSerializedStringWithSecureLogs works. For now, this
gets jobid's
+            // in the api logs.
+            log.append(response);
+            return response;
+
         } else {
             dispatcher.dispatch(cmdObj, params, false);
 


Mime
View raw message