Page tree
Skip to end of metadata
Go to start of metadata


Introduction

The FEWS PI REST Web Service is hosted in a Tomcat application server. This service allows clients to interact with FEWS using a REST API. The REST Service will return PI-XML by default.

Since FEWS 2017.02 the PI-JSON format is supported as well for the following GET methods: filters, parameters, locations and parameters. For more information on the PI-JSON format, see: FEWS PI-JSON format. For some examples on how to use the the FEWS PI-JSON REST Web service see FEWS PI-JSON REST Examples

Request parameters are marked in italics and the parameter types are given between parentheses. If not specified differently, a parameter is optional.

In case a REST resource is accessed with unknown query parameters an HTTP 400 response will be given informing the user a bad request was sent.


FEWS PI REST Web Service API

GET timezoneid

Get ID of Configured timezone for the webservice.

Request parameters

  • not applicable

Response

  • String representation of time zone.

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/timezoneid"

Example response

GMT

GET filters

Retrieve Pi Filters configuration.

Request parameters

    • filterId (string): Subset filter id.
    • documentVersion (string): File format version.
    • documentFormat (string): PI_XML (default) or PI_JSON

Response

    • Filters PI-XML or PI-JSON file content.

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/filters"

Example PI-XML response

<?xml version="1.0" encoding="UTF-8"?>
<filters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_filter.xsd" version="1.23">
    <filter id="Countries">
        <name>Countries</name>
        <description></description>
        <child id="All">
            <name>All</name>
            <description></description>
        </child>
        <child id="Netherlands">
            <name>Netherlands</name>
            <description></description>
        </child>
    </filter>
</filters>

GET locations

Retrieve Pi Locations file containing all locations that are available for the passed 'filterId' argument. If not filterId is passed then all locations configured in the pre-defined filter will be returned.

 

Request parameters

  • filterId (string): Filter id.
  • documentVersion (string): File format version.
  • documentFormat (string): PI_XML (default) or PI_JSON
  • showAttributes (boolean) Since 2017.02: toggle to show location attributes.

Response

  • Locations PI-XML or PI-JSON file content.

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/locations?showAttributes=true&documentVersion=1.24"

Example PI-XML response

<?xml version="1.0" encoding="UTF-8"?>
<Locations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_locations.xsd" version="1.24">
    <geoDatum>WGS 1984</geoDatum>
    <location locationId="10160355000">
        <description>SKIKDA</description>
        <shortName>SKIKDA</shortName>
        <lat>36.93</lat>
        <lon>6.95</lon>
        <x>6.95</x>
        <y>36.93</y>
        <z>7.0</z>
        <attribute id="country" name="country">
            <text>101</text>
        </attribute>
        <attribute id="popSize" name="popSize">
            <text>107</text>
        </attribute>
        <attribute id="oceanDistance" name="oceanDistance">
            <text>1</text>
        </attribute>
    </location>
    <location locationId="10160360000">
        <description>ANNABA</description>
        <shortName>ANNABA</shortName>
        <lat>36.83</lat>
        <lon>7.82</lon>
        <x>7.82</x>
        <y>36.83</y>
        <z>4.0</z>
        <attribute id="country" name="country">
            <text>101</text>
        </attribute>
        <attribute id="popSize" name="popSize">
            <text>256</text>
        </attribute>
        <attribute id="oceanDistance" name="oceanDistance">
            <text>1</text>
        </attribute>
    </location>
</Locations>        

Example PI-JSON response

 {
  "version" : "1.23",
  "geoDatum" : "WGS 1984",
  "locations" : [ {
    "locationId" : "10160355000",
    "description" : "SKIKDA",
    "shortName" : "SKIKDA",
    "lat" : "36.93",
    "lon" : "6.95",
    "x" : "6.95",
    "y" : "36.93",
    "z" : "7.0",
    "attributes" : [ {
      "name" : "country",
      "type" : "text",
      "id" : "country",
      "value" : "101"
    }, {
      "name" : "popSize",
      "type" : "text",
      "id" : "popSize",
      "value" : "107"
    }, {
      "name" : "oceanDistance",
      "type" : "text",
      "id" : "oceanDistance",
      "value" : "1"
    }]
  }, {
    "locationId" : "10160360000",
    "description" : "ANNABA",
    "shortName" : "ANNABA",
    "lat" : "36.83",
    "lon" : "7.82",
    "x" : "7.82",
    "y" : "36.83",
    "z" : "4.0",
    "attributes" : [ {
      "name" : "country",
      "type" : "text",
      "id" : "country",
      "value" : "101"
    }, {
      "name" : "popSize",
      "type" : "text",
      "id" : "popSize",
      "value" : "256"
    }, {
      "name" : "oceanDistance",
      "type" : "text",
      "id" : "oceanDistance",
      "value" : "1"
    } ]
  }]
}


GET parameters

Retrieve Pi Parameters file containing all parameters that are available for the passed 'filterId' argument. If no filterId is passed then all parameters configured in the pre-defined filter will be returned.

 

Request parameters

  • documentVersion (string): File format version.
  • documentFormat (string): PI_XML (default) or PI_JSON

Response

  • Parameters PI-XML or PI-JSON file content.

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/parameters"

Example PI-XML response

