Python WasdiLib

Methods

addFileToWASDI

wasdi.addFileToWASDI(sFileName, sStyle='')

Add a file to the wasdi workspace

Parameters:
  • sFileName – Name (with extension) of the file to add

  • sStyle – name of a valid WMS style

Returns:

status of the operation

addParameter

wasdi.addParameter(sKey, oValue)

Adds a parameter

Parameters:
  • sKey – parameter key

  • oValue – parameter value

getParameter

wasdi.getParameter(sKey, oDefault=None)

Gets a parameter using its key

Parameters:
  • sKey – parameter key

  • oDefault – Default value to return if parameter is not present

Returns:

parameter value

getParametersDict

wasdi.getParametersDict()

Get the full Params Dictionary

Returns:

a dictionary containing the parameters

getParametersFilePath

wasdi.getParametersFilePath()

Get the local parameters file Path

Returns:

local paramters file path

getSessionId

wasdi.getSessionId()

Get the WASDI Session

Returns:

Session Id [String]

getPassword

wasdi.getPassword()

Get the WASDI Password

getUser

wasdi.getUser()

Get the WASDI User

getVerbose

wasdi.getVerbose()

Get Verbose Flag

Returns:

True or False

getWorkflows

wasdi.getWorkflows()

Get the list of workflows for the user

Returns:

None if there is any error; an array of WASDI Workspace JSON Objects if everything is ok. The format is as follows:

{

“description”:STRING, “name”: STRING, “workflowId”: STRING

}

getFoundProductName

wasdi.getFoundProductName(aoProduct)

Get The name of a product from a Dictionary returned by Search EO Images

Parameters:

aoProduct – dictionary representing the product as returned by Search EO Images

Returns:

product name or ‘’ if there was any error

getProductBBOX

wasdi.getProductBBOX(sFileName)

Gets the bounding box of a file

Parameters:

sFileName – name of the file to query for bounding box

Returns:

Bounding Box if available as a String comma separated in form SOUTH,WEST,EST,NORTH

getProcessorPath

wasdi.getProcessorPath()

Get the local path of the processor (where myProcessor.py is located)

Returns:

Local path of the processor

getProcessesByWorkspace

wasdi.getProcessesByWorkspace(iStartIndex=0, iEndIndex=20, sStatus=None, sOperationType=None, sName=None)

Get a paginated list of processes in the active workspace

Parameters:
  • iStartIndex – start index of the process (0 by default is the last one)

  • iEndIndex – end index of the process (20 by default)

  • sStatus – status filter. None by default. Can be CREATED, RUNNING, STOPPED, DONE, ERROR, WAITING, READY

  • sOperationType – Operation Type Filter. None by default. Can be RUNPROCESSOR, RUNIDL, RUNMATLAB, INGEST, DOWNLOAD, GRAPH, DEPLOYPROCESSOR

  • sName – Name filter. The name meaning depends by the operation type. None by default. For RUNPROCESSOR, RUNIDL and RUNMATLAB is the name of the application

getBaseUrl

wasdi.getBaseUrl()

Get the WASDI API URL

Returns:

WASDI API URL

setWorkspaceBaseUrl

wasdi.setWorkspaceBaseUrl(sWorkspaceBaseUrl)

Set the Workspace specific API URL

Parameters:

sWorkspaceBaseUrl – Workspace API URL

getWorkspaceBaseUrl

wasdi.getWorkspaceBaseUrl()

Get the Workspace API URL

Returns:

Workspace API URL

setIsOnServer

wasdi.setIsOnServer(bIsOnServer)

Set the Is on Server Flag: keep it false, as default, while developing

Parameters:

bIsOnServer – set the flag to know if the processor is running on the server or on the local PC

getIsOnServer

wasdi.getIsOnServer()

Are we running on a WASDI Server?

Returns:

True if it is running on server, False if it is running on the local Machine

setDownloadActive

wasdi.setDownloadActive(bDownloadActive)

When in development, set True to download locally files from Server. Set it to false to NOT donwload data. In this case the developer must check the availability of the files

