Переглянути джерело

HPCC-19342 Add URL field to WU ZAP Request

Using this field, ECLWatch may add its URL to ZAP report.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 6 роки тому
батько
коміт
2aa3cb5f93

+ 3 - 0
esp/services/ws_workunits/ws_workunitsAuditLogs.cpp

@@ -1399,6 +1399,7 @@ void CWsWorkunitsSoapBindingEx::createAndDownloadWUZAPFile(IEspContext& context,
         throw MakeStringException(ECLWATCH_CANNOT_OPEN_WORKUNIT, "Cannot open workunit %s.", zapInfoReq.wuid.str());
     ensureWsWorkunitAccess(context, *cwu, SecAccess_Read);
 
+    request->getParameter("URL", zapInfoReq.url);
     request->getParameter("ESPIPAddress", zapInfoReq.espIP);
     request->getParameter("ThorIPAddress", zapInfoReq.thorIP);
     request->getParameter("ProblemDescription", zapInfoReq.problemDesc);
@@ -1417,6 +1418,8 @@ void CWsWorkunitsSoapBindingEx::createAndDownloadWUZAPFile(IEspContext& context,
 
         request->getParameter("EmailSubject", zapInfoReq.emailSubject);
         request->getParameter("EmailBody", zapInfoReq.emailBody);
+        if (!zapInfoReq.url.isEmpty())
+            zapInfoReq.emailBody.append("\r\nURL:").append(zapInfoReq.url.str());
         //Read maxAttachmentSize from setting.
         zapInfoReq.maxAttachmentSize = wswService->zapEmailMaxAttachmentSize;
         zapInfoReq.emailServer.set(wswService->zapEmailServer.get());

+ 4 - 2
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -3524,7 +3524,7 @@ void CWsWuFileHelper::createThorSlaveLogfile(Owned<IConstWorkUnit>& cwu, WsWuInf
     }
 }
 
-void CWsWuFileHelper::createZAPInfoFile(const char* espIP, const char* thorIP, const char* problemDesc,
+void CWsWuFileHelper::createZAPInfoFile(const char* url, const char* espIP, const char* thorIP, const char* problemDesc,
     const char* whatChanged, const char* timing, Owned<IConstWorkUnit>& cwu, const char* pathNameStr)
 {
     VStringBuffer fileName("%s.txt", pathNameStr);
@@ -3544,6 +3544,8 @@ void CWsWuFileHelper::createZAPInfoFile(const char* espIP, const char* thorIP, c
         ipaddr.getIpText(espIPAddr);
         sb.append("ESP:          ").append(espIPAddr.str()).append("\r\n");
     }
+    if (!isEmptyString(url))
+        sb.append("URL:          ").append(url).append("\r\n");
     if (!isEmptyString(thorIP))
         sb.append("Thor:         ").append(thorIP).append("\r\n");
     outFile->write(sb.length(), sb.str());
@@ -3710,7 +3712,7 @@ void CWsWuFileHelper::createWUZAPFile(IEspContext& context, Owned<IConstWorkUnit
 
     //create WU ZAP files
     inFileNamePrefixWithPath.set(folderToZIP.str()).append(PATHSEPCHAR).append(zapReportNameStr.str());
-    createZAPInfoFile(request.espIP.str(), request.thorIP.str(), request.problemDesc.str(), request.whatChanged.str(),
+    createZAPInfoFile(request.url.str(), request.espIP.str(), request.thorIP.str(), request.problemDesc.str(), request.whatChanged.str(),
         request.whereSlow.str(), cwu, inFileNamePrefixWithPath.str());
     createZAPECLQueryArchiveFiles(cwu, inFileNamePrefixWithPath.str());
 

+ 2 - 2
esp/services/ws_workunits/ws_workunitsHelpers.hpp

@@ -581,7 +581,7 @@ public:
 
 struct CWsWuZAPInfoReq
 {
-    StringBuffer wuid, espIP, thorIP, problemDesc, whatChanged, whereSlow, includeThorSlaveLog, zapFileName, password;
+    StringBuffer wuid, espIP, url, thorIP, problemDesc, whatChanged, whereSlow, includeThorSlaveLog, zapFileName, password;
     StringBuffer emailFrom, emailTo, emailServer, emailSubject, emailBody;
     bool sendEmail, attachZAPReportToEmail;
     unsigned maxAttachmentSize, port;
@@ -603,7 +603,7 @@ class CWsWuFileHelper
     IFile *createWorkingFolder(IEspContext &context, const char *wuid, const char *namePrefix,
         StringBuffer &namePrefixStr, StringBuffer &folderName);
 
-    void createZAPInfoFile(const char *espIP, const char *thorIP, const char *problemDesc,
+    void createZAPInfoFile(const char *url, const char *espIP, const char *thorIP, const char *problemDesc,
         const char *whatChanged, const char *timing, Owned<IConstWorkUnit> &cwu, const char *pathNameStr);
     void createZAPWUXMLFile(WsWuInfo &winfo, const char *pathNameStr);
     void createZAPECLQueryArchiveFiles(Owned<IConstWorkUnit> &cwu, const char *pathNameStr);