<?xml version="1.0" encoding="UTF-8"?>
<timeseriesparameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseriesparameters.xsd" version="1.25">
    <parameter id="T.obs.mean" parameterGroup="Temperature">
        <name>Observed Monthly Average Temperature</name>
        <parameterType>instantaneous</parameterType>
        <unit>oC</unit>
        <displayUnit>oC</displayUnit>
        <usesDatum>false</usesDatum>
    </parameter>
</timeseriesparameters>

Example PI-JSON response

{
  "version" : "1.25",
  "timeSeriesParameters" : [ {
    "id" : "T.obs.mean",
    "name" : "Observed Monthly Average Temperature",
    "parameterType" : "instantaneous",
    "unit" : "oC",
    "displayUnit" : "oC",
    "usesDatum" : "false",
    "parameterGroup" : "Temperature"
  } ]
}

GET timeseries

Returns a pi timeseries xml file containing the timeseries data filtered by the query parameters.

 

Request parameters

  • convertDatum (boolean): Convert values from relative location height to absolute height values. 
  • documentVersion (string, 1.9 or up): File format version (optional). For example: 1.23
  • documentFormat (string): PI_XML (default) or PI_JSON
  • endCreationTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): End time of search period that looks for creation time of timeseries. Note: creation time of timeseries is actually the creation time of the task that produced/imported these timeseries.
  • endForecastTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): End time of search period that looks for timeseries produced by forecasts that have their forecast time within this period.
  • endTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): End time of search period that looks for timeseries values that lie within this period.
  • ensembleId (string): Ensemble identifier of for timeseries
  • externalForecastTimes (dateTime format: yyyy-MM-ddTHH:mm:ssZ): Time value of external forecast time. This parameter has to be duplicated to specify multiple multiple externalForecastTimes.
  • filterId (string): An existing subfilter of the default filter id.
  • forecastCount (integer): Number of forecast runs to return when using start- and end- forecast time. Default is 1.
  • locationIds (string): Subset of locations for which to retrieve timeseries. This parameter can be duplicated to use multiple locationIds.
  • moduleInstanceIds (string): Subset of moduleInstances for which to retrieve timeseries. This parameter can be duplicated to specify multiple moduleInstanceIds.
  • omitMissing (boolean): Toggle omitting or returning of missing values in response
  • onlyHeaders (boolean): Toggle to return only header information or also data
  • onlyForecasts (boolean): Toggle to return only forecast timeSeries (Since 2017.02)
  • onlyManualEdits (boolean): Toggle to return only manual edits.
  • parameterIds (boolean): Subset of parameters for which to retrieve timeseries. This parameter has to be duplicated to specify multiple parameters.
  • qualifierIds (boolean): Subset of qualifiers for which to retrieve timesieres. This parameter has to be duplicated to specify multiple qualifierIds.
  • showStatistics (boolean): Toggle to return statistics information about timeseries. Typically used in combination with onlyHeaders. Returns additional information about data availability of timeseries (Since 2015.01). 
    • firstValueTime: First time with a value in the timeSeries
    • lastValueTime: Last time with a value in the timeSeries
    • maxValue: Maximum value in the timeSeries
    • minValue: Minimum value in the timeSeries
    • valueCount: Number of values in the timeSeries
  • showThresholds (boolean): Option to toggle the returning of threshold information in the headers
  • showEnsembleMemberIds (boolean): Show ensemble member ids.
  • useMilliseconds (boolean) Optional argument. Default is false. If it is set to true, the response will contain milliseconds. See example bellow. Available in 2017.02 and from 2019.02
  • startCreationTime (dateTime format: yyyy-MM-ddTHH:mm:ssZ): Start time of search period that looks for creation time of timeseries. Note: creation time of timeseries is actually the creation time of the task that produced/imported these timeseries.
  • startForecastTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): Start time of search period that looks for timeseries produced by forecasts that have their forecast time within this period.
  • startTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): Start time of search period that looks for timeseries values that lie within this period.
  • taskRunIds (string): Subset of task run ids for which to retrieve timeseries.  This parameter has to be duplicated to specify multiple taskRuns.
  • useDisplayUnits (boolean): Export values using display units.
  • importFromExternalDataSource (boolean, default true): import data from external data source (Archive). (since 2017.02)
  • timeStepId (string): filter timeseries by the timestep that has been configured in the TimeSteps.xml. (since 2018.01) 

Response

  • Timeseries PI-XML or PI-JSON file content..

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/timeseries?filterId=Netherlands&moduleInstanceIds=ImportObserved&startTime=2013-01-01T00:00:00Z&endTime=2014-01-01T00:00:00Z&convertDatum=false&useDisplayUnits=false&showThresholds=true&omitMissing=true&onlyHeaders=false&showEnsembleMemberIds=false&documentVersion=1.23&forecastCount=1"

Example PI-XML response