Parameters:

bDownloadActive – True (default) to activate autodownload. False to disactivate

getDownloadActive

wasdi.getDownloadActive()

Get the Download Active Flag

Returns:

True if auto download is active, False if it is not active

setUploadActive

wasdi.setUploadActive(bUploadActive)

When in development, set True to upload local files on Server. Set it to false to NOT upload data. In this case the developer must check the availability of the files

Parameters:

bUploadActive – True to activate Auto Upload, False to disactivate auto upload

getUploadActive

wasdi.getUploadActive()

Get the Upload Active Flag

Returns:

True if Auto Upload is Active, False if it is NOT Active

setProcId

wasdi.setProcId(sProcID)

Own Proc Id

Parameters:

sProcID – self processor identifier

getProcId

wasdi.getProcId()

Get the Own Proc Id

Returns:

Own Processor Identifier

setActiveWorkspaceId

wasdi.setActiveWorkspaceId(sActiveWorkspace)

Set the Active Workspace Id

Parameters:

sActiveWorkspace – Active Workspace Id

getActiveWorkspaceId

wasdi.getActiveWorkspaceId()

Get Active workspace Id

Returns:

the WorkspaceId as a String, ‘’ if there is any error

refreshParameters

wasdi.refreshParameters()

Refresh parameters, reading the file again

init

wasdi.init(sConfigFilePath=None)

Init WASDI Library. Call it after setting user, password, path and url or use it with a config file

Parameters:

sConfigFilePath – local path of the config file. In None or the file does not exists, WASDI will ask for login in the console

Returns:

True if login was successful, False otherwise

hello

wasdi.hello()

Hello Wasdi to test the connection.

Returns:

the hello message as Text

getWorkspaces

wasdi.getWorkspaces()

Get List of user workspaces

Returns:

an array of WASDI Workspace JSON Objects.

Each Object is like this {

“ownerUserId”:STRING, “sharedUsers”:[STRING], “workspaceId”:STRING, “workspaceName”:STRING

}

createWorkspace

wasdi.createWorkspace(sName=None)

Create a new workspaces and set it as ACTIVE Workspace

Parameters:

sName – Name of the workspace to create. Null by default

Returns:

Workspace Id as a String if it is a success, None otherwise

deleteWorkspace

wasdi.deleteWorkspace(sWorkspaceId)

Delete a workspace

Parameters:

sWorkspaceId – Id of the workspace to delete

Returns:

True if workspace could be deleted, False otherwise

getWorkspaceIdByName

wasdi.getWorkspaceIdByName(sName)

Get Id of a Workspace from the name

Parameters:

sName – Workspace Name

Returns:

the WorkspaceId as a String, ‘’ if there is any error

getWorkspaceOwnerByName

wasdi.getWorkspaceOwnerByName(sName)

Get user Id of the owner of Workspace from the name

Parameters:

sName – Name of the workspace

Returns:

the userId as a String, ‘’ if there is any error

getWorkspaceOwnerByWsId

wasdi.getWorkspaceOwnerByWsId(sWsId)

Get user Id of the owner of Workspace from the Workspace Id

Parameters:

sWsId – Workspace Id

Returns:

the userId as a String, ‘’ if there is any error

getWorkspaceUrlByWsId

wasdi.getWorkspaceUrlByWsId(sWsId)

Get Base Url of a Workspace from the Workspace Id

Parameters:

sWsId – Workspace Id

Returns:

the Workspace Base Url as a String, ‘’ if there is any error

openWorkspaceById

wasdi.openWorkspaceById(sWorkspaceId)

Open a workspace by Id

Parameters:

sWorkspaceId – Workspace Id

Returns:

the WorkspaceId as a String, ‘’ if there is any error

openWorkspace

wasdi.openWorkspace(sWorkspaceName)

Open a workspace

Parameters:

sWorkspaceName – Workspace Name

Returns:

the WorkspaceId as a String, ‘’ if there is any error

getProductsByWorkspace

