Versions Compared

Key

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

...

The Digital Delta import will take the serverUrl specified in the import configuration file and append it with "?start=...&end=...&locationCode=...&observationTypeUuid=...". It will fill in the start and end fields using the relativeViewPeriod found in the import configuration file. For the locationCode and observationTypeUuid it will use the externalLocation and externalParameter as found in the IdMap file, respectively. From the resulting json, the import will read all events (as given in the "events" field of the json) and add them to a time series with parameterId and locationId as specified in the IdMap file. For each event, only the "value" and "timeStamp" fields are read. The import assumes that all values given are floats. 

Since 2017.01 the Digital Delta import assumes that authentication is required for the given serverUrl, the properties clientId and clientSecret are required in the import configuration file. When using the google authentication service, the property refreshToken is also needed. Optionally, a tokenUrl property can be specified. By default the import will use "https://accounts.google.com/o/oauth2/token" as tokenUrl. Other authentication services have not yet been tested.

Example Import configuration file:

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
<!-- This is an example import configuration file for importing Observations and Measurements data from a service -->
<import>
    <general>
        <importType>DigitalDelta</importType>
        <serverUrl>http://host:port/FewsWebServices/rest/digitaledelta/v1/timeseries</serverUrl>
        <relativeViewPeriod unit="hour" start="-5" end="0" startOverrulable="true" endOverrulable="true"/>
        <idMapId>IdImportDD</idMapId>
    </general>
	<properties>
		<!-- Required: These properties are used to get an authentication token from the authentication service -->
		<string key="clientId" value="XXXX"/>
		<string key="clientSecret" value="XXXX"/>
 
        <!-- Optional: The refresh_token used by the Google authentication service -->
		<string key="refreshToken" value="XXXX"/>
 
		<!-- Optional: The url used to obtain an authentication token, by default the Google authentication service is used -->
		<string key="tokenUrl" value="https://accounts.google.com/o/oauth2/token"/>
    </properties>
    <timeSeriesSet>
       <moduleInstanceId>ImportDD</moduleInstanceId>
       <valueType>scalar</valueType>
       <parameterId>MyPar</parameterId>
       <locationSetId>MyLocSet</locationSetId>
       <timeSeriesType>external historical</timeSeriesType>
       <timeStep unit="nonequidistant"/>
       <readWriteMode>add originals</readWriteMode>
       <synchLevel>1</synchLevel>
    </timeSeriesSet>
</import>
</timeSeriesImportRun>

...