<?xml version="1.0" encoding="UTF-8"?>
<TimeSeries 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_timeseries.xsd" version="1.23" xmlns:fs="http://www.wldelft.nl/fews/fs">
    <timeZone>0.0</timeZone>
    <series>
        <header>
            <type>instantaneous</type>
            <moduleInstanceId>ImportObserved</moduleInstanceId>
            <locationId>63306260000</locationId>
            <parameterId>T.obs.mean</parameterId>
            <timeStep unit="nonequidistant"/>
            <startDate date="2013-01-01" time="00:00:00"/>
            <endDate date="2014-01-01" time="00:00:00"/>
            <missVal>-999.0</missVal>
            <stationName>DE BILT</stationName>
            <lat>52.1</lat>
            <lon>5.18</lon>
            <x>5.18</x>
            <y>52.1</y>
            <z>15.0</z>
            <units>oC</units>
        </header>
        <event date="2013-01-01" time="00:00:00" value="2" flag="0"/>
        <event date="2013-02-01" time="00:00:00" value="1.7" flag="0"/>
        <event date="2013-03-01" time="00:00:00" value="2.5" flag="0"/>
        <event date="2013-04-01" time="00:00:00" value="8.1" flag="0"/>
        <event date="2013-05-01" time="00:00:00" value="11.5" flag="0"/>
        <event date="2013-06-01" time="00:00:00" value="15.3" flag="0"/>
        <event date="2013-07-01" time="00:00:00" value="19.2" flag="0"/>
        <event date="2013-08-01" time="00:00:00" value="18.1" flag="0"/>
        <event date="2013-09-01" time="00:00:00" value="14.4" flag="0"/>
        <event date="2013-10-01" time="00:00:00" value="12.2" flag="0"/>
        <event date="2013-11-01" time="00:00:00" value="6.7" flag="0"/>
        <event date="2013-12-01" time="00:00:00" value="5.9" flag="0"/>
        <event date="2014-01-01" time="00:00:00" value="5.7" flag="0"/>
    </series>
    <series>
        <header>
            <type>instantaneous</type>
            <moduleInstanceId>ImportObserved</moduleInstanceId>
            <locationId>63306380000</locationId>
            <parameterId>T.obs.mean</parameterId>
            <timeStep unit="nonequidistant"/>
            <startDate date="2013-01-01" time="00:00:00"/>
            <endDate date="2014-01-01" time="00:00:00"/>
            <missVal>-999.0</missVal>
            <stationName>MAASTRICHT AP</stationName>
            <lat>50.92</lat>
            <lon>5.78</lon>
            <x>5.78</x>
            <y>50.92</y>
            <z>116.0</z>
            <units>oC</units>
        </header>
        <event date="2013-01-01" time="00:00:00" value="1.8" flag="0"/>
        <event date="2013-02-01" time="00:00:00" value="0.8" flag="0"/>
        <event date="2013-03-01" time="00:00:00" value="2.4" flag="0"/>
        <event date="2013-04-01" time="00:00:00" value="9" flag="0"/>
        <event date="2013-05-01" time="00:00:00" value="11.5" flag="0"/>
        <event date="2013-06-01" time="00:00:00" value="15.7" flag="0"/>
        <event date="2013-07-01" time="00:00:00" value="20" flag="0"/>
        <event date="2013-08-01" time="00:00:00" value="18.5" flag="0"/>
        <event date="2013-09-01" time="00:00:00" value="14.4" flag="0"/>
        <event date="2013-10-01" time="00:00:00" value="12.5" flag="0"/>
        <event date="2013-11-01" time="00:00:00" value="5.8" flag="0"/>
        <event date="2013-12-01" time="00:00:00" value="5.6" flag="0"/>
        <event date="2014-01-01" time="00:00:00" value="5.7" flag="0"/>
    </series>
</TimeSeries>        

PI-XML example with milliseconds

<?xml version="1.0" encoding="UTF-8"?>
<TimeSeries 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_timeseries.xsd" version="1.23" xmlns:fs="http://www.wldelft.nl/fews/fs">
    <timeZone>0.0</timeZone>
    <series>
        <header>
            <type>instantaneous</type>
            <moduleInstanceId>ImportObserved</moduleInstanceId>
            <locationId>63306260000</locationId>
            <parameterId>T.obs.mean</parameterId>
            <timeStep unit="nonequidistant"/>
            <startDate date="2013-01-01" time="00:00:00"/>
            <endDate date="2014-01-01" time="00:00:00"/>
            <missVal>-999.0</missVal>
            <stationName>DE BILT</stationName>
            <lat>52.1</lat>
            <lon>5.18</lon>
            <x>5.18</x>
            <y>52.1</y>
            <z>15.0</z>
            <units>oC</units>
        </header>
        <event date="2013-01-01" time="00:00:00.250" value="2" flag="0"/>
        <event date="2013-02-01" time="00:00:00.250" value="1.7" flag="0"/>
        <event date="2013-03-01" time="00:00:00.250" value="2.5" flag="0"/>
        <event date="2013-04-01" time="00:00:00.250" value="8.1" flag="0"/>
        <event date="2013-05-01" time="00:00:00.250" value="11.5" flag="0"/>
        <event date="2013-06-01" time="00:00:00.250" value="15.3" flag="0"/>
        <event date="2013-07-01" time="00:00:00.250" value="19.2" flag="0"/>
        <event date="2013-08-01" time="00:00:00.250" value="18.1" flag="0"/>
        <event date="2013-09-01" time="00:00:00.250" value="14.4" flag="0"/>
        <event date="2013-10-01" time="00:00:00.250" value="12.2" flag="0"/>
        <event date="2013-11-01" time="00:00:00.250" value="6.7" flag="0"/>
        <event date="2013-12-01" time="00:00:00.250" value="5.9" flag="0"/>
        <event date="2014-01-01" time="00:00:00.250" value="5.7" flag="0"/>
    </series>   
</TimeSeries>


Example PI-JSON response

