便利ツール
- EdgeやChrome拡張機能の Yet Another REST Client
が便利だった。 - JSON整形・リント - オンライン上のJSON整形・構文チェックツール | Web ToolBox
- jqとcurlをよく使うので、jqは公式HPからダウンロード、curlはbusyboxのもの だと辛いものがあった。
何から始めればよいか?
-
8ページ目
- 14ページ目
ドキュメント
git clone https://github.com/FIWARE/tutorials.Getting-Started.git
cd tutorials.Getting-Started
git checkout NGSI-v2
cd NGSI-v2
tutorials.Getting.Started
./service start
Orionの操作をするにはPostmanを利用します。
通信ポート
- Orion : 1026
- MongoDB : 27017
起動 (Dockerコマンドの場合)
mongoDBの起動
docker run -d \
--name=mongo-db \
--expose=27017 \
mongo:latest --bind_ip_all
Orionの起動
docker run -d \
-p 1026:1026 \
--link mongo-db:mongo-db \
fiware/orion -dbhost mongo-db
# curl で通信確認
curl -X GET 'http://localhost:1026/version'
起動 (docker-composeの場合)
docker-compose.yml
orion:
image: fiware/orion
links:
- mongo
ports:
- 1026:1026
command: -dbhost mongo
mongo:
image: mongo
command: --nojournal
起動
docker-compose up -d
# curl で通信確認
curl -X GET 'http://localhost:1026/version'
postman
-
WEBからAPIをたたける
-
環境変数 {{orion}} の設定
- 応答があることを確認
Control + Enter
で Send
ボタンを押下できる。
MongoDB 管理ツール
mongo-express
docker run -it --rm \
--network fiware_default \
-e ME_CONFIG_MONGODB_SERVER=db-mongo \
-e ME_CONFIG_OPTIONS_READONLY=true \
-e ME_CONFIG_OPTIONS_NO_DELETE=true \
-p 8081:8081 mongo-express
- network名は
docker network ls
を使う。 - MongoDB名は
docker ps | grep -i mongo
で調べられる。
WireCloud
# -e DEBUG=True が必ず必要。謎
docker run -p 8000:8000 -d \
--name wirecloud \
--network fiware_default \
-e DEBUG=True \
fiware/wirecloud
データー形式
"id": "urn:ngsi-ld:Store:001"
"id": "urn:ngsi-ld:Store:002"
のように一意のurn値の必要がある。