Example of GET vpz/experiment and POST vpz/experiment in command line with cURL¶
For the simulator ‘wwdm.vpz’ whose Id is 266, enter the cURL commands in a command line window.
Example illustrating how to build and run one’s own experiment plan based on a chosen simulator, by filling the experiment conditions into a xls file and receiving the simulation results into a xls file.
First step : GET vpz/experiment request¶
A GET vpz/experiment request is done to get the experiment conditions of the simulator in its original state.
cURL command line :
curl "http://erecord.toulouse.inra.fr:8000/vpz/experiment/?vpz=266&mode=todownload"
The received experiment.xls
file
contains the experiment conditions of the simulator in its original state.
Second step : build one’s own experiment plan into a xls file¶
Into the experiment.xls
file
received from the GET vpz/experiment request (see ‘first step’ above),
or a copy of it, one can modify the experiment conditions as wanted : for
example, a modified
experiment.xls
file.
Third step : POST vpz/experiment request¶
A POST vpz/experiment request is done to run the experiment plan
defined into the built
experiment.xls
file
(see ‘second step’).
cURL command line :
curl -F 'experimentfile=@experiment.xls' -F 'vpz=266' -F 'mode=todownload' http://erecord.toulouse.inra.fr:8000/vpz/experiment/
The returned experiment.xls
file contains the simulation results and experiment conditions.
A variant¶
A POST vpz/experiment request to modify the input datas folder
(by using datafolder and datafoldercopy)
and run the experiment plan defined into the built
experiment.xls
file.
____________________________________________________________________
| The original input datas folder of the simulator wwdm.vpz is : |
| data/31035002.csv |
| /serieclim.dat |
| wwdm_data.zip contains : data/31035002_bis.csv |
| /31035002_ter.csv |
| |
| (31035002_bis.csv and 31035002_ter.csv are copies of 31035002.csv) |
____________________________________________________________________
-------------------------------------------------------------------------------
* Case :
- wwdm_data.zip as datafolder
- replace datafoldercopy
- cond_meteo.meteo_file="31035002_ter.csv" (modified into experiment.xls)
* cURL command line :
curl -F 'experimentfile=@experiment.xls' -F 'vpz=266' -F 'datafolder=@wwdm_data.zip' -F 'datafoldercopy=replace' -F 'mode=todownload' http://erecord.toulouse.inra.fr:8000/vpz/experiment/
* Comments :
The modified input datas folder : data/31035002_bis.csv
/31035002_ter.csv
-------------------------------------------------------------------------------
The returned file : experiment.xls
.