{
  "version" : "1.23",
  "timeZone" : "0.0",
  "timeSeries" : [ {
    "header" : {
      "type" : "instantaneous",
      "moduleInstanceId" : "ImportObserved",
      "locationId" : "63306260000",
      "parameterId" : "T.obs.mean",
      "timeStep" : {
        "unit" : "nonequidistant"
      },
      "startDate" : {
        "date" : "2013-01-01",
        "time" : "00:00:00"
      },
      "endDate" : {
        "date" : "2014-01-01",
        "time" : "00:00:00"
      },
      "missVal" : "-999.0",
      "stationName" : "DE BILT",
      "lat" : "52.1",
      "lon" : "5.18",
      "x" : "5.18",
      "y" : "52.1",
      "z" : "15.0",
      "units" : "oC"
    },
    "events" : [ {
      "date" : "2013-01-01",
      "time" : "00:00:00",
      "value" : "2",
      "flag" : "0"
    }, {
      "date" : "2013-02-01",
      "time" : "00:00:00",
      "value" : "1.7",
      "flag" : "0"
    }, {
      "date" : "2013-03-01",
      "time" : "00:00:00",
      "value" : "2.5",
      "flag" : "0"
    }, {
      "date" : "2013-04-01",
      "time" : "00:00:00",
      "value" : "8.1",
      "flag" : "0"
    }, {
      "date" : "2013-05-01",
      "time" : "00:00:00",
      "value" : "11.5",
      "flag" : "0"
    }, {
      "date" : "2013-06-01",
      "time" : "00:00:00",
      "value" : "15.3",
      "flag" : "0"
    }, {
      "date" : "2013-07-01",
      "time" : "00:00:00",
      "value" : "19.2",
      "flag" : "0"
    }, {
      "date" : "2013-08-01",
      "time" : "00:00:00",
      "value" : "18.1",
      "flag" : "0"
    }, {
      "date" : "2013-09-01",
      "time" : "00:00:00",
      "value" : "14.4",
      "flag" : "0"
    }, {
      "date" : "2013-10-01",
      "time" : "00:00:00",
      "value" : "12.2",
      "flag" : "0"
    }, {
      "date" : "2013-11-01",
      "time" : "00:00:00",
      "value" : "6.7",
      "flag" : "0"
    }, {
      "date" : "2013-12-01",
      "time" : "00:00:00",
      "value" : "5.9",
      "flag" : "0"
    }, {
      "date" : "2014-01-01",
      "time" : "00:00:00",
      "value" : "5.7",
      "flag" : "0"
    } ]
  }, {
    "header" : {
      "type" : "instantaneous",
      "moduleInstanceId" : "ImportObserved",
      "locationId" : "63306380000",
      "parameterId" : "T.obs.mean",
      "timeStep" : {
        "unit" : "nonequidistant"
      },
      "startDate" : {
        "date" : "2013-01-01",
        "time" : "00:00:00"
      },
      "endDate" : {
        "date" : "2014-01-01",
        "time" : "00:00:00"
      },
      "missVal" : "-999.0",
      "stationName" : "MAASTRICHT AP",
      "lat" : "50.92",
      "lon" : "5.78",
      "x" : "5.78",
      "y" : "50.92",
      "z" : "116.0",
      "units" : "oC"
    },
    "events" : [ {
      "date" : "2013-01-01",
      "time" : "00:00:00",
      "value" : "1.8",
      "flag" : "0"
    }, {
      "date" : "2013-02-01",
      "time" : "00:00:00",
      "value" : "0.8",
      "flag" : "0"
    }, {
      "date" : "2013-03-01",
      "time" : "00:00:00",
      "value" : "2.4",
      "flag" : "0"
    }, {
      "date" : "2013-04-01",
      "time" : "00:00:00",
      "value" : "9",
      "flag" : "0"
    }, {
      "date" : "2013-05-01",
      "time" : "00:00:00",
      "value" : "11.5",
      "flag" : "0"
    }, {
      "date" : "2013-06-01",
      "time" : "00:00:00",
      "value" : "15.7",
      "flag" : "0"
    }, {
      "date" : "2013-07-01",
      "time" : "00:00:00",
      "value" : "20",
      "flag" : "0"
    }, {
      "date" : "2013-08-01",
      "time" : "00:00:00",
      "value" : "18.5",
      "flag" : "0"
    }, {
      "date" : "2013-09-01",
      "time" : "00:00:00",
      "value" : "14.4",
      "flag" : "0"
    }, {
      "date" : "2013-10-01",
      "time" : "00:00:00",
      "value" : "12.5",
      "flag" : "0"
    }, {
      "date" : "2013-11-01",
      "time" : "00:00:00",
      "value" : "5.8",
      "flag" : "0"
    }, {
      "date" : "2013-12-01",
      "time" : "00:00:00",
      "value" : "5.6",
      "flag" : "0"
    }, {
      "date" : "2014-01-01",
      "time" : "00:00:00",
      "value" : "5.7",
      "flag" : "0"
    } ]
  } ]
}

Example Json with milliseconds:

