Versions Compared

Key

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

...

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), PI_JSON, DD_JSON, NOOS_TEXT, BINARY (only when running embedded tomcat)
  • endCreationTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): End time of search period that looks for creation time of time series. Note: creation time of time series is actually the creation time of the task that produced/imported these time series.
  • endForecastTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): End time of search period that looks for time series 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 are within this period. If the endTime doesn't match a timestamp of the time series, the closest timestamp after the endTime, will also be returned. Format: yyyy-MM-ddTHH:mm:ssZ. Take note that if no endTime is specified, the end time of the requested period will be set to the current time plus one day and one hour. 
  • ensembleId (string): Ensemble identifier of for time series
  • ensembleMemberId (string): Ensemble Member identifier of for time series. Only allowed in combination with ensembleId. Since 2022.02.
  • exportIdMap (string): Name of the id map that should be used as exportIdMap. Overrules a configured exportIdmapId from the WebServices.xml general section configuration.

  • 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. N.B. Can be used in combination with taskRunIds since 2020.01.
  • 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 time series. This parameter can be duplicated to use multiple locationIds.
  • moduleInstanceIds (string): Subset of moduleInstances for which to retrieve time series. This parameter can be duplicated to specify multiple moduleInstanceIds.
  • omitMissing (boolean): Toggle omitting or returning of missing values in response
  • omitEmptyTimeSeries (boolean): Toggle omitting or returning headers of empty timeSeries. Default is false. Since 2020.02.
  • onlyHeaders (boolean): Toggle to return only header information or also data
  • onlyForecasts (boolean): Toggle to return only forecast time series (Since 2017.02)
  • onlyManualEdits (boolean): Toggle to return only manual edits.
  • parameterIds (string): Subset of parameters for which to retrieve time series. This parameter has to be duplicated to specify multiple parameters.
  • qualifierIds (string): Subset of qualifiers for which to retrieve time series. This parameter has to be duplicated to specify multiple qualifierIds. To indicate that no qualifier is available, use qualifierIds: "none"
  • showProducts (boolean): Toggle to display product information that is assigned to a forecast. (Since 2019.02). See below for an example.
  • showStatistics (boolean): Toggle to return statistics information about time series. Typically used in combination with onlyHeaders. Returns additional information about data availability of time series (Since 2015.01). These statistics are only provided if there is any data, otherwise they are left out. 
    • firstValueTime: First time with a value in the time series
    • lastValueTime: Last time with a value in the time series
    • maxValue: Maximum value in the time series
    • minValue: Minimum value in the time series
    • valueCount: Number of values in the time series
  • showThresholds (boolean): Option to toggle the returning of threshold information in the headers
  • showEnsembleMemberIds (boolean): Show ensemble member ids instead of ensemble member indices.
  • timeSeriesType (string): Explicitly filter on a specific time series type. (Since 2020.01). Possible values are: EXTERNAL_HISTORICAL, EXTERNAL_FORECASTING, SIMULATED_HISTORICAL, SIMULATED_FORECASTING.
  • thinning (long): unit ms/pixel. Thinning is used to retrieve the visually interesting time steps of time series. It tries to keep the peaks and gaps and minimizes the number of time steps that have to be retrieved. It is typically used for visualizations. The value to be specified should be equal to the view period in milliseconds of the time series that is visualized divided by the number of pixels that are available for display. For example: visualizing a view period of 5 years (157784760000 milliseconds) on a display of 1024 pixels, the thinning parameter should be set to 157784760000/1024 = 15408668. (Since 2019.02)
  • useMilliseconds (boolean) Optional argument. Default is false. If it is set to true, the response will contain milliseconds. See example below. 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 time series. Note: creation time of time series is actually the creation time of the task that produced/imported these time series.
  • startForecastTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): Start time of search period that looks for time series produced by forecasts that have their forecast time within this period.  Format: yyyy-MM-ddTHH:mm:ssZ. If left empty all forecasts up to the endForecastTime will be used as search period.
  • startTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): Start time of search period that looks for timeseries values that are within this period. If the startTime doesn't match a timestamp of the time series, the closest timestamp before the startTime, will also be returned. Format: yyyy-MM-ddTHH:mm:ssZ. Take note that if no startTime is specified, the start time of the requested period will be set to the current time minus one day.
  • taskRunIds (string): Subset of task run ids for which to retrieve time series. This parameter has to be duplicated to specify multiple taskRuns.  N.B. cannot be used in combination with a filterId or with startTime and/or endTime.
  • useDisplayUnits (boolean): Export values using display units.
  • importFromExternalDataSource (boolean, default true): import data from external data source (Archive). (since 2017.02)
  • timeStepId (string): filter time series by the timestep that has been configured in the TimeSteps.xml. (since 2018.02). N.B.: It is not required to use the timeStepId's in the filter configurations to be able to use them as long as they have been configured in the TimeSteps.xml.
  • timeStepMillis (integer): filter time series by an equidistant timestep with a duration of the given number of milliseconds. This can be used in cases where no timestep Id has been configured in TimeSteps.xml.  Cannot be used in combination with timeStepId
  • matchAsQualifierSet (boolean): Optional argument. Indicates if the selected time series sets must contain all of the the given qualifiers and are not allowed to have additional qualifier ids.

