Browse Source

Merge pull request #13439 from AttilaVamos/HPCC-22980-feature-master

HPCC-22980 Spraying JSON not available as an option from Std library

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 years ago
parent
commit
79af69b153

File diff suppressed because it is too large
+ 46 - 0
ecllibrary/std/File.ecl


+ 3 - 1
esp/scm/ws_fs.ecm

@@ -386,6 +386,8 @@ ESPrequest [nil_remove] SprayVariable
     [min_ver("1.11")] bool isJSON(false);
     [min_ver("1.14")] int expireDays;
     [min_ver("1.14")] string DFUServerQueue;
+    [min_ver("1.19")] string srcUsername;
+    [min_ver("1.19")] string srcPassword;
 };
 
 ESPresponse [exceptions_inline]
@@ -685,7 +687,7 @@ ESPresponse [exceptions_inline, nil_remove] GetDFUServerQueuesResponse
 
 ESPservice [
     auth_feature("DEFERRED"),
-    version("1.18"),
+    version("1.19"),
     exceptions_inline("./smc_xslt/exceptions.xslt")] FileSpray
 {
     ESPmethod EchoDateTime(EchoDateTime, EchoDateTimeResponse);

File diff suppressed because it is too large
+ 90 - 0
plugins/fileservices/fileservices.cpp


File diff suppressed because it is too large
+ 2 - 0
plugins/fileservices/fileservices.hpp


+ 5 - 5
testing/regress/ecl/spray_test_json.ecl

@@ -35,10 +35,11 @@ isSmallFile := #IFDEFINED(root.isSmallFile, true);
 
 isUnBallanced := #IFDEFINED(root.isUnBallanced, false);
 
-dropzonePath := '/var/lib/HPCCSystems/mydropzone/' : STORED('dropzonePath');
+dropzonePath := FileServices.GetDefaultDropZone() +'/' : STORED('dropzonePath');
 engine := thorlib.platform() : stored('thor');
 prefix := setup.Files(false, false).FilePrefix + '-' + WORKUNIT;
 nodes := thorlib.nodes();
+espUrl := FileServices.GetEspURL() + '/FileSpray';
 
 unsigned VERBOSE := 0;
 
@@ -163,18 +164,17 @@ sprayRec := RECORD
   string msg;
 end;
 
-//To spray a JSON file we use XML Spray
+//To spray a JSON file we use JSON Spray
 sprayRec doSpray(sprayRec l) := TRANSFORM
     SELF.sourceFileName := l.sourceFileName;
     SELF.targetFileName := l.targetFileName;
-    SELF.msg := FileServices.fSprayXml(
+    SELF.msg := FileServices.fSprayJson(
                                 SOURCEIP := '.',
                                 SOURCEPATH := l.sourceFileName,
-                                SOURCEROWTAG := 'Row',
                                 DESTINATIONGROUP := 'my'+engine,
                                 DESTINATIONLOGICALNAME := l.targetFileName,
                                 TIMEOUT := -1,
-                                ESPSERVERIPPORT := 'http://127.0.0.1:8010/FileSpray',
+                                ESPSERVERIPPORT := espUrl,
                                 ALLOWOVERWRITE := true
                                 );
     self.result := 'Spray Pass';