{
  "version" : "1.23",
  "timeZone" : "0.0",
  "timeSeries" : [ {
    "header" : {
      "type" : "instantaneous",
      "moduleInstanceId" : "ImportObserved",
      "locationId" : "63306260000",
      "parameterId" : "T.obs.mean",
      "timeStep" : {
        "unit" : "nonequidistant"
      },
      "startDate" : {
        "date" : "2013-01-01",
        "time" : "00:00:00"
      },
      "endDate" : {
        "date" : "2014-01-01",
        "time" : "00:00:00"
      },
      "missVal" : "-999.0",
      "stationName" : "DE BILT",
      "lat" : "52.1",
      "lon" : "5.18",
      "x" : "5.18",
      "y" : "52.1",
      "z" : "15.0",
      "units" : "oC"
    },
    "events" : [ {
      "date" : "2013-01-01",
      "time" : "00:00:00.250",
      "value" : "2",
      "flag" : "0"
    }, {
      "date" : "2013-02-01",
      "time" : "00:00:00.250",
      "value" : "1.7",
      "flag" : "0"
    }, {
      "date" : "2013-03-01",
      "time" : "00:00:00.250",
      "value" : "2.5",
      "flag" : "0"
    }, {
      "date" : "2013-04-01",
      "time" : "00:00:00.250",
      "value" : "8.1",
      "flag" : "0"
    }, {
      "date" : "2013-05-01",
      "time" : "00:00:00.250",
      "value" : "11.5",
      "flag" : "0"
    }, {
      "date" : "2013-06-01",
      "time" : "00:00:00.250",
      "value" : "15.3",
      "flag" : "0"
    }, {
      "date" : "2013-07-01",
      "time" : "00:00:00.250",
      "value" : "19.2",
      "flag" : "0"
    }, {
      "date" : "2013-08-01",
      "time" : "00:00:00.250",
      "value" : "18.1",
      "flag" : "0"
    }, {
      "date" : "2013-09-01",
      "time" : "00:00:00.250",
      "value" : "14.4",
      "flag" : "0"
    }, {
      "date" : "2013-10-01",
      "time" : "00:00:00.250",
      "value" : "12.2",
      "flag" : "0"
    }, {
      "date" : "2013-11-01",
      "time" : "00:00:00.250",
      "value" : "6.7",
      "flag" : "0"
    }, {
      "date" : "2013-12-01",
      "time" : "00:00:00.250",
      "value" : "5.9",
      "flag" : "0"
    }, {
      "date" : "2014-01-01",
      "time" : "00:00:00.250",
      "value" : "5.7",
      "flag" : "0"
    } ]
  }]
 }







POST timeseries (2017.02)

Write timeseries data to the FEWS system using the timeseries sets defined by the filters. The timeSeries are stored in the piTimeSeriesXmlContent. The 'convertDatum' argument is to allow timeseries that support a datum to have their values converted to a value relative to the location height. If values are already relative to location then enter FALSE or omit.

Request parameters

  • filterId (string): Filter id for when the input timeseries maps to multiple internal timeseries. Within the scope of the filter the input timeseries should only map to one internal timeseries.

  • convertDatum (boolean): Convert values from relative location height to absolute height values

Body parameters

  • piTimeSeriesXmlContent (xml string, required): PiTimeseries xml file  encoded in the 'application/x-www-form-urlencoded Content-Type. Example of a piTimeSeriesXmlContent (unencoded):

    <?xml version="1.0" encoding="UTF-8"?>
    <TimeSeries 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_timeseries.xsd" version="1.12">
    	<timeZone>0.0</timeZone>
    	<series>
    		<header>
    			<type>instantaneous</type>
    			<locationId>63306260000</locationId>
    			<parameterId>T.obs.mean</parameterId>
    			<timeStep unit="nonequidistant"/>
    			<startDate date="2013-01-01" time="00:40:00"/>
    			<endDate date="2013-01-01" time="00:50:00"/>
    			<missVal>-999.0</missVal>
    			<stationName>DE BILT</stationName>
    			<lat>51.76391247583424</lat>
    			<lon>4.329717456157946</lon>
    			<x>82000.0</x>
    			<y>420000.0</y>
    			<z>0.0</z>
    			<units>m</units>
    		</header>
    		<event date="2013-01-01" time="00:40:00" value="13.0" flag="0"/>
    		<event date="2013-01-01" time="00:50:00" value="13.0" flag="0"/>
    	</series>
    </TimeSeries>
    
    

    Since 2018.02 the service also supports milliseconds. The parser automatically recognises whitch format is used.

  • <?xml version="1.0" encoding="UTF-8"?>
    <TimeSeries 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_timeseries.xsd" version="1.12">
    	<timeZone>0.0</timeZone>
    	<series>
    		<header>
    			<type>instantaneous</type>
    			<locationId>63306260000</locationId>
    			<parameterId>T.obs.mean</parameterId>
    			<timeStep unit="nonequidistant"/>
    			<startDate date="2013-01-01" time="00:40:00.750"/>
    			<endDate date="2013-01-01" time="00:50:00.250"/>
    			<missVal>-999.0</missVal>
    			<stationName>DE BILT</stationName>
    			<lat>51.76391247583424</lat>
    			<lon>4.329717456157946</lon>
    			<x>82000.0</x>
    			<y>420000.0</y>
    			<z>0.0</z>
    			<units>m</units>
    		</header>
    		<event date="2013-01-01" time="00:40:00.750" value="13.0" flag="0"/>
    		<event date="2013-01-01" time="00:50:00.250" value="13.0" flag="0"/>
    	</series>
    </TimeSeries>
  • N.B. The SOAP Web Service has support for posting timeSeries as binary data using the piTimeSeriesBinaryContent. This is NOT support in this REST service of the PI Service.

Response

  • Diag PI xml response with all diagnostic output.

Example request