Response

  • PI-XML
  • PI-JSON
  • BINARY: only supported when running in embedded tomcat in the Operator Client or Stand Alone.

Filter combinations

Not all parameters can be combined. The following combinations are commonly used valid combinations of parameters. The main way to filter timeSeries is by using filterIds or taskRunIds.


filterId

Only the default filter or one of its subfilters can be applied)

taskRunIds

One or more taskRunIds can be specified

startTime, endTime


startCreationTime, endCreationTime

startForecastTime, endForecastTime
Apply a filter to the time series. The requested period will be set to the current time minus one day and one hour ago until the current time plus one day and one hourX(1)




Get all time series created by one or more taskRuns. All time steps of the matching time series are returned.
X


Get the time series created by a taskrun and apply a filter from the Filters configuration. startTime and endTime cannot be specified. The complete time series will be returned. Since 2020.01.XX


Apply a filter to the time series and return time steps that are in the startTime and endTime range. If the startTime or endTime doesn't match a timestamp of the time series, the closest time step before startTime and/or after endTime is returned as well.
X
X

Apply a filter to the time series. Only time series created during the startCreationTime and endCreationTime period will be returned. All time steps of the matching time series are returned.X

X
Apply a filter to the time series. Return only time series created during the creation time period. Only return timesteps in the startTime and endTime range.X
XX
Apply a filter to the time series. Return only time series with external forecast times in the startForecastTime and endForecastTime period. Only return timesteps in the startTime and endTime range.X
X
X
Apply a filter to the time series. Return only time series with external forecast times in the startForecastTime and endForecastTime period that were created in the creation time period. Only return time steps in the startTime and endTime range.X
XXX
Apply a filter to the time series. Return only time series created during the creation time period. All time steps of the matching time series are returned. (before 2020.01 startTime and endTime had to be specified).X

X
Apply a filter to the time series. Return only time series with external forecast times in the startForecastTime and endForecastTime period. All time steps of the matching time series are returned.X


X
Apply a filter to the time series. Return only time series created during the creation time period and with external forecast times in the startForecastTime and endForecastTime period. All time steps of the matching time series are returned.X

XX

(1): Take note that if no startTime and endTime are specified, the requested period will be set to the current time minus one day and one hour ago until the current time plus one day and one hour. If only the startTime is specified, the requested period will be set to the startTime until the startTime time plus one day and one hour. If only the endTime is specified, the requested period will be set to the endTime minus one day and one hour until the endTime.

no data vs no time series

If a timeseries query has matching timeseries sets a http 200 code will be returned and the headers of all matching timeseries sets will be returned.
If there is any data for the requested period, the headers will be followed by the actual events that contain the data. So even if no data is available for the requested period,the headers are always returned.