wasdi.getProductsByWorkspace(sWorkspaceName)

Get the list of products in a workspace by Name

Parameters:

sWorkspaceName – Name of the workspace

Returns:

the list is an array of string. Can be empty if there is any error

getProductsByWorkspaceId

wasdi.getProductsByWorkspaceId(sWorkspaceId)

Get the list of products in a workspace by Id

Parameters:

sWorkspaceId – Workspace Id

Returns:

the list is an array of string. Can be empty if there is any error

getProductsByActiveWorkspace

wasdi.getProductsByActiveWorkspace()

Get the list of products in the active workspace

Returns:

the list is an array of string. Can be empty if there is any error

getPath

wasdi.getPath(sFile='')

Get Local File Path. If the file exists and needed the file will be automatically downloaded. Returns the full local path where to read or write sFile

Param:

sFile name of the file

Returns:

Local path where to read or write sFile

getFullProductPath

wasdi.getFullProductPath(sProductName)

Get the full local path of a product given the product name. If auto download is true and the code is running locally, WASDI will download the image and keep the file on the local PC Use the output of this API to get the full path to open a file

Parameters:

sProductName – name of the product to get the path open (WITH the final extension)

Returns:

local path of the Product File

getSavePath

wasdi.getSavePath()

Get the local base save path for a product. To save use this path + fileName. Path already include ‘/’ as last char

Returns:

local path to use to save files (with ‘/’ as last char)

getProcessStatus

wasdi.getProcessStatus(sProcessId, sDestinationWorkspaceUrl=None)

get the status of a Process

Parameters:
  • sProcessId – Id of the process to query

  • sDestinationWorkspaceUrl – allow to ask for a status of a Process That is not in the actual Active Node

Returns:

the status or ‘ERROR’ if there was any error

STATUS are CREATED, RUNNING, STOPPED, DONE, ERROR, WAITING, READY

deleteProduct

wasdi.deleteProduct(sProduct)

Delete a Product from a Workspace NOTE: the method DOES NOT delete the pyshical file on your local Disk if the app is running in your environment.

Parameters:

sProduct – Name of the product to delete (WITH EXTENSION)

Returns:

True if the file has been deleted, False if there was any error

mosaic

wasdi.mosaic(asInputFiles, sOutputFile, iNoDataValue=None, iIgnoreInputValue=None, fPixelSizeX=None, fPixelSizeY=None, bAsynch=False)

Creates a mosaic out of a set of images

Parameters:
  • asInputFiles – List of input files to mosaic

  • sOutputFile – Name of the mosaic output file

  • iNoDataValue – Value to use as noData. Use -1 to ignore

  • iIgnoreInputValue – Value to ignore from the input files of the mosaic. Use -1 to ignore

  • fPixelSizeX – double value of the output pixel X resolution

  • fPixelSizeY – double value of the output pixel Y resolution

  • bAsynch – True to return after the triggering, False to wait the process to finish

Returns:

Process ID is asynchronous execution, end status otherwise. An empty string is returned in case of failure

printStatus

wasdi.printStatus()

Prints status

searchEOImages

wasdi.searchEOImages(sPlatform, sDateFrom=None, sDateTo=None, fULLat=None, fULLon=None, fLRLat=None, fLRLon=None, sProductType=None, iOrbitNumber=None, sSensorOperationalMode=None, sCloudCoverage=None, sProvider=None, oBoundingBox=None, aoParams=None, sFileName=None)

Search EO images

