Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

GET taskrunstatus

Track the status of a workflow using the taskRunId.

Request parameters

  • taskId (string, required): task Id of a workflow.
  • maxWaitMillis (integer) time in milliseconds to wait for response

Response

Status of the workflow task. Possible response codes are:

  • I = Invalid,
  • P = Pending,
  • T = Terminated,
  • R = running,
  • F = Failed,
  • C = Completed fully successful,
  • D = Completed partly successful,
  • A = Approved,
  • B = Approved partly successful
  • null= No status available (produces when method call times-out)

Example request

Code Block
curl localhost:8080/FewsWebServices/rest/fewspiservice/v1/taskrunstatus?documentVersion=1.23&taskId=1_0

Example response

Code Block
C

 

POST runtask

Request parameters

  • workflowId (string, required): Identifier of the task to run
  • startTime (dateTime): Start of run period. Used for state selection period.
  • timeZero (dateTime): Forecast time zero. If missing System time is used (optional)
  • endTime (dateTime): End of run period. Used to define forecast length.
  • coldStateId (string): Id of a coldstate. Can be used to force state selection (optional).
  • scenarioId (string): Id of a predefined WhatIf scenario. Can be used to alter run parameters (optional).
  • userId (string) User id of the user that runs the task.
  • description (string): Descriptive text to identify run.

Body parameters

  • piParametersXml (pi XML url encoded): Contents of a Pi ModelParameters XML file. PI ModelParameters can be exported by the General Adapter to provide information to external models being run by FEWS. The xml file content has to be encoded in the 'application/x-www-form-urlencoded Content-Type.

Response

  • String with the taskId of the task that is run.

Example request

Code Block
curl http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/runtask/?workflowId=ImportObserved&startTime=2014-01-01T00:00:0000Z+0000&timeZero=2014-01-01T00:00:0000Z+0000&endTime=2014-01-01T00:30:00+0000Z0000 -i -X POST -H 'Content-Type: application/x-www-form-urlencoded'  -d ''

Example response

Code Block
10

 

GET timeseriesmodifiers

Request parameters

  • locationIds (string)

  • moduleInstanceIds (string)

  • startTime (dateTime)

  • endTime (dateTime)

  • userId (string)

  • modifierTypeId (string)

  • active (boolean, default true)

  • userDefinedModifierDescriptionKeyValuePair (string)

  • documentFormat (string)

Response

Example request

Code Block
curl http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/timeseriesmodifiers?onlyActiveModifiers=true

Example response

Code Block
TODO

 

...

GET samples

Request parameters

  • not applicable

Response

  • TODO

Example request

Code Block
TODO

Example response

  • endCreationTime (dateTime): End time of search period that looks for creation time of samples. Note: creation time of samples is actually the creation time of the task that produced/imported these samples.
  • endTime (dateTime): End time of search period that looks for sample values that lie within this period.
  • filterId (string): Filter id.
  • locationIds (string): Subset of locations for which to retrieve samples. Repeat parameter for multiple location ids.
  • omitMissing (boolean): Toggle omitting or returning of missing values in response
  • onlyHeaders (boolean): Toggle to return only header information or also data
  • parameterIds (string): Subset of parameters for which to retrieve samples.
  • sampleIds Subset of sample id's for which to retrieve samples. Repeat parameter for multiple location ids.
  • startCreationTime (dateTime): Start time of search period that looks for creation time of samples. Note: creation time of samples is actually the creation time of the task that produced/imported these samples.
  • startTime (dateTime): Start time of search period that looks for sample values that lie within this period.

Since all parameters are optional, some defaults are chosen for the search period in case no search period or creation period was specified. The following rules apply:

  • If no startCreationTime and endCreationTime have been set, the startTime and endTime are used to determine the search period.
  • If no startTime and endTime have been specified, the search period will be set to the current system time minus one day and one hour until the current system time plus one day and one hour.

Response

  • Pi Samples xml file content

Example request

Code Block
curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/samples?sampleIds=713&locationIds=MBP012&startTime=1970-01-01T00%3A00%3A00Z%2B0000&endTime=2017-01-01T00%3A00%3A00Z%2B0000"

Example response

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<Samples xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_samples.xsd" version="1.23" xmlns:fs="http://www.wldelft.nl/fews/fs" xmlns:qualifierId="http://www.wldelft.nl/fews/qualifierId">
    <timeZone>0.0</timeZone>
    <sample id="713">
        <header>
            <locationId>MBP012</locationId>
            <sampleDate date="1980-12-31" time="23:00:00"/>
            <lat>52.18084820135932</lat>
            <lon>5.083729510982581</lon>
            <x>134244.0</x>
            <y>465900.0</y>
        </header>
        <properties>
            <string key="externereferentie" value="PUT-01\SYS\0000000713"/>
            <string key="xcoormonster" value="134240"/>
            <string key="ycoormonster" value="465900"/>
            <string key="monsternemer" value="IMP"/>
            <string key="analist" value="IMP"/>
            <string key="bron" value="TABHIST"/>
        </properties>
        <table>
            <row parameterId="PTB_Tans" qualifierId:q1="AC_6" qualifierId:q2="AP_22" qualifierId:q3="TWN_3623" qualifierId:q4="CO6" qualifierId:q5="EE_22" qualifierId:q6="GH_3" qualifierId:q7="WM_1" flag="0" value="8.0" unit="-"/>
            <row parameterId="PTB_Tans" qualifierId:q1="AC_6" qualifierId:q2="AP_22" qualifierId:q3="TWN_2319" qualifierId:q4="CO6" qualifierId:q5="EE_22" qualifierId:q6="GH_3" qualifierId:q7="WM_1" flag="0" value="1.0" unit="-"/>
        </table>
    </sample>
</Samples>
Code Block
TODO


Configuration

The FewsPiService.properties file can be used to make service specific configurations available. This is a property file that is located in the FEWS configuration in the directory:

...