Input: Workspace File Selection
The workspace
input type allows users to work with their private files stored in their personal workspace. When selecting an input of type workspace
When selecting an input of type workspace
, the interface allows users to browse their workspace and select the desired file during method configuration.
method json
{
"inputs": {
"inputFile": {
"id": "inputFile",
"title": "inputFile",
"description": "Input CSV file()",
"minOccurs": 1,
"maxOccurs": 1,
"schema": {
"type": "string",
"format": "remotefile",
"default": "",
"contentMediaType": "text/csv"
}
}
},
"additionalParameters": {
"parameters": [
{
"name": "deploy-script",
"value": [
"./download.sh {{inputFile}}"
]
},
{
"name": "execute-script",
"value": [
"python XXX.py /ccp_data/inputFile.csv [[ARGS]]",
"cp -f result.csv /ccp_data/"
]
}
]
}
}
download implementation: the docker image contains the download script The following script handles token retrieval and file download:
echo "Getting token"
TOKEN=$(curl -X POST $ccpiamurl -d grant_type=refresh_token -d client_id=$ccpclientid -d refresh_token=$ccprefreshtoken -H "X-D4Science-Context: $ccpcontext" | jq -r '."access_token"')
echo Downloading /ccp_data/inputFile.csv
curl $1 -o /ccp_data/inputFile.csv -H "Authorization: Bearer $TOKEN"
echo "Downloaded"
It can be downloaded from the following URL: download.sh