Parameters:
  • sPlatform – satellite platform:(S1|S2|S3|S5P|VIIRS|L8|ENVI|ERA5)

  • sDateFrom – inital date YYYY-MM-DD

  • sDateTo – final date YYYY-MM-DD

  • fULLat – Latitude of Upper-Left corner

  • fULLon – Longitude of Upper-Left corner

  • fLRLat – Latitude of Lower-Right corner

  • fLRLon – Longitude of Lower-Right corner

  • sProductType – type of EO product; Can be null. FOR “S1” -> “SLC”,”GRD”, “OCN”. FOR “S2” -> “S2MSI1C”,”S2MSI2Ap”,”S2MSI2A”. FOR “VIIRS” -> “VIIRS_1d_composite”,”VIIRS_5d_composite”. FOR “L8” -> “L1T”,”L1G”,”L1GT”,”L1GS”,”L1TP”. For “ENVI” -> “ASA_IM__0P”, “ASA_WS__0P”

  • iOrbitNumber – orbit number

  • sSensorOperationalMode – sensor operational mode

  • sCloudCoverage – interval of allowed cloud coverage, e.g. “[0 TO 22.5]”

  • sProvider – WASDI Data Provider to query (AUTO|LSA|ONDA|CREODIAS|SOBLOO|VIIRS|SENTINEL). None means default node provider = AUTO.

  • oBoundingBox – alternative to the float lat-lon corners: an object expected to have these attributes: oBoundingBox[“northEast”][“lat”], oBoundingBox[“southWest”][“lng”], oBoundingBox[“southWest”][“lat”], oBoundingBox[“northEast”][“lng”]

  • aoParams – dictionary of search keys to add to the query. The system will add key=value to the query sent to WASDI. The parameters for each collection can be found on the on line documentation

  • sFileName – name of a specific file to search

Returns:

a list of results represented as a Dictionary with many properties. The dictionary has the “fileName” and “relativeOrbit” properties among the others

setVerbose

wasdi.setVerbose(bVerbose)

Sets verbosity :param boolean bVerbose: False non verbose, True verbose :return:

setParametersDict

wasdi.setParametersDict(aoParams)

Get the full Params Dictionary

Parameters:

aoParams – dictionary of Parameters

Returns:

a dictionary containing the parameters

setUser

wasdi.setUser(sUser)

Sets the WASDI User

Parameters:

sUser – WASDI UserID

Returns:

setPassword

wasdi.setPassword(sPassword)

Set the WASDI Password

setSessionId

wasdi.setSessionId(sSessionId)

Set the WASDI Session

setParametersFilePath

wasdi.setParametersFilePath(sParamPath)

Set The Parameters JSON File Path

Param:

sParamPath Local Path of the parameters file

setBasePath

wasdi.setBasePath(sBasePath)

Set the local Base Path for WASDI

Parameters:

sBasePath – local WASDI base Path. If not set, by default WASDI uses [USERHOME].wasdi

getBasePath

wasdi.getBasePath()

Get the local Base Path for WASDI

Returns:

local base path for WASDI

setBaseUrl

wasdi.setBaseUrl(sBaseUrl)

Set the WASDI API URL

Parameters:

sBaseUrl – WASDI API URL

setProcessPayload

wasdi.setProcessPayload(sProcessId, data)

Saves the Payload of a process

Parameters:
  • sProcessId – Id of the process

  • data – data to write in the payload. Suggestion to use a JSON

Returns:

the updated status as a String or ‘’ if there was any problem

setPayload

wasdi.setPayload(data)

Sets the payload of the current running process. The payload is saved only when run on Server. In local mode is just a print.

Parameters:

data – data to save in the payload. Suggestion is to use JSON

return None

getProcessorPayload

wasdi.getProcessorPayload(sProcessObjId, bAsJson=False)

Retrieves the payload

Parameters:
  • sProcessObjId – a valid processor obj id

  • bAsJson – flag to indicate whether the payload is a json object: if True, then a dictionary is returned

Returns:

the processor payload if present, None otherwise

getProcessorPayloadAsJson

wasdi.getProcessorPayloadAsJson(sProcessObjId)

Retrieves the payload in json format using getProcessorPayload

Parameters:

sProcessObjId – a valid processor obj id

Returns:

the processor payload if present as a dictionary, None otherwise

setSubPid

wasdi.setSubPid(sProcessId, iSubPid)

Set the sub pid

Parameters:
  • sProcessId – Id of the process

  • iSubPid – PID of the physical process

Returns:

the updated status as a String or ‘’ if there was any problem

saveFile

