Loads raster files into HDFS using spark as implementation
post
/spatialviewer/api/v1/raster/spark/operations/load
Request
Supported Media Types
- application/json
Query Parameters
-
async(optional): boolean
Indicates if the job requires to be executed asynchronous or not. By default this value is false.
Raster load object with all the required details
Root Schema : RasterLoadOperationPayloadObject
Type:
Show Source
object
-
dfsBlockSizeMB:
number
Value used to determine the tiles size of the upload rasters.Example:
128
-
inputPaths:
string
File paths separed by commaExample:
/opt/oracle/oracle-spatial-graph/spatial/raster/HOL/data/raster/hawaii.tif,/opt/oracle/oracle-spatial-graph/spatial/raster/HOL/data/raster/maui.tif
-
memoryMB(optional):
number
Value used to reserve memory for run the job in hadoop. If you send this value to the spark endpoint the value will be ignored.Example:
160
-
outputDirectory:
string
Output directory name. Directory will be created inside the HDFS (If it not exists yet). By default: upload. It follow the rules for directory names, special characters are not valid even ':'Example:
upload
-
overlap:
number
Minimum Value:
1
Maximum Value:200
Raster overlap valueExample:2
Response
Supported Media Types
- application/json
201 Response
raster load operation has been done successfully
Root Schema : RasterLoadOperationSuccessResponse
Type:
Show Source
object
-
o:successCode(optional):
string
Success code.Example:
SVR-00200
-
response(optional):
object response
Details about the success response
-
status(optional):
string
success or errorExample:
sucess
-
title(optional):
string
Response descriptionExample:
Success Response.
Nested Schema : response
Type:
object
Details about the success response
Show Source
-
items(optional):
array items
List the details of the uploaded rasters individually.
-
message(optional):
string
Success messageExample:
Rasters load finished successfully, jobId: job_1533232152884_0462
Nested Schema : items
Type:
array
List the details of the uploaded rasters individually.
Show Source
Nested Schema : RasterLoadRasterDetailsEntry
Type:
Show Source
object
-
inputFile(optional):
string
Input file path.Example:
/net/den01spo/scratch/swap/spatialviewer/data/rasters/kahoolawe.tif
-
metadata(optional):
string
Path of the generated raster metadata.Example:
/user/hdfs/spatial_raster/metadata/af766de6bf3ea93700163ee99ca6d61c88501ae6.loc
-
outputFile(optional):
string
Path of the uploaded raster in a special format.Example:
/user/hdfs/upload/kahoolawe.tif.ohif
-
thumbnail(optional):
string
Path of the generated thumbnail for this raster file.Example:
/net/den01spo/scratch/swap/spatialviewer//thumb/user/hdfs/upload/kahoolawe.tif.ohif.tif
202 Response
raster load operations was schedule
Root Schema : RasterOperationAcceptedResponse
Type:
Show Source
object
-
o:successCode(optional):
string
Success code.Example:
SVR-00205
-
response(optional):
string
Job status tracking URLExample:
http://system4.example.com:8088
-
status(optional):
string
success or errorExample:
sucess
-
title(optional):
string
Response descriptionExample:
Job was accepted.
406 Response
invalid parameters
Root Schema : RasterOperationsInvalidParametersResponse
Type:
Show Source
object
-
detail(optional):
string
Response details information message about the bad parametersExample:
newDiretory: New Directory name can not be null, overlap: Overlap value can not be null
-
o:errorCode(optional):
string
Error code.Example:
SVR-E0010
-
status(optional):
string
success or errorExample:
error
-
title(optional):
string
Response descriptionExample:
Invalid parameters.
417 Response
raster load operation has been done unsuccessfully due some error in the choose implementation
Root Schema : RasterLoadOperationUnsuccessResponse
Type:
Show Source
object
-
detail(optional):
string
Response details information message about the failed job. For hadoop can contain information about the logs like an URL to download the log details.Example:
Raster load finished unsuccessfully
-
o:errorCode(optional):
string
Error code.Example:
SVR-E0020
-
status(optional):
string
success or errorExample:
error
-
title(optional):
string
Response descriptionExample:
Invalid parameters.
500 Response
unknow error
Root Schema : RasterErrorGenericResponse
Type:
Show Source
object
-
detail(optional):
string
Response details informationExample:
Unknow error
-
o:errorCode(optional):
string
Success code.Example:
SVR-E0001
-
status(optional):
string
success or errorExample:
error
-
title(optional):
string
Response descriptionExample:
Error while processing REST request.
503 Response
GDAL set up is incomplete
Root Schema : GDALSetUpIsIncompleteResponse
Type:
Show Source
object
-
detail(optional):
string
Informative messageExample:
GDAL library is not correctly set up. Check the admin settings or your GDAL installation
-
o:errorCode(optional):
string
Error code.Example:
SVR-E0012
-
status(optional):
string
success or errorExample:
error
-
title(optional):
string
Response descriptionExample:
GDAL library is not correctly set up.
Examples
Schedules or initiates a load job using spark to load the raster files into hdfs.
The following example shows how to submit a raster load using spark as implementation by submitting a POST request on the REST resource using cURL.
curl -X POST "http://localhost:8045/spatialviewer/api/v1/raster/spark/operations/load?async=false" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"outputDirectory\":\"upload\",\"overlap\":\"2\",\"blockSizeMB (MB)\":\"128\",\"inputPaths\":\"/net/den01spo/scratch/swap/spatialviewer/data/rasters/hawaii.tif\"}"
Example of Response Header
Example of Response Header
HTTP/1.1 200 OK Date: Wed, 22 Aug 2018 22:32:56 GMT Content-Type: application/json Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, DELETE, PUT Access-Control-Allow-Headers: Content-Type, Accept Transfer-Encoding: chunked
Example of the Response Body
The following example shows the contents of the response body in JSON format
{ "status" : "success", "title" : "Success Response.", "o:successCode" : "SVR-00200", "response" : { "message" : "Rasters load finished successfully, jobId: application_1533232152884_0600", "items" : [ { "inputFile" : "/net/den01spo/scratch/swap/spatialviewer/data/rasters/hawaii.tif", "metadata" : "/user/hdfs/spatial_raster/metadata/78e9beec959cf0c81a582b49fba227ea288b1ddb.loc", "outputFile" : "/user/hdfs/upload/hawaii.tif.ohif", "thumbnail" : "/net/den01spo/scratch/swap/spatialviewer//thumb/user/hdfs/upload/hawaii.tif.ohif.tif" } ] } }