SydroCmd Befehle: Unterschied zwischen den Versionen

Aus TALSIM Docs
Keine Bearbeitungszusammenfassung
(clarify parameters)
 
(9 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
<languages/>
<translate>


==Extract==
<!--T:1-->
{{Navigation|vorher=SydroCmd-Verzeichnisstruktur und Dateien|hoch=Arbeiten mit dem SydroCmd tool|nachher=Operationeller Einsatz von Talsim-NG}}
 
 
 
==Extract== <!--T:2-->
 
<!--T:3-->
Extracts strings from each line within an ASCII file.
Extracts strings from each line within an ASCII file.


{| class="wikitable" style="width: 50%;"
<!--T:4-->
!style="width: 10%"|Argument
{| class=wikitable
!style="width: 90%"|Description
!Argument !! Description
|-
|-
|1
|Key || <code>-extract</code>
|<code>-extract</code>
|-
|-
|2
|1 || sourcefile
|sourcefile
|-
|-
|3
|2 || <code>-string</code>: search for a string
|<code>-string</code> or <code>-pos</code> or <code>-split</code> <br />(<code>-string</code>=search for a string, <code>-pos</code>=select a position, <code>-split</code>=delimits the string)
<code>-pos</code>: select a position<br/>
<code>-split</code>: split a string
|-
|3 || either string or position as a  number
|-
|4 || <code>-endstring</code>, <code>–endlen</code> or <code>-array</code>
|-
|5 || either a string or the word <code>blank</code> or a position as an integer, depending on the previous argument. With <code>-split</code> a comma-separated list of indices is required indicating which items should be saved.
|-
|6 || targetfile
|}
 
<!--T:5-->
'''Example 1''': extracts a string from each line within d:\temp\abc.txt which follows directly after "val=" and ends at the next blank.
 
<!--T:6-->
<pre>
SydroCmd -extract d:\temp\abc.txt -string val= -endstring blank d:\temp\extract.txt
</pre>
 
<!--T:7-->
'''Example 2''': extracts a string  from each line within d:\temp\abc.txt starting from position 15 with a length  of 25 characters.
 
<!--T:8-->
<pre>
SydroCmd -extract d:\temp\abc.txt -pos 15 -endlen 25 d:\temp\extract.txt
</pre>
 
 
==Download== <!--T:9-->
 
<!--T:10-->
Downloads a file with a valid URL to the local machine.
 
<!--T:11-->
{| class=wikitable
! Argument !! Description
|-
|-
|4
|Key || <code>-download</code> or <code>-downloadwget</code> (the latter causes [https://www.gnu.org/software/wget/ wget] to be used for downloading)
|either string or position as a number
|-
|-
|5
|1||URL (possibly with placeholders like <code>{0}</code>)
|<code>-endstring</code> or <code>-endlen</code> or <code>-array</code>
|-
|-
|6
|2||Arguments separated by a comma filling the placeholders in the URL
|either a string or the work blank or a position as integer, depending on the previous argument. With <code>-split</code> a comma-separated list of indices is required indicating which items should be saved
|-
|-
|7
|3 || targetfile
|targetfile
|}
|}


<!--T:12-->
'''Example:''' Downloads a  file from the NOAA data archive. Variables are the year, month, day.


;Example1
<!--T:13-->
:extracts a string from each line within <code>d:\temp\abc.txt</code> which follows directly after <code>val=</code> and ends at the next blank.
<pre>
:<code>SydroCmd -extract d:\temp\abc.txt -string :val= -endstring blank d:\temp\extract.txt</code>
SydroCmd -download http://nomads.ncdc.noaa.gov/modeldata/cfsv2_forecast_mm_9mon/{0}/{0}{1}/{0}{1}{2}/{0}{1}{2}00/flxf.01.{0}{1}{2}00.{3}{4}.avrg.grib.grb2  2016,12,02,2016,12 D:\temp\tmp.grb2
</pre>


;Example 2
: extracts a string from each line within d:\temp\abc.txt starting from position 15 with a length of 25 characters.
:<code>SydroCmd -extract d:\temp\abc.txt -pos 15 -endlen 25 d:\temp\extract.txt</code>


==Replace== <!--T:14-->


==Download==
<!--T:15-->
Downloads a file with a valid URL to the local memory.
Replaces  all strings with a new string within a file. Is able to handle current date information.


{| class="wikitable" style="width: 50%;"
<!--T:16-->
!style="width: 10%"|Argument
{| class=wikitable
!style="width: 90%"|Description
! Argument !! Description
|-
|Key || <code>-replace</code>
|-
|1||sourcefile
|-
|2||search string or <code>DATE</code>
|-
|-
|1
|3||replace string or a date in the format <code>yyyyMMddHHmm</code> or <code>Now</code>
|<code>-download</code>
|-
|4||targetfile (if not given, then sourcefile will be overwritten)
|}
 
 
===Date replacement=== <!--T:17-->
 
<!--T:18-->
If the search string is the keyword <code>DATE</code>, dynamic date replacement takes place:
* The replace string must then be a date in the format <code>yyyyMMddHHmm</code> or <code>Now</code>.
* In the sourcefile, the placeholder to be replaced must be given as follows: <code>{DATE|ValidFormatstring|ValidNumber,DateInterval}</code>, where
** ValidFormatstring: a date format string consisting of e.g. yyyy, MM, dd, HH, mm (see [https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings here] for more options)
** ValidNumber: 0, +2, -5 or any other integer (adds/subtracts the number of years,  months, days, hours, minutes as given with the number)
** DateIntervall= y, M, d, h, m (is used to add the ValidNumber to the date)
:Example: <code>{DATE|dd|+1,d}</code> with a replace date of 30/12/2017 results in <code>31</code> (given date + 1 day, expressed as date (<code>dd</code>)).
 
 
===Examples=== <!--T:19-->
 
<!--T:20-->
'''Example 1''': simple replacement of "hello" with "goodbye". The sourcefile will be overwritten.
<pre>
SydroCmd –replace d:\temp\abc.txt hello goodbye
</pre>
 
<!--T:21-->
'''Example 2''': with date information
 
<!--T:22-->
In this  example the first argument is the keyword <code>DATE</code> indicating that date information is used. If this string is found it will be replaced by the date given in the next argument (here 5/12/2016 00:00). In the file abc.txt the variable to be replaced  must be given as follows: <code>{DATE|yyyy|+1,y}</code>. This means the result will be <code>2017</code>, one year added to 2016.
 
<!--T:23-->
<pre>
SydroCmd –replace d:\temp\abc.txt DATE 201612050000 d:\temp\abcnew.txt
</pre>
 
<!--T:24-->
'''Example 2''': with date information using <code>Now</code>
 
<!--T:25-->
In this example the first argument is the keyword <code>DATE</code> indicating that date information is used. If this string is found it will be replaced by the date given in the next argument (here the keyword <code>Now</code>). In the file abc.txt the variable to be replaced must be given  as follows: <code>{DATE|yyyyMMdd|+1,M}</code>. This means the result will be the current date plus one month.
 
<!--T:26-->
<pre>
SydroCmd –replace d:\temp\abc.txt DATE Now d:\temp\abcnew.txt
</pre>
 
 
==Zip== <!--T:27-->
 
<!--T:28-->
Compress files to a zip file.
 
<!--T:29-->
{| class=wikitable
! Argument !! Description
|-
|-
|2
|Key || <code>-zip</code>
|URL (possibly with spaceholders like <code>{0}</code>
|-
|-
|3
|1||source directory
|Arguments separated by a comma filling the spaceholders in the URL
|-
|-
|4
|2||zip filename
|targetfile
|-
|3 || <code>-pattern</code> or <code>–list</code>
|-
|4||the pattern or a comma-separated  list
|}
|}


;Example
<!--T:30-->
:Downloads a file from the NOAA data archive. Variables are the year, month, day.
'''Example 1''': Compresses all files in directory d:\temp\ with the extension *.txt to the file myfile.zip
:<code><nowiki>SydroCmd -download http://nomads.ncdc.noaa.gov/modeldata/cfsv2_forecast_mm_9mon/{0}/{0}{1}/{0}{1}{2}/{0}{1}{2}00/flxf.01.{0}{1}{2}00.{3}{4}.avrg.grib.grb2 2016,12,02,2016,12 D:\temp\tmp.grb2 </nowiki></code>
<pre>
SydroCmd –zip d:\temp\ myfile.zip –pattern *.txt
</pre>


==Replace==
<!--T:31-->
Replaces all strings with a new string within a file. Is able to handle current date information.
'''Example 2''': Compresses a list of files in directory d:\temp\ with the extension *.txt to the file myzipfile.zip


{| class="wikitable" style="width: 50%;"
<!--T:32-->
!style="width: 10%"|Argument
<pre>
!style="width: 90%"|Description
SydroCmd -zip  d:\temp\ myzipfile.zip -list d:\mylist\file1.txt "d:\many files\newfile.doc"
</pre>
 
 
==UnZip== <!--T:33-->
 
<!--T:34-->
Unzips files from a zip file.
{| class=wikitable
! Argument !! Description
|-
|-
|1
|Key || <code>-unzip</code>
|<code>-replace</code>
|-
|-
|2
|1||output directory
|sourcefile
|-
|-
|3
|2||source zip filename
|string to be searched for (see options)
|-
|-
|4
|3 || <code>-pattern</code> or <code>-list</code>
|Replacement string, string to be inserted (see options)
|-
|-
|5
|4||the pattern or a comma-separated  list
|targetfile (if not given, sourcefile will be overwritten)
|}  
|}
 
<!--T:35-->
'''Example 1''': Unzips all files in the zipfile d:\temp\myfile.zip with the pattern *.txt to d:\
 
<!--T:36-->
<pre>
SydroCmd -unzip d:\ d:\temp\myfile.zip -pattern *.txt
</pre>
 
<!--T:37-->
'''Example 2''': Unzips a selection of files in d:\temp\myzipfile.zip to d:\


===Options===
<!--T:38-->
;2. Argument
<pre>
: String to be searched for that will be replaced
SydroCmd -unzip d:\ d:\temp\myzipfile.zip -list d:\mylist\file1.txt "d:\any directory\newfile.doc"
: Format= <code>[KEYWORD|Valid Formatstring|Valid Number,DateInterval} </code>
</pre>
::<code>KEYWORD = CURRENTDATE</code>
::<code>Valid Formatstring</code> = possible is <code>yyy</code>, <code>MM</code>, <code>dd</code>, <code>mm</code>
::<code>Valid Number</code>= <code>0, +2, -5</code> or any other integer (adds/subtracts the number of years, months, days, hours, minutes as given with the number)
::<code>DateIntervall</code>= <code>y, M, d, h, m</code> (is used to add the <code>valid number</code> to the date)
:Example: <code>{CURRENTDATE|dd|+1,d}</code> with a date 30/12/2017 results in 31


;3. Argument
<!--T:39-->
: ordinary string or in combination with <code>CURRENTDATE</code> a date in the format <code>yyyyMMDDhhmm</code> or the keyword <code>Now</code>
'''Example 3''': Unzips all files in the zipfile d:\temp\myzipfile.zip to d:\


===Examples===
<!--T:40-->
;Example1
<pre>
:simple with “hallo” replaced by “goodbye”. The sourcefile will be overwritten.
SydroCmd -unzip d:\ d:\temp\myzipfile.zip –pattern *.*
:<code>SydroCmd -replace d:\temp\abc.txt hallo goodbye </code>
</pre>


;Example2
==TimeSeries - GET== <!--T:41-->
:with date information
:<code>SydroCmd -replace d:\temp\abc.txt CURRENTDATE 201612050000 d:\temp\abcnew.txt</code>
:In this example the first argument is <code>CURRENDATE</code> indicating that date information is used. If this string is found it will be replaced by the date given in the next argument (here <code>5/12/2016 00:00</code>). In the <code>abc.txt</code> the variable to be replaced must be given as follows: <code>{CURRENTDATE|yyyy|+1,y}</code>. This means the result will be ‘2017’, one year added to 2016.


==Zip==
<!--T:42-->
Zips files into a Zip File Format.
Retrieves a SydroTimeSeries object from the TalsimNGServer via REST interface.  


{| class="wikitable" style="width: 50%;"
<!--T:43-->
!style="width: 10%"|Argument
{| class=wikitable border=1 cellspacing=0 cellpadding=0
!style="width: 90%"|Description
!Argument!!Description
|-
|Key || timeseries
|-
|-
|1
|1 || <code>-get</code>
|<code>-zip</code>
|-
|-
|2
|2||Customer name, e.g. <code>Test</code> or <code>KS_Gerstungen</code>
|source directory
|-
|-
|3
|3||User, e.g. <code>Felix</code>
|zipfilename
|-
|-
|4
|4||Id of the time series, e.g. <code>406420</code>
|<code>-pattern</code> or <code>-list</code>
|-
|-
|5
|5||Startdate in <code>yyyy-MM-dd HH:mm</code> format or <code>0</code> for all entries from the beginning
|the pattern or a comma-separated list
|-
|6||Enddate in <code>yyyy-MM-dd HH:mm</code> format or <code>0</code> for all entries up to the end
|-
|7||Flag to specifiy which data are to  be retrieved, e.g. <code>0</code>, <code>1</code>, etc.
|-
|8||Protocol, usually <code>http</code>
|-
|9||IP address, e.g. <code>localhost</code> or <code>10.0.0.5</code>
|-
|10||Port. The default port is <code>8092</code>
|-
|11||Filename. The destination file of the time series, e.g. <code>d:\temp\timeseries.short.txt</code>. '''No blank (space) is allowed in the path and name.'''
|}
|}


;Example 1:
<!--T:44-->
:Compresses all files in directory <code>d:\temp\</code> with <code>*.txt</code>-extension to file <code>myfile.zip</code>
'''Example 1''': The file timeseries.short.txt should be fetched from customer KS_Gerstungen. The time series  has the Id 406420, the whole time series is desired. Only entries with the flag 0 are wanted. The server is located at 10.0.0.30. The result will be written to d:\temp\timeseries.long.txt.
:<code>SydroCmd -zip d:\temp\ myfile.zip -pattern *.txt</code>
 
<!--T:45-->
<pre>
SydroCmd.exe -timeseries -get KS_Gerstungen,hubert,406420,0,0,1,http,10.0.0.30,8092,d:\temp\timeseries.long.txt
</pre>


;Example 2:
<!--T:46-->
:Compresses a list of files in directory <code>d:\temp\</code> with <code>*.txt</code>-extension to file <code>myfile.zip</code>
'''Example  2''': The timeseries  with the Id 9998 is needed from customer TestApi.
:<code>SydroCmd -zip d:\temp\ myzipfile.zip -list d:\mylist\file1.txt "d:\many files\newfile.doc"</code>


<!--T:47-->
<pre>
SydroCmd -timeseries -get TestApi,hubert,9998,0,0,-1,http,localhost,8092,d:\temp\timeseries.short.txt
</pre>


==UnZip==
UnZips files from a Zip File.


{| class="wikitable" style="width: 50%;"
==TimeSeries - POST== <!--T:48-->
!style="width: 10%"|Argument
 
!style="width: 90%"|Description
<!--T:49-->
Uploads a SydroTimeSeries object to the TalsimNGServer via REST interface. All settings like Flag, SaveMetadata etc. are given in the SydroTimeSeries object itself.
 
<!--T:50-->
{| class=wikitable border=1 cellspacing=0 cellpadding=0
!Argument!!Description
|-
|-
|1
|Key || timeseries
|<code>-unzip</code>
|-
|-
|2
|1 || <code>-post</code>
|source directory
|-
|-
|3
|2||Customer, e.g. <code>Test</code> or <code>KS_Gerstungen</code>
|source zipfilename
|-
|-
|4
|3||User, e.g. <code>Felix</code>
|<code>-pattern</code> or <code>-list</code>
|-
|-
|5
|4||Id of the time series, e.g. <code>406420</code>
|the pattern or a comma-separated list
|-
|}
|8||Protocol, usually <code>http</code>
|-
|9||IP address, e.g. <code>localhost</code> or  <code>10.0.0.5</code>
|-
|10||Port. The default port is <code>8092</code>
|-
|11||Source filename. The path to the time series file, e.g. <code>d:\temp\timeseries.short.txt</code>. '''No blank (space) is  allowed in the path and name.'''
|}  
 
<!--T:51-->
'''Example 1''': The file timeseries.short.txt should be uploaded to customer TestAPI. The time series has the  Id 9999 and the file is located at d:\temp\timeseries.short.txt.
 
<!--T:52-->
<pre>
SydroCmd.exe -timeseries -post TestApi,hubert,9999,http,localhost,8092,d:\temp\timeseries.short.txt
</pre>
 
==REST Service== <!--T:53-->
 
<!--T:54-->
Calls a REST Service URL to obtain its response.


;Example 1:
<!--T:55-->
: Unzips all files in directory <code>d:\temp\</code> and zipfile <code>myfile.zip</code> with the pattern <code>*.txt</code> to <code>d:\</code>
{| class=wikitable border=1 cellspacing=0 cellpadding=0
:<code>SydroCmd -unzip d:\ d:\temp\myfile.zip -pattern *.txt</code>
!Argument!!Description
|-
|Key || REST
|-
|1 || <code>-rest</code>
|-
|2||Timeout in milliseconds, e.g. <code>10000</code>
|-
|3||Number of requests if a timed out occurs, e.g. <code>2</code>
|-
|4||SaveTo, file where the response will be saved to, e.g. <code>d:\temp\response.txt</code>
|-
|8||Rest URL <code>http://geoglows.ecmwf.int/api/HistoricSimulation/?reach_id=7042350&return_format=csv</code>
|-
|}


;Example 2:
<!--T:56-->
:Unzips a selection of files from <code>d:\temp\</code> and <code>myzipfile</code> to <code>d:\</code>
'''Example 1''': The GeoGLOWS REST Service is called to retrieve the historic simulation time series for reach_id = 7042350.
:<code>SydroCmd -unzip d:\ d:\temp\myzipfile.zip -list d:\mylist\file1.txt "d:\any directory\newfile.doc"</code>


;Expamle 3:
<!--T:57-->
:Unzips all files in the zipfile from <code>d:\temp\</code> and <code>myzipfile</code> to <code>d:\</code>
<pre>
:<code>SydroCmd -unzip d:\ d:\temp\myzipfile.zip -pattern *.*</code>
SydroCmd.exe -rest 10000 2 d:\temp\geoglows.csv "http://geoglows.ecmwf.int/api/HistoricSimulation/?reach_id=7042350&return_format=csv"
</pre>
</translate>

Aktuelle Version vom 3. Mai 2021, 17:21 Uhr

Sprachen:


Extract

Extracts strings from each line within an ASCII file.

Argument Description
Key -extract
1 sourcefile
2 -string: search for a string

-pos: select a position
-split: split a string

3 either string or position as a number
4 -endstring, –endlen or -array
5 either a string or the word blank or a position as an integer, depending on the previous argument. With -split a comma-separated list of indices is required indicating which items should be saved.
6 targetfile

Example 1: extracts a string from each line within d:\temp\abc.txt which follows directly after "val=" and ends at the next blank.

SydroCmd -extract d:\temp\abc.txt -string val= -endstring blank d:\temp\extract.txt

Example 2: extracts a string from each line within d:\temp\abc.txt starting from position 15 with a length of 25 characters.

SydroCmd -extract d:\temp\abc.txt -pos 15 -endlen 25 d:\temp\extract.txt


Download

Downloads a file with a valid URL to the local machine.

Argument Description
Key -download or -downloadwget (the latter causes wget to be used for downloading)
1 URL (possibly with placeholders like {0})
2 Arguments separated by a comma filling the placeholders in the URL
3 targetfile

Example: Downloads a file from the NOAA data archive. Variables are the year, month, day.

SydroCmd -download http://nomads.ncdc.noaa.gov/modeldata/cfsv2_forecast_mm_9mon/{0}/{0}{1}/{0}{1}{2}/{0}{1}{2}00/flxf.01.{0}{1}{2}00.{3}{4}.avrg.grib.grb2  2016,12,02,2016,12 D:\temp\tmp.grb2


Replace

Replaces all strings with a new string within a file. Is able to handle current date information.

Argument Description
Key -replace
1 sourcefile
2 search string or DATE
3 replace string or a date in the format yyyyMMddHHmm or Now
4 targetfile (if not given, then sourcefile will be overwritten)


Date replacement

If the search string is the keyword DATE, dynamic date replacement takes place:

  • The replace string must then be a date in the format yyyyMMddHHmm or Now.
  • In the sourcefile, the placeholder to be replaced must be given as follows: {DATE|ValidFormatstring|ValidNumber,DateInterval}, where
    • ValidFormatstring: a date format string consisting of e.g. yyyy, MM, dd, HH, mm (see here for more options)
    • ValidNumber: 0, +2, -5 or any other integer (adds/subtracts the number of years, months, days, hours, minutes as given with the number)
    • DateIntervall= y, M, d, h, m (is used to add the ValidNumber to the date)
Example: {DATE|dd|+1,d} with a replace date of 30/12/2017 results in 31 (given date + 1 day, expressed as date (dd)).


Examples

Example 1: simple replacement of "hello" with "goodbye". The sourcefile will be overwritten.

SydroCmd –replace d:\temp\abc.txt hello goodbye

Example 2: with date information

In this example the first argument is the keyword DATE indicating that date information is used. If this string is found it will be replaced by the date given in the next argument (here 5/12/2016 00:00). In the file abc.txt the variable to be replaced must be given as follows: {DATE|yyyy|+1,y}. This means the result will be 2017, one year added to 2016.

SydroCmd –replace d:\temp\abc.txt DATE 201612050000 d:\temp\abcnew.txt

Example 2: with date information using Now

In this example the first argument is the keyword DATE indicating that date information is used. If this string is found it will be replaced by the date given in the next argument (here the keyword Now). In the file abc.txt the variable to be replaced must be given as follows: {DATE|yyyyMMdd|+1,M}. This means the result will be the current date plus one month.

SydroCmd –replace d:\temp\abc.txt DATE Now d:\temp\abcnew.txt


Zip

Compress files to a zip file.

Argument Description
Key -zip
1 source directory
2 zip filename
3 -pattern or –list
4 the pattern or a comma-separated list

Example 1: Compresses all files in directory d:\temp\ with the extension *.txt to the file myfile.zip

SydroCmd  –zip d:\temp\ myfile.zip –pattern *.txt

Example 2: Compresses a list of files in directory d:\temp\ with the extension *.txt to the file myzipfile.zip

SydroCmd -zip  d:\temp\ myzipfile.zip -list d:\mylist\file1.txt "d:\many files\newfile.doc"


UnZip

Unzips files from a zip file.

Argument Description
Key -unzip
1 output directory
2 source zip filename
3 -pattern or -list
4 the pattern or a comma-separated list

Example 1: Unzips all files in the zipfile d:\temp\myfile.zip with the pattern *.txt to d:\

SydroCmd -unzip d:\ d:\temp\myfile.zip -pattern *.txt

Example 2: Unzips a selection of files in d:\temp\myzipfile.zip to d:\

SydroCmd -unzip d:\ d:\temp\myzipfile.zip -list d:\mylist\file1.txt "d:\any directory\newfile.doc"

Example 3: Unzips all files in the zipfile d:\temp\myzipfile.zip to d:\

SydroCmd -unzip d:\ d:\temp\myzipfile.zip –pattern *.*

TimeSeries - GET

Retrieves a SydroTimeSeries object from the TalsimNGServer via REST interface.

Argument Description
Key timeseries
1 -get
2 Customer name, e.g. Test or KS_Gerstungen
3 User, e.g. Felix
4 Id of the time series, e.g. 406420
5 Startdate in yyyy-MM-dd HH:mm format or 0 for all entries from the beginning
6 Enddate in yyyy-MM-dd HH:mm format or 0 for all entries up to the end
7 Flag to specifiy which data are to be retrieved, e.g. 0, 1, etc.
8 Protocol, usually http
9 IP address, e.g. localhost or 10.0.0.5
10 Port. The default port is 8092
11 Filename. The destination file of the time series, e.g. d:\temp\timeseries.short.txt. No blank (space) is allowed in the path and name.

Example 1: The file timeseries.short.txt should be fetched from customer KS_Gerstungen. The time series has the Id 406420, the whole time series is desired. Only entries with the flag 0 are wanted. The server is located at 10.0.0.30. The result will be written to d:\temp\timeseries.long.txt.

SydroCmd.exe -timeseries -get KS_Gerstungen,hubert,406420,0,0,1,http,10.0.0.30,8092,d:\temp\timeseries.long.txt

Example 2: The timeseries with the Id 9998 is needed from customer TestApi.

SydroCmd -timeseries -get TestApi,hubert,9998,0,0,-1,http,localhost,8092,d:\temp\timeseries.short.txt


TimeSeries - POST

Uploads a SydroTimeSeries object to the TalsimNGServer via REST interface. All settings like Flag, SaveMetadata etc. are given in the SydroTimeSeries object itself.

Argument Description
Key timeseries
1 -post
2 Customer, e.g. Test or KS_Gerstungen
3 User, e.g. Felix
4 Id of the time series, e.g. 406420
8 Protocol, usually http
9 IP address, e.g. localhost or 10.0.0.5
10 Port. The default port is 8092
11 Source filename. The path to the time series file, e.g. d:\temp\timeseries.short.txt. No blank (space) is allowed in the path and name.

Example 1: The file timeseries.short.txt should be uploaded to customer TestAPI. The time series has the Id 9999 and the file is located at d:\temp\timeseries.short.txt.

SydroCmd.exe -timeseries -post TestApi,hubert,9999,http,localhost,8092,d:\temp\timeseries.short.txt

REST Service

Calls a REST Service URL to obtain its response.

Argument Description
Key REST
1 -rest
2 Timeout in milliseconds, e.g. 10000
3 Number of requests if a timed out occurs, e.g. 2
4 SaveTo, file where the response will be saved to, e.g. d:\temp\response.txt
8 Rest URL http://geoglows.ecmwf.int/api/HistoricSimulation/?reach_id=7042350&return_format=csv

Example 1: The GeoGLOWS REST Service is called to retrieve the historic simulation time series for reach_id = 7042350.

SydroCmd.exe -rest 10000 2 d:\temp\geoglows.csv "http://geoglows.ecmwf.int/api/HistoricSimulation/?reach_id=7042350&return_format=csv"