wasdi.saveFile(sFileName)

Ingest a new file in the Active WASDI Workspace. The method takes a file saved in the workspace root (see getSaveFilePath) not already added to the WS To work be sure that the file is on the server

Param:

Name of the file to add to the workpsace

Returns:

Status of the operation

updateProgressPerc

wasdi.updateProgressPerc(iPerc)

Update the actual progress Percentage of the processor

Parameters:

iPerc – new Percentage. Use a value between 0 and 100 to set it. The value must be an integer

Returns:

updated status of the process or ‘’ if there was any error

updateProcessStatus

wasdi.updateProcessStatus(sProcessId, sStatus, iPerc=-1)

Update the status of a process

Parameters:
  • sProcessId – Id of the process to update.

  • sStatus – Status of the process. Can be CREATED, RUNNING, STOPPED, DONE, ERROR, WAITING, READY

  • iPerc – percentage of complete of the processor. Use -1 to ignore Percentage. Use a value between 0 and 100 to set it.

Returns:

the updated status as a String or ‘’ if there was any problem

updateStatus

wasdi.updateStatus(sStatus, iPerc=-1)

Update the status of the running process

Parameters:
  • sStatus – new status. Can be CREATED, RUNNING, STOPPED, DONE, ERROR, WAITING, READY

  • iPerc – new Percentage.-1 By default, means no change percentage. Use a value between 0 and 100 to set it.

Returns:

the updated status as a String or ‘’ if there was any problem

waitProcess

wasdi.waitProcess(sProcessId, sDestinationWorkspaceUrl=None)

Wait for a process to End

Parameters:

sProcessId – Id of the process to wait

Returns:

output status of the process

waitProcesses

wasdi.waitProcesses(asProcIdList)

Wait for a list of processes to wait. The list of processes is an array of strings, each with a proc id to wait

Parameters:

asProcIdList – list of strings, procId, to wait

Returns:

list of strings with the same number of elements in input, with the exit status of the processes

_downloadFile

wasdi._downloadFile(sFileName)

Download a file from WASDI

Parameters:

sFileName – file to download

Returns:

None

wasdiLog

wasdi.wasdiLog(sLogRow)

Write one row of Log

Parameters:

sLogRow – text to log

Returns:

None

fileExistsOnWasdi

wasdi.fileExistsOnWasdi(sFileName)

checks if a file already exists on WASDI or not

Parameters:

sFileName – file name with extension

Returns:

True if the file exists, False otherwise

importProductByFileUrl

wasdi.importProductByFileUrl(sFileUrl=None, sName=None, sBoundingBox=None, sProvider=None)

Imports a product from a Provider in WASDI, starting from the File URL.

Parameters:
  • sFileUrl – url of the file to import

  • sName – Name of the file to import as returned by the Data Provider

  • sBoundingBox – declared bounding box of the file to import

  • sProvider – WASDI Data Provider to use. Use None for Default

Returns:

execution status as a STRING. Can be DONE, ERROR, STOPPED.

asynchImportProductByFileUrl

wasdi.asynchImportProductByFileUrl(sFileUrl=None, sName=None, sBoundingBox=None, sProvider=None)

Asynch Import of a product from a Provider in WASDI, starting from file URL

Parameters:
  • sFileUrl – url of the file to import as returned by the data provider

  • sName – Name of the file to import as returned by the Data Provider

  • sBoundingBox – declared bounding box of the file to import

  • sProvider – WASDI Data Provider. Use None for default

Returns:

ProcessId of the Download Operation or “ERROR” if there is any problem

importProduct

wasdi.importProduct(oProduct, sProvider=None)

Imports a product from a Provider in WASDI starting from the object returned by searchEOImages

Parameters:
  • oProduct – product dictionary as returned by searchEOImages

  • sProvider – WASDI Data Provider. Use None for default

Returns:

execution status as a STRING. Can be DONE, ERROR, STOPPED.

asynchImportProduct

wasdi.asynchImportProduct(oProduct, sProvider=None)

