Ceci est une ancienne révision du document !
Table des matières
Warp10
Démarrage
Démarrage Warp10 Standalone et WarpStudio :
docker run -d --restart=always --name="Warp10" -p 80:8080 -p 81:8081 warp10io/warp10:latest
Create Token
Getting Token - Génération d'un Token de démo valide 1 an :
florian@ubuntuNAS:~$ docker exec -u warp10 -it Warp10 warp10-standalone.sh worf MyGTS 31536000000 {"read":{"token":"_CMyoxjEHWECcDynChiuwHG.rIeaiIY1mrZSWdfS6bz6p1PqNH_gpkppoqgKyGlmdnueFuWUPyamxzKOz2Ss90YFkjDifWZP9yAjCBjrh5PXJuYrL5anJV","tokenIdent":"a98f77328f47d3fa","ttl":31536000000,"application":"MyGTS","applications":["MyGTS"],"owners":["0f573687-508c-4da7-925f-87a224f0b7fe"],"producer":"0f573687-508c-4da7-925f-87a224f0b7fe","producers":[]},"write":{"token":"AP_8QdbvhyjFJuuOoohNyHJClJd7ODr.vP5GMt.Y6irthsyFdeaZt_vx2CeCrQfpF465ADT1RKD5e488pteN2MhfVomQbEHAPX8Ra3foeYo","tokenIdent":"7af4eff80b201b04","ttl":31536000000,"application":"MyGTS","owner":"0f573687-508c-4da7-925f-87a224f0b7fe","producer":"0f573687-508c-4da7-925f-87a224f0b7fe"}}
Write GTS
Writing Data - On pousse une GTS :
curl -v -H 'X-Warp10-Token: my_write_token' --data-binary "1/48.44484:-4.46653/15000 GTS_demo{lieu=maison} 'Toctoc'" 'http://192.168.0.11:80/api/v0/update'
Un fichier de GTS :
Florian.Tales@LIN0115014:~/Téléchargements$ curl -v -H 'X-Warp10-Token: my_write_token' --data-binary @eco2mix.gts 'http://192.168.0.11:80/api/v0/update'
Read GTS
Reading Data - On lit les GTS - ici via WarpStudio :
Delete GTS
Delete Data - On efface tout : ~.* url encoded :
curl -v -H 'X-Warp10-Token: my_write_token' 'http://192.168.0.11:80/api/v0/delete?deleteall&selector=~.%2A%7B%7D'
Exploration opendata eco2mix
Exploration des données france énergie : https://opendata.reseaux-energies.fr/explore/dataset/eco2mix-regional-cons-def/ (Spécification des fichiers de données : Lien)
Conversion csv au format gts file : https://github.com/floriantales/warp10-eco2mix/blob/main/eco2mix_csv_to_gts.sh
Production Eolienne Bretonne
Fetch
Exploration de la production eolienne en MW en Bretagne les 100 derniers jours :
- warpscript1.mc2
// Fetch 100 days Brittany wind production & smooth it '_CMyoxjEHWECcDynChiuwHG.rIeaiIY1mrZSWdfS6bz6p1PqNH_gpkppoqgKyGlmdnueFuWUPyamxzKOz2Ss90YFkjDifWZP9yAjCBjrh5PXJuYrL5anJV' 'Read_Token' STORE 'AP_8QdbvhyjFJuuOoohNyHJClJd7ODr.vP5GMt.Y6irthsyFdeaZt_vx2CeCrQfpF465ADT1RKD5e488pteN2MhfVomQbEHAPX8Ra3foeYo' 'Write_Token' STORE // Fetch [ $Read_Token 'eco2mix.production.mw' { 'region' 'Bretagne' 'source' 'eolien' } NOW 100 d ] FETCH 'gts_eolien' STORE // Single Exponential Smoothing $gts_eolien 0.01 // alpha (smoothing factor) SINGLEEXPONENTIALSMOOTHING 'gts_eolien_single_exp' STORE // Display $gts_eolien_single_exp $gts_eolien
Source : warpscript1.mc2
Dataviz
Production Renouvelable Bretonne
Fetch
Exploration de la production totale (reducer.sum) des énergies renouvelables et de la consommation sur 100 jours :
- warpscript2.mc2
'_CMyoxjEHWECcDynChiuwHG.rIeaiIY1mrZSWdfS6bz6p1PqNH_gpkppoqgKyGlmdnueFuWUPyamxzKOz2Ss90YFkjDifWZP9yAjCBjrh5PXJuYrL5anJV' 'Read_Token' STORE 'AP_8QdbvhyjFJuuOoohNyHJClJd7ODr.vP5GMt.Y6irthsyFdeaZt_vx2CeCrQfpF465ADT1RKD5e488pteN2MhfVomQbEHAPX8Ra3foeYo' 'Write_Token' STORE // Fetch Production Renouvelable [ $Read_Token 'eco2mix.production.mw' { 'region' 'Bretagne' 'source' '~(hydrolique|bioenregie|eolien|solaire)' } NOW 100 d ] FETCH 'gts_prod' STORE // Somme des production Renouvelable [ $gts_prod [] reducer.sum ] REDUCE 'gts_prod' STORE // Single Exponential Smoothing //$gts_prod //0.01 // alpha (smoothing factor) //SINGLEEXPONENTIALSMOOTHING 'gts_prod_smooth' STORE // Fetch Consommation [ $Read_Token 'eco2mix.consommation.mw' { 'region' 'Bretagne' } NOW 100 d ] FETCH 'gts_conso' STORE // Display $gts_prod $gts_conso
Dataviz