The following example shows how timeSeries can created using the POST method. Take note that the TimeSeries have to be posted in PI XML Format in the body of the POST request using the piTimeSeriesXmlContent key. The value is the content of the PI XML Timeseries in application/x-www-form-urlencoded format.

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/timeseries/" -X POST -H "Content-Type: application/x-www-form-urlencoded" -d piTimeSeriesXmlContent=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3CTimeSeries%20xmlns%3D%22http%3A%2F%2Fwww.wldelft.nl%2Ffews%2FPI%22%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22%0D%0A%09%09%09xsi%3AschemaLocation%3D%22http%3A%2F%2Fwww.wldelft.nl%2Ffews%2FPI%20http%3A%2F%2Ffews.wldelft.nl%2Fschemas%2Fversion1.0%2Fpi-schemas%2Fpi_timeseries.xsd%22%20version%3D%221.12%22%3E%0D%0A%09%3CtimeZone%3E0.0%3C%2FtimeZone%3E%0D%0A%09%3Cseries%3E%0D%0A%09%09%3Cheader%3E%0D%0A%09%09%09%3Ctype%3Einstantaneous%3C%2Ftype%3E%0D%0A%09%09%09%3ClocationId%3E63306260000%3C%2FlocationId%3E%0D%0A%09%09%09%3CparameterId%3ET.obs.mean%3C%2FparameterId%3E%0D%0A%09%09%09%3CtimeStep%20unit%3D%22nonequidistant%22%2F%3E%0D%0A%09%09%09%3CstartDate%20date%3D%222013-01-01%22%20time%3D%2200%3A40%3A00%22%2F%3E%0D%0A%09%09%09%3CendDate%20date%3D%222013-01-01%22%20time%3D%2200%3A50%3A00%22%2F%3E%0D%0A%09%09%09%3CmissVal%3E-999.0%3C%2FmissVal%3E%0D%0A%09%09%09%3CstationName%3EDE%20BILT%3C%2FstationName%3E%0D%0A%09%09%09%3Clat%3E51.76391247583424%3C%2Flat%3E%0D%0A%09%09%09%3Clon%3E4.329717456157946%3C%2Flon%3E%0D%0A%09%09%09%3Cx%3E82000.0%3C%2Fx%3E%0D%0A%09%09%09%3Cy%3E420000.0%3C%2Fy%3E%0D%0A%09%09%09%3Cz%3E0.0%3C%2Fz%3E%0D%0A%09%09%09%3Cunits%3Em%3C%2Funits%3E%0D%0A%09%09%3C%2Fheader%3E%0D%0A%09%09%3Cevent%20date%3D%222013-01-01%22%20time%3D%2200%3A40%3A00%22%20value%3D%2213.0%22%20flag%3D%220%22%2F%3E%0D%0A%09%09%3Cevent%20date%3D%222013-01-01%22%20time%3D%2200%3A50%3A00%22%20value%3D%2213.0%22%20flag%3D%220%22%2F%3E%0D%0A%09%3C%2Fseries%3E%0D%0A%3C%2FTimeSeries%3E

Example response

<?xml version="1.0" encoding="UTF-8"?>
<Diag 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_diag.xsd" version="1.2">
    <line level="2" description="Multiple time series sets found for parameter=T.obs.mean location=63306260000"/>
    <line level="3" description="Import.Info: External time series successfully mapped to FEWS time series 63306260000 T.obs.mean   (m) nonequidistant Tue Jan 0
1 01:40:00 CET 2013 z=0.0"/>
    <line level="3" description="Import.info: 1 time series imported, 0 time series rejected"/>
    <line level="3" description="Import.info: The following locations-parameter combination imported  63306260000:T.obs.mean"/
</Diag>

GET taskruns

Get the taskRuns that comply to the filters.

Request parameters

  • onlyForecasts (boolean): option to toggle if only forecasts should be returned. Default false.

  • onlyCurrent (boolean): option to toggle if only current forecasts should be returned. Default false.

  • startDispatchTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): Start time of search period that looks for taskruns that have their dispatch time within this period.

  • endDispatchTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): End time of search period that looks for taskruns that have their dispatch time within this period.

  • startForecastTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): Start time of search period that looks for taskruns that have their forecast time within this period.

  • endForecastTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): End time of search period that looks for taskruns that have their forecast time within this period.

  • workflowId (string): Filter by an existing workflow id.

  • scenarioId (string): Filter by an existing whatsif scenario id.

  • documentVersion (string, 1.9 or up): File format version (optional). For example: 1.23

Response

  • TaskRuns PI XML file content.

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/taskruns?workflowId=ImportObserved"

Example response

<?xml version="1.0" encoding="UTF-8"?>
<TaskRuns xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_taskruns.xsd" version="1.23">
    <timeZone>0.0</timeZone>
    <taskRun taskRunId="0_0">
        <forecast>false</forecast>
        <status>completed fully successful</status>
        <workflowId>ImportObserved</workflowId>
        <dispatchTime date="2017-08-13" time="09:55:18"/>
        <completionTime date="2017-08-13" time="10:21:35"/>
        <time0 date="2017-08-13" time="09:45:00"/>
        <outputStartTime date="1743-11-01" time="00:00:00"/>
        <outputEndTime date="2017-08-01" time="00:00:00"/>
        <user>rudie</user>
    </taskRun>
</TaskRuns>

GET taskrunstatus (2017.02)

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

curl "localhost:8080/FewsWebServices/rest/fewspiservice/v1/taskrunstatus?taskId=1_0"

