FIWARE Orion 订阅 Node Red 插件

问题描述

我正在尝试使用 Orion Context broker 和 Node-Red 插件创建订阅。 我想创建自定义节点红色插件以适合我的用例。是否有任何用于订阅的示例 Node-Red 插件开发存储库?我必须使用 ngsi-proxy 还是直接从 Orion 获取结果?

我的订阅条款如下:

alias util='kubectl get nodes --no-headers | awk '\''{print $1}'\'' | xargs -I {} sh -c '\''echo {} ; kubectl describe node {} | grep Allocated -A 5 | grep -ve Event -ve Allocated -ve percent -ve -- ; echo '\'''

# Get cpu request total (we x20 because because each m3.large has 2 vcpus (2000m) )
alias cpualloc='util | grep % | awk '\''{print $1}'\'' | awk '\''{ sum += $1 } END { if (NR > 0) { print sum/(NR*20),"%\n" } }'\'''

# Get mem request total (we x75 because because each m3.large has 7.5G ram )
alias memalloc='util | grep % | awk '\''{print $5}'\'' | awk '\''{ sum += $1 } END { if (NR > 0) { print sum/(NR*75),"%\n" } }'\'''

解决方法

似乎有一些与 NGSIv2 相关的 Node Red 内容。你可以看看https://flows.nodered.org/node/node-red-contrib-fiware_official