Example of POST vpz/inout 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 :

  • modifying begin,

  • modifying duration,

  • modifying some parameters by ‘cname.pname’,

  • tree’ as style of presentation,

  • json’ as format,

  • values of type cname.pname as ‘parselect’ :

    value ‘cond_wwdm.A’ to select the parameter named ‘A’ of the condition named ‘cond_wwdm’.

    value ‘cond_wwdm.B’ to select the parameter named ‘B’ of the condition named ‘cond_wwdm’.

    value ‘cond_wwdm.Eb’ to select the parameter named ‘Eb’ of the condition named ‘cond_wwdm’.

    value ‘cond_wwdm.TI’ to select the parameter named ‘TI’ of the condition named ‘cond_wwdm’.

  • value ‘single’ as plan

  • value ‘dataframe’ as restype

  • value of type vname.oname as ‘outselect’ :

    value ‘view.top:wwdm.LAI’ to select the ‘LAI’ output data of the view named ‘view’.

    value ‘view.top:wwdm.ST’ to select the ‘ST’ output data of the view named ‘view’.

  • with ‘application/json’ as ‘Content-Type’

REQUEST and RESPONSE

Memo


cURL command line :

curl -L -H "Content-Type: application/json" -d '{"vpz":266, "duration":6, "begin":2453982.0, "cond_wwdm.A":0.0064, "cond_wwdm.Eb":1.86, "parselect":["cond_wwdm.A","cond_wwdm.B","cond_wwdm.Eb","cond_wwdm.TI"], "mode":["tree","single","dataframe"], "outselect":["view.top:wwdm.LAI","view.top:wwdm.ST"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/inout/

A variant modifying the input datas folder (using datafolder, datafoldercopy) :


          ____________________________________________________________________
         | 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"
- format yaml

* cURL command line :
curl -F 'vpz=266' -F 'datafolder=@wwdm_data.zip' -F 'datafoldercopy=replace' -F 'cond_meteo.meteo_file="31035002_ter.csv"' -F 'duration=6' -F 'begin=2453982.0' -F 'cond_wwdm.A=0.0064' -F 'cond_wwdm.Eb=1.86' -F 'parselect=cond_meteo.meteo_file' -F 'parselect=cond_wwdm.A' -F 'parselect=cond_wwdm.B' -F 'parselect=cond_wwdm.Eb' -F 'parselect=cond_wwdm.TI' -F 'mode=tree' -F 'mode=single' -F 'mode=dataframe' -F 'outselect=view.top:wwdm.LAI' -F 'outselect=view.top:wwdm.ST' -F 'format=yaml' http://erecord.toulouse.inra.fr:8000/vpz/inout/

* Comments :

The modified input datas folder : data/31035002_bis.csv
                                      /31035002_ter.csv

-------------------------------------------------------------------------------