It is also possible that a timeseries query doesn't match any time series sets at all. This is seen as in invalid request and will result in a HTTP 400 response code.
The following are examples of use cases where this might occur:

  • query parameters don't occur in filter. For example: the default filter has subfilters: filterA and filterB. filterA contains timeseries sets with module instance id moduleInstanceA and filterB contains timeseries sets with module instance id moduleInstanceB. If a timeseries query is done with parameters: filterId=filterA and moduleInstanceId=moduleInstanceB, this will return in a HTTP 400 response
  • no timeseries for creation period. For example: if a query is using startCreationTime and endCreationTime and no time series have been produced during that period, this is seen as an invalid request and a HTTP 400 response is returned.

...

Returns a zip-file with the requested products from the archive.    Note that the results of this response are by default not cached.

Request parameters

  • areaId (string): the area id of the requested products 
  • sourceId (string): the source id of the requested products
  • startTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): Start time of the archive search period
  • endTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): End time of the archive search period
  • startForecastTime  (dateTime: yyyy-MM-ddTHH:mm:ssZ): Start time of the forecast search period
  • endForecastTime (dateTime: yyyy-MM-ddTHH:mm:ssZ): End Time of the forecast search period
  • productFileName (string): if a productFileName is provided then only the products which match the provided file name will be returned,
  • documentFormat (string): BINARY and BINARY_ZIP are supported. BINARY can only be used if the selection consists of a single product file.
  • productCount (integer): the maximum number of products to be returned from the archive. If you only the download the most recent product in the requested period then use productCount=1

...

GET taskruns

Get the taskRuns that comply to the filters. By default only forecasts are returned. Note that the results of this response are by default not cached.

Request parameters

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

  • 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.

  • mcId (string): Filter by mcId. Since 2021.01.
  • taskRunStatusIds (string): Filter taskruns using the taskrunstatus code value. For valid status codes see the section 'Get taskrunstatus' below.
  • documentVersion (string, 1.9 or up): File format version (optional). For example: 1.23

Response

  • TaskRuns PI XML file content.

Example request

Code Block
curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/taskruns?workflowId=ImportObserved&onlyForecasts=false"

Example response

Code Block
<?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 moduleruntimes (2021.02)

Get all expected runtimes for workflows per module instance id. The list can optionally be filtered by workflowId. Only workflows of scheduled tasks that contain module instance descriptors that have been configured with updateModuleRunTimesOnCompletion enabled, will be available in this end point.

The expected start time of a module is calculated based on the scheduled next due time and the expected pending duration time. The expected end time of a module is calculated based on the scheduled next due time, the expected pending duration time and the expected running time. For triggered tasks, the expected start time en end time won't be available until the task is actually started.

Request parameters

  • workflowId (string): optional, allow filtering for a specific worklowId.

  • documentFormat (string): PI_XML (default)

Response

  • ModuleRunTime PI XML or PI JSON content.

Example request

Code Block
curl "http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/moduleruntimes?workflowId=Meuse_DWD_COSMO_LEPS"

Example response PI_XML

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<ModuleRunTimes 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_moduleruntimes.xsd">
    <moduleRunTime>
        <mcId>nldefedmc00</mcId>
        <workflowId>Meuse_DWD_COSMO_LEPS</workflowId>
        <moduleInstanceId>Dummy</moduleInstanceId>
        <expectedStartTime date="2021-10-13" time="13:15:01"/>
        <expectedCompletionTime date="2021-10-13" time="13:16:54"/>
        <expectedPendingDuration>1465</expectedPendingDuration>
        <expectedRunningDuration>112634</expectedRunningDuration>
    </moduleRunTime>
</ModuleRunTimes>

Example response PI_JSON

Code Block
{
  "moduleRunTimes" : [ {
    "workflowId" : "Meuse_DWD_COSMO_LEPS",
    "moduleInstanceId" : "Dummy",
    "mcId" : "nldefedmc00",
    "expectedStartTime" : 1414882800000,
    "expectedCompletionTime" : 1414886400000,
    "expectedPendingDuration" : 1465,
    "expectedRunningDuration" : 112634
  } ]
}


...