Asynch Import a product from a Provider in WASDI starting from the object returned by searchEOImages

Parameters:
  • oProduct – product dictionary as returned by searchEOImages

  • sProvider – WASDI Data Provider. Use None for default

Returns:

ProcessId of the Download Operation or “ERROR” if there is any problem

importProductList

wasdi.importProductList(aoProducts, sProvider=None)

Imports a list of product from a Provider in WASDI starting from an array of objects returned by searchEOImages

Parameters:
  • aoProducts – Array of product dictionary as returned by searchEOImages

  • sProvider – WASDI Data Provider. Use None for default

Returns:

execution status as an array of STRINGs, one for each product in input. Can be CREATED, DONE, ERROR, STOPPED, WAITING, READY

asynchImportProductList

wasdi.asynchImportProductList(aoProducts, sProvider=None)

Asynch Import a list of product from a Provider in WASDI starting from an array of objects returned by searchEOImages

Parameters:
  • aoProducts – Array of product dictionary as returned by searchEOImages

  • sProvider – WASDI Data Provider. Use None for default

Returns:

array of the ProcessId of the Download Operations. An element can be “ERROR” if there was any problem

asynchAddFileToWASDI

wasdi.asynchAddFileToWASDI(sFileName, sStyle='')

Triggers the ingestion of File Name in the workspace

Param:

sFileName: Name (with extension) of the file to add

Parameters:

sStyle – name of a valid WMS style

Returns:

Process Id of the ingestion

importAndPreprocess

wasdi.importAndPreprocess(aoImages, sWorkflow, sPreProcSuffix='_proc.tif', sProvider=None)

Imports in WASDI and apply a SNAP Workflow to an array of EO Images as returned by searchEOImages

Parameters:
  • aoImages – array of images to import as returned by searchEOImages

  • sWorkflow – name of the workflow to apply to each imported images

  • sProvider – WASDI Data Provider. Use None for default

  • sPreProcSuffix – suffix to use for the name of the output of the workflows

Returns:

asynchExecuteProcessor

wasdi.asynchExecuteProcessor(sProcessorName, aoParams={})

Legacy: use executeProcessor Executes a WASDI Processor asynchronously. The method try up to three time if there is any problem.

Parameters:
  • sProcessorName – WASDI processor name

  • aoParams – a dictionary of parameters for the processor

Returns:

the Process Id if every thing is ok, ‘’ if there was any problem

executeProcessor

wasdi.executeProcessor(sProcessorName, aoProcessParams)

Executes a WASDI Processor asynchronously. The method try up to three time if there is any problem.

Parameters:
  • sProcessorName – WASDI processor name

  • aoParams – a dictionary of parameters for the processor

Returns:

the Process Id if every thing is ok, ‘’ if there was any problem

_uploadFile

wasdi._uploadFile(sFileName)

Uploads a file to WASDI

Parameters:

sFileName – name of file inside working directory OR path to file RELATIVE to working directory

Returns:

True if succeded, False otherwise

subset

wasdi.subset(sInputFile, sOutputFile, dLatN, dLonW, dLatS, dLonE)

Creates a Subset of an image:

Parameters:
  • sInputFile – Input file

  • sOutputFile – Output File

  • dLatN – Latitude north of the subset

  • dLonW – Longitude west of the subset

  • dLatS – Latitude South of the subset

  • dLonE – Longitude Est of the subset

multiSubset

wasdi.multiSubset(sInputFile, asOutputFiles, adLatN, adLonW, adLatS, adLonE, bBigTiff=False)

Creates a Many Subsets from an image. MAX 10 TILES PER CALL

Parameters:
  • sInputFile – Input file

  • sOutputFile – Array of Output File Names

  • dLatN – Array of Latitude north of the subset

  • dLonW – Array of Longitude west of the subset

  • dLatS – Array of Latitude South of the subset

  • dLonE – Array of Longitude Est of the subset

executeWorkflow

wasdi.executeWorkflow(asInputFileNames, asOutputFileNames, sWorkflowName)