Example response

C

POST runtask (2017.02)

Runs a workflow task for a given workflowId. Returns a handle to the task in the form of a taskid. This taskId can be used to track the status of the workflow using the taskrunstatus method. 

Request parameters

  • workflowId (string, required): Identifier of the task to run
  • startTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): Start of run period. Used for state selection period.
  • timeZero (dateTime: yyyy-MM-ddTHH:mm:ssZ): Forecast time zero. If missing System time is used (optional)
  • endTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): 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

  • piModifiersXmlContent (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

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

Example request

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

Example response

1_0

 

GET timeseriesmodifiers (2017.02)

Get a list of all timeSeries modifiers

Request parameters

  • locationIds (string):

  • moduleInstanceIds (string):

  • startTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): start time of modifiers search period

  • endTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): end time of modifiers search period.

  • userId (string):

  • modifierTypeId (string):

  • active (boolean, default true):

  • userDefinedModifierDescriptionKeyValuePair (string):

If no startTime and endTime are given, the search period is any time.

Response

  • timeSeriesModifiers PI XML

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/timeseriesmodifiers"

Example response

<?xml version="1.0" encoding="UTF-8"?>
<Modifiers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_modifiers.xsd">
    <modifier>
        <name>T.obs.mean_DE BILT</name>
        <modifierId>0</modifierId>
        <systemActivityDescriptorId>34</systemActivityDescriptorId>
        <enabled>true</enabled>
        <modifierType>MISSING_VALUE_MODIFIER</modifierType>
        <userId>Andre Grijze</userId>
        <startTime date="1900-10-17" time="00:00:00"/>
        <endTime date="2017-11-23" time="00:00:00"/>
        <validTime date="3000-01-01" time="00:00:00"/>
        <creationTime date="2017-10-24" time="11:43:11"/>
        <constantValueTimeSeriesModifier>
            <timeSeriesSet>
                <moduleInstanceId>ImportObserved</moduleInstanceId>
                <parameterId>T.obs.mean</parameterId>
                <locationId>63306260000</locationId>
                <timeSeriesType>external historical</timeSeriesType>
                <timeStep unit="nonequidistant"/>
                <ensembleId>main</ensembleId>
            </timeSeriesSet>
            <startTime date="1900-10-17" time="00:00:00"/>
            <endTime date="2017-11-23" time="00:00:00"/>
            <value>NaN</value>
        </constantValueTimeSeriesModifier>
    </modifier>
</Modifiers>

GET modifiers

Get a list of all modifiers.

Request parameters

  • startTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): start time of modifiers search period

  • endTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): end time of modifiers search period.

  • modifierTypeId (string): filter on modifiers by modifierTypeId as specified in the ModifierTypes.xml configuration. If modifier type cannot be found, not filtering on type is done.

If no startTime and endTime are given, the search period is any time.

Response

  • Modifiers PI XML

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/modifiers?modifierTypeId=MISSING_VALUE_MODIFIER"

Example response

<?xml version="1.0" encoding="UTF-8"?>
<Modifiers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_modifiers.xsd">
    <modifier>
        <name>T.obs.mean_DE BILT</name>
        <modifierId>0</modifierId>
        <systemActivityDescriptorId>34</systemActivityDescriptorId>
        <enabled>true</enabled>
        <modifierType>MISSING_VALUE_MODIFIER</modifierType>
        <userId>Rudie Ekkelenkamp</userId>
        <startTime date="1900-10-17" time="00:00:00"/>
        <endTime date="2017-11-23" time="00:00:00"/>
        <validTime date="3000-01-01" time="00:00:00"/>
        <creationTime date="2017-10-24" time="11:43:11"/>
        <constantValueTimeSeriesModifier>
            <timeSeriesSet>
                <moduleInstanceId>ImportObserved</moduleInstanceId>
                <parameterId>T.obs.mean</parameterId>
                <locationId>63306260000</locationId>
                <timeSeriesType>external historical</timeSeriesType>
                <timeStep unit="nonequidistant"/>
                <ensembleId>main</ensembleId>
            </timeSeriesSet>
            <startTime date="1900-10-17" time="00:00:00"/>
            <endTime date="2017-11-23" time="00:00:00"/>
            <value>NaN</value>
        </constantValueTimeSeriesModifier>
    </modifier>
</Modifiers>

POST modifiers (2017.02)

Create new modifiers.

Request parameters

  • commitModiifers (boolean): Indicates if the modifiers should be committed after the uploaded. This option defaults to true.

  • deleteAllModifiers (boolean): Indicates if all the existing modifiers should be deleted prior to inserting the new modifiers. This option defaults to false.

Body parameters

  • piModifiersXmlContent (pi Modifiers XML url encoded): Contents of a  modifiers file. The xml file content has to be encoded in the 'application/x-www-form-urlencoded Content-Type.

