This commit is contained in:
20
queries/pg.sql
Normal file
20
queries/pg.sql
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
create or replace view power_v as
|
||||||
|
select time,
|
||||||
|
cast(values->'ActivePowerL1'->>'value' as float) as power_l1,
|
||||||
|
cast(values->'ActivePowerL2'->>'value' as float) as power_l2,
|
||||||
|
cast(values->'ActivePowerL3'->>'value' as float) as power_l3,
|
||||||
|
device
|
||||||
|
from measurements
|
||||||
|
where application = 'com-passavant-geiger-poc' and
|
||||||
|
attributes->>'FPort' = '1';
|
||||||
|
|
||||||
|
create or replace view power_factor_v as
|
||||||
|
select time,
|
||||||
|
cast(values->'PowerfactorL1'->>'value' as float) as factor_l1,
|
||||||
|
cast(values->'PowerfactorL2'->>'value' as float) as factor_l2,
|
||||||
|
cast(values->'PowerfactorL3'->>'value' as float) as factor_l3,
|
||||||
|
device
|
||||||
|
from measurements
|
||||||
|
where application = 'com-passavant-geiger-poc' and
|
||||||
|
attributes->>'FPort' = '1';
|
||||||
|
|
10
src/udi/ENVDB.udiload
Normal file
10
src/udi/ENVDB.udiload
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
if [ "$1" = "" ]; then
|
||||||
|
echo "set namespace as argument"
|
||||||
|
fi
|
||||||
|
N=$1
|
||||||
|
PGHOST=`kubectl get services traefik -n system -o jsonpath="{.status.loadBalancer.ingress[0].ip}"`
|
||||||
|
PGPASSWORD=`kubectl get secrets udi-db-cred -n $N -o jsonpath="{.data.PGPASSWORD}" | base64 --decode`
|
||||||
|
PGUSER=`kubectl get secrets udi-db-cred -n $N -o jsonpath="{.data.PGUSER}" | base64 --decode`
|
||||||
|
PGSSLMODE=`kubectl get secrets udi-db-cred -n $N -o jsonpath="{.data.PGSSLMODE}" | base64 --decode`
|
||||||
|
PGDATABASE=`kubectl get secrets udi-db-cred -n $N -o jsonpath="{.data.PGDATABASE}" | base64 --decode`
|
||||||
|
export PGUSER PGHOST PGPASSWORD PGSSLMODE PGDATABASE
|
Reference in New Issue
Block a user