Execute a SNAP Workflow available in WASDI (you can use WASDI to upload your SNAP Graph XML and use from remote)

Parameters:
  • asInputFileNames – array of the inputs of the workflow. Must correspond to the number of inputs of the workflow.

  • asOutputFileNames – array of the outputs of the workflow. Must correspond to the number of inputs of the workflow.

  • sWorkflowName – Name of the workflow to run

Returns:

final status of the executed Workflow

asynchExecuteWorkflow

wasdi.asynchExecuteWorkflow(asInputFileNames, asOutputFileNames, sWorkflowName)

Trigger the asynch execution of a SNAP Workflow available in WASDI (you can use WASDI to upload your SNAP Graph XML and use from remote)

Parameters:
  • asInputFileNames – array of the inputs of the workflow. Must correspond to the number of inputs of the workflow.

  • asOutputFileNames – array of the outputs of the workflow. Must correspond to the number of inputs of the workflow.

  • sWorkflowName – Name of the workflow to run

Returns:

Process Id of the started workflow

asynchMosaic

wasdi.asynchMosaic(asInputFiles, sOutputFile, iNoDataValue=None, iIgnoreInputValue=None, fPixelSizeX=None, fPixelSizeY=None)

Start a mosaic out of a set of images in asynch way

Parameters:
  • asInputFiles – List of input files to mosaic

  • sOutputFile – Name of the mosaic output file

  • iNoDataValue – Value to use as noData. Use -1 to ignore

  • iIgnoreInputValue – Value to ignore from the input files of the mosaic. Use -1 to ignore

  • fPixelSizeX – double value of the output pixel X resolution

  • fPixelSizeY – double value of the output pixel Y resolution

Returns:

Process ID is asynchronous execution, end status otherwise. An empty string is returned in case of failure

copyFileToSftp

wasdi.copyFileToSftp(sFileName, bAsynch=None, sRelativePath=None)

Copy a file from a workspace to the WASDI user’s SFTP Folder

Parameters:
  • sFileName – FIle name (with extension, without path) to copy in the SFTP folder

  • bAsynch – True to return after the triggering, False to wait the process to finish

Returns:

Process ID is asynchronous execution, end status otherwise. An empty string is returned in case of failure

_log

wasdi._log(sLog)

Internal Log function

Parameters:

sLog – text row to log

_getStandardHeaders

wasdi._getStandardHeaders()

Get the standard headers for a WASDI API Call, setting also the session token

Returns:

dictionary of headers to add to the REST API

_loadConfig

wasdi._loadConfig(sConfigFilePath)

Loads configuration from given file

Parameters:

sConfigFilePath – a string containing a path to the configuration file

_loadParams

wasdi._loadParams()

Loads parameters from file, if specified in configuration file

_unzip

wasdi._unzip(sAttachmentName, sPath)

Unzips a file

Parameters:
  • sAttachmentName – filename to unzip

  • sPath – both the path where the file is and where it must be unzipped

Returns:

None

_waitForResume

_normPath

wasdi._normPath(sPath)

Normalizes path by adjusting separator

Parameters:

sPath – a path to be normalized

Returns:

the normalized path

_internalAddFileToWASDI

_internalExecuteWorkflow

wasdi._internalExecuteWorkflow(asInputFileNames, asOutputFileNames, sWorkflowName, bAsynch=False)

Internal call to execute workflow

Parameters:
  • asInputFileNames – name of the file in input (string WITH extension) or array of strings of the files in input (WITH extension)

  • asOutputFileNames – name of the file in output (string WITH extension) or array of strings of the files in output (WITH extension)

  • sWorkflowName – name of the SNAP workflow uploaded in WASDI

  • bAsynch – true to run asynch, false to run synch

Returns:

processID if asynch, status of the executed process if synch, empty string in case of failure

_fileOnNode

wasdi._fileOnNode(sFileName)

checks if a file already exists on the node of the workspace or not

Parameters:

sFileName – file name with extension

Returns:

True if the file exists, False otherwise

_getDefaultCRS

Changelog