Versions Compared

Key

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

Please note: this information provider has very strict security rules, and data can only be access from specific IP addresses that are given special permissions, and need to connect using VPN and google authenticate.  You also need a username and password which FEWS will use to access an authorization token to be able to download data.

 


This import can download data from two different REST endpoints: PrecipitacaoObservada and Grandezas Hidrologicas. Both the URL params and responses are very similar, but there are some differences, detailed bellow.

...

Grandeza --> timeseries parameter, filled in by FEWS automatically, using the external parameter ID from the configured time series.   The following parameters are supported: "VMD","AFL","DFL","TUR","VER","VTR","VOE","NIV","NJS","VNA","VNM","VNS","VIA".  In one request only one parameter can be used, but FEWS will loop through all parameters one by one automatically.

 


URL examples:

https://integrationnode.tstapi.ons.org.br/hidrologia/v1/GrandezasHidrologicas?DataInicialMedicao=21/04/2020&DataFinalMedicao=24/04/2020&QualidadeDado=COO&AgregacaoTemporal=DI&Grandeza=DFL&IDPostoReservatorio=RPTOCO

https://integrationnode.tstapi.ons.org.br/hidrologia/v1/PrecipitacaoObservada?DataInicialMedicao=22/04/2020&DataFinalMedicao=25/04/2020&QualidadeDado=CD&AgregacaoTemporal=DI&IDEstacaoMeteo=01944032,01944078,01942025

 

 

 




Config example:

Username and password are needed to be able to access the auth token.

...

tokenUrl- There are 3 different environments one can import data from. You need a different url for accessing the authorization token for each environment. Compulsory field. 



Code Block
languagexml
linenumberstrue
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 rel. 3 sp1 (http://www.altova.com) by Computer Services (WL | Delft Hydraulics) -->
<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">
   <import>
      <general>
         <importType> ONSWebService</importType>
<!--         Url should end with the ?-->
         <serverUrl>https://integrationnode.tstapi.ons.org.br/hidrologia/v1/GrandezasHidrologicas?</serverUrl>
         <user>user<<user>dummy_username</user>
         <password>password<<password>dummy_password</password>
         <relativeViewPeriod unit="day" start="-3" end="0" startOverrulable="true" endOverrulable="true"/>
         <idMapId>ONSWebServiceMap</idMapId>
      </general>
      <properties>
         <string key="QD" value="CD,CT"></string>
<!--         Should only be configured if the field needs to be added to the URL-->
         <string key="furoTemporal" value="S"></string>
<!--         This determined if we are importing PrecipitacaoObservada (false), or Grandezas Hidrologicas(true). Default is true-->
         <bool key="addParamToUrl" value="false"></bool>
<!--         The url to get the auth token is different on the test and production environment, thus needs to be configured-->
         <string key="tokenUrl" value="https://poptst.ons.org.br/ons.pop.federation/oauth2/token"></string>
      </properties>
      <timeSeriesSet>
         <moduleInstanceId> ONSWebService</moduleInstanceId>
         <valueType>scalar</valueType>
         <parameterId>param</parameterId>
         <locationId>LocB</locationId>
         <timeSeriesType>external historical</timeSeriesType>
         <timeStep unit="hour" multiplier="1"/>
         <readWriteMode>add originals</readWriteMode>
      </timeSeriesSet>
      <timeSeriesSet>
         <moduleInstanceId> ONSWebService</moduleInstanceId>
         <valueType>scalar</valueType>
         <parameterId>param2</parameterId>
         <locationId>LocB</locationId>
         <timeSeriesType>external historical</timeSeriesType>
         <timeStep unit="hour" multiplier="1"/>
         <readWriteMode>add originals</readWriteMode>
      </timeSeriesSet>
   </import>
</timeSeriesImportRun> 

...