Response

  • Diag PI xml response with all diagnostic output.

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/modifiers" -X POST -H "Content-Type: application/x-www-form-urlencoded"  -d "piModifiersXmlContent="%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3CModifiers%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22%20xmlns%3D%22http%3A%2F%2Fwww.wldelft.nl%2Ffews%2FPI%22%20xsi%3AschemaLocation%3D%22http%3A%2F%2Fwww.wldelft.nl%2Ffews%2FPI%20http%3A%2F%2Ffews.wldelft.nl%2Fschemas%2Fversion1.0%2Fpi-schemas%2Fpi_modifiers.xsd%22%3E%0D%0A%20%20%20%20%3Cmodifier%3E%0D%0A%20%20%20%20%20%20%20%20%3Cname%3ET.obs.mean_DE%20BILT%3C%2Fname%3E%0D%0A%20%20%20%20%20%20%20%20%3Cenabled%3Etrue%3C%2Fenabled%3E%0D%0A%20%20%20%20%20%20%20%20%3CmodifierType%3EMODIFY_TIMESERIES%3C%2FmodifierType%3E%0D%0A%20%20%20%20%20%20%20%20%3CuserId%3ERudie%20Ekkelenkamp%3C%2FuserId%3E%0D%0A%20%20%20%20%20%20%20%20%3CstartTime%20date%3D%221900-10-24%22%20time%3D%2200%3A00%3A00%22%2F%3E%0D%0A%20%20%20%20%20%20%20%20%3CendTime%20date%3D%222017-10-25%22%20time%3D%2200%3A00%3A00%22%2F%3E%0D%0A%20%20%20%20%20%20%20%20%3CvalidTime%20date%3D%222017-10-24%22%20time%3D%2200%3A00%3A00%22%2F%3E%0D%0A%20%20%20%20%20%20%20%20%3CcreationTime%20date%3D%222017-10-24%22%20time%3D%2211%3A15%3A43%22%2F%3E%0D%0A%20%20%20%20%20%20%20%20%3CtransformationTimeSeriesModifier%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CtimeSeriesSet%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CmoduleInstanceId%3EImportObserved%3C%2FmoduleInstanceId%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CparameterId%3ET.obs.mean%3C%2FparameterId%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3ClocationId%3E63306260000%3C%2FlocationId%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CtimeSeriesType%3Eexternal%20historical%3C%2FtimeSeriesType%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CtimeStep%20unit%3D%22nonequidistant%22%2F%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CensembleId%3Emain%3C%2FensembleId%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FtimeSeriesSet%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cmultiplier%3E1.0%3C%2Fmultiplier%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cdivider%3E1.1%3C%2Fdivider%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cincrementer%3E0.0%3C%2Fincrementer%3E%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cdelay%3E0%3C%2Fdelay%3E%0D%0A%20%20%20%20%20%20%20%20%3C%2FtransformationTimeSeriesModifier%3E%0D%0A%20%20%20%20%3C%2Fmodifier%3E%0D%0A%3C%2FModifiers%3E"

Example response

<?xml version="1.0" encoding="UTF-8"?>
<Diag 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_diag.xsd" version="1.2">
    <line level="3" description="Successfully imported modifier:none MODIFY_TIMESERIES -1 T.obs.mean_DE BILT none"/>
</Diag>

GET workflows (2017.02)

Request parameters

  • documentVersion (string, 1.9 or up): File format version (optional). For example: 1.23

Response

  • xml workflows.

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/workflows"

Example response

<?xml version="1.0" encoding="UTF-8"?>
<workflows xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://
fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_workflows.xsd" version="1.23">
    <workflow id="ImportObserved">
        <name>Import Observed Data</name>
        <description>Import observed scalar data from external sources and process the imported data</description>
    </workflow>
</workflows>

GET samples (2017.02)

Request parameters

  • documentVersion (string, 1.21 or up): File format version (optional). For example: 1.23
  • endCreationTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): 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: yyyy-MM-ddTHH:mm:ssZ): 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.
  • qualifierIds (string): Subset of qualifiers for which to retrieve samples.
  • sampleIds Subset of sample id's for which to retrieve samples. Repeat parameter for multiple samples ids.
  • startCreationTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): 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: yyyy-MM-ddTHH:mm:ssZ): 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

  • Samples PI XML file content

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/samples?sampleIds=713&locationIds=MBP012&startTime=1970-01-01T00:00:00Z+0000&endTime=2017-01-01T00:00:00Z+0000"

Example response

<?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>

GET processdata (2017.02)

Request parameters

  • startTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): start time of the requested period

  • endTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): end time of the requested period

  • workflowId (string): workflow which should be run. This workflow should generate the requested data file

  • xMin (string): left x coordinate of the bounding box for which data should be generated

  • xMax (string): right x coordinate of the bounding box for which data should be generated

  • yMin (string): lower y coordinate of the bounding box for which data should be generated

  • yMax (string): upper y coordinate of the bounding box for which data should be generated

  • xCellSize (string): width of the cell size

  • yCellSize (string): height of the cell size

Response

  • The workflow indicated by the workflowId should generate a data-file (usually a netcdf-file). if the workfow has succesfully generated a netcdf-file, the response will be binary stream containing the generated file. If no file is generated an 500 error will be thrown.

Example request

curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/processdata/?workflowId=Transformation_ASA_Grid_Wind&xMin=52.58&yMin=24.38&xMax=54.62&yMax=26.10&xCellSize=0.01&yCellSize=0.01&startTime=2017-11-18T00:00:00Z&endTime=2017-11-19T00:00:00Z"

Configuration

A property EXPORT_FOLDER_PROCESS_DATA should be configured in the global properties or in the webservice properties. The workflow indicated by the workflow id should export data to a folder EXPORT_FOLDER_PROCESS_DATA. 


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:

%REGION_HOME%/Config/PiClientConfigFiles/FewsPiService.properties

For more information about the possible properties, see FEWS Web Services configuration FewsPiService.properties.

  • No labels