Skip to content

Commit 9a11156

Browse files
committed
Update Requests to use pick and format
1 parent 2cfddf8 commit 9a11156

File tree

2 files changed

+54
-28
lines changed

2 files changed

+54
-28
lines changed

README.ja.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ NGSI-LD [仕様](https://cim.etsi.org/NGSI-LD/official/front-page.html) では
613613
#### 3️⃣ リクエスト:
614614
615615
```console
616-
curl -L -X POST 'http://localhost:4041/iot/devices' \
616+
curl -L -X POST \
617+
'http://localhost:4041/iot/devices' \
617618
-H 'fiware-service: openiot' \
618619
-H 'fiware-servicepath: /' \
619620
-H 'Content-Type: application/json' \
@@ -682,7 +683,8 @@ curl -L -X POST 'http://localhost:4041/iot/devices' \
682683
#### 4️⃣ リクエスト:
683684

684685
```console
685-
curl -L -X POST 'http://localhost:7896/iot/json?k=4jggokgpepnvsb2uv4s40d59ov&i=temperature001' \
686+
curl -L -X POST \
687+
'http://localhost:7896/iot/json?k=4jggokgpepnvsb2uv4s40d59ov&i=temperature001' \
686688
-H 'Content-Type: application/json' \
687689
--data-raw '{ "t": 3}'
688690
```
@@ -703,11 +705,12 @@ Context Broker からエンティティのデータを取得することで、
703705
#### 5️⃣ リクエスト:
704706

705707
```console
706-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:temperature001' \
708+
curl -G -iX GET \
709+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:temperature001' \
707710
-H 'NGSILD-Tenant: openiot' \
708711
-H 'Accept: application/ld+json' \
709712
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
710-
-d 'attrs=temperature'
713+
-d 'pick=id,type,temperature'
711714
```
712715

713716
#### レスポンス:
@@ -755,7 +758,8 @@ curl -iX POST 'http://localhost:7896/iot/json?k=4jggokgpepnvsb2uv4s40d59ov&i=mot
755758
#### 7️⃣ リクエスト:
756759

757760
```console
758-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/?type=Device' \
761+
curl -L -X GET \
762+
'http://localhost:1026/ngsi-ld/v1/entities/?type=Device' \
759763
-H 'NGSILD-Tenant: openiot' \
760764
-H 'Accept: application/ld+json' \
761765
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
@@ -806,7 +810,8 @@ curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/?type=Device' \
806810
#### 8️⃣ リクエスト:
807811

808812
```console
809-
curl -L -X POST 'http://localhost:4041/iot/devices' \
813+
curl -L -X POST \
814+
'http://localhost:4041/iot/devices' \
810815
-H 'fiware-service: openiot' \
811816
-H 'fiware-servicepath: /' \
812817
-H 'Content-Type: application/json' \
@@ -845,7 +850,8 @@ Broker によって最終的に呼び出されます。設定をテストする
845850
#### 9️⃣ リクエスト:
846851

847852
```console
848-
curl -L -X PATCH 'http://localhost:4041/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
853+
curl -L -X PATCH \
854+
'http://localhost:4041/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
849855
-H 'fiware-service: openiot' \
850856
-H 'fiware-servicepath: /' \
851857
-H 'Content-Type: application/json' \
@@ -867,7 +873,8 @@ Irrigation system をオンにするコマンドの結果は、Context Broker
867873
#### 1️⃣0️⃣ リクエスト:
868874

869875
```console
870-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001' \
876+
curl -L -X GET \
877+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001' \
871878
-H 'NGSILD-Tenant: openiot' \
872879
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
873880
-H 'Accept: application/json'
@@ -916,7 +923,8 @@ curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:wat
916923
#### 1️⃣1️⃣ リクエスト:
917924

918925
```console
919-
curl -L -X POST 'http://localhost:4041/iot/devices' \
926+
curl -L -X POST \
927+
'http://localhost:4041/iot/devices' \
920928
-H 'fiware-service: openiot' \
921929
-H 'fiware-servicepath: /' \
922930
-H 'Content-Type: application/json' \
@@ -974,7 +982,8 @@ curl -L -X POST 'http://localhost:4041/iot/devices' \
974982
#### 1️⃣2️⃣ リクエスト:
975983

976984
```console
977-
curl -L -X POST 'http://localhost:4041/iot/devices' \
985+
curl -L -X POST \
986+
'http://localhost:4041/iot/devices' \
978987
-H 'fiware-service: openiot' \
979988
-H 'fiware-servicepath: /' \
980989
-H 'Content-Type: application/json' \
@@ -1008,7 +1017,8 @@ Tractor からの測定値 (例: `gps`) は、サービス・グループ内で
10081017
#### 1️⃣3️⃣ リクエスト:
10091018

10101019
```console
1011-
curl -L -X GET 'http://localhost:4041/iot/devices' \
1020+
curl -L -X GET \
1021+
'http://localhost:4041/iot/devices' \
10121022
-H 'fiware-service: openiot' \
10131023
-H 'fiware-servicepath: /'
10141024
```
@@ -1035,7 +1045,8 @@ IoT Agent を IoT デバイスに接続すると、Orion Context Broker にコ
10351045
#### 1️⃣4️⃣ リクエスト:
10361046

10371047
```console
1038-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
1048+
curl -L -X PATCH \
1049+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
10391050
-H 'NGSILD-Tenant: openiot' \
10401051
-H 'Content-Type: application/json' \
10411052
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
@@ -1060,7 +1071,8 @@ curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:w
10601071
#### 1️⃣5️⃣ リクエスト:
10611072

10621073
```console
1063-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:tractor001/attrs/start' \
1074+
curl -L -X PATCH \
1075+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:tractor001/attrs/start' \
10641076
-H 'NGSILD-Tenant: openiot' \
10651077
-H 'Content-Type: application/json' \
10661078
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
@@ -1081,7 +1093,8 @@ curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:t
10811093
#### 1️⃣6️⃣ リクエスト:
10821094

10831095
```console
1084-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:filling001/attrs/add' \
1096+
curl -L -X PATCH \
1097+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:filling001/attrs/add' \
10851098
-H 'NGSILD-Tenant: openiot' \
10861099
-H 'Content-Type: application/json' \
10871100
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \

README.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@ Three types of measurement attributes can be provisioned:
609609
#### 3️⃣ Request:
610610

611611
```console
612-
curl -L -X POST 'http://localhost:4041/iot/devices' \
612+
curl -L -X POST \
613+
'http://localhost:4041/iot/devices' \
613614
-H 'fiware-service: openiot' \
614615
-H 'fiware-servicepath: /' \
615616
-H 'Content-Type: application/json' \
@@ -678,7 +679,8 @@ making the following request
678679
#### 4️⃣ Request:
679680

680681
```console
681-
curl -L -X POST 'http://localhost:7896/iot/json?k=4jggokgpepnvsb2uv4s40d59ov&i=temperature001' \
682+
curl -L -X POST \
683+
'http://localhost:7896/iot/json?k=4jggokgpepnvsb2uv4s40d59ov&i=temperature001' \
682684
-H 'Content-Type: application/json' \
683685
--data-raw '{ "t": 3}'
684686
```
@@ -700,11 +702,12 @@ add the `fiware-service` and `fiware-service-path` headers.
700702
#### 5️⃣ Request:
701703

702704
```console
703-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:temperature001' \
705+
curl -G -iX GET \
706+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:temperature001' \
704707
-H 'NGSILD-Tenant: openiot' \
705708
-H 'Accept: application/ld+json' \
706709
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
707-
-d 'attrs=temperature'
710+
-d 'pick=id,type,temperature'
708711
```
709712

710713
#### Response:
@@ -754,7 +757,8 @@ based on the knowledge of the service group
754757
#### 7️⃣ Request:
755758

756759
```console
757-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/?type=Device' \
760+
curl -L -X GET \
761+
'http://localhost:1026/ngsi-ld/v1/entities/?type=Device' \
758762
-H 'NGSILD-Tenant: openiot' \
759763
-H 'Accept: application/ld+json' \
760764
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
@@ -805,7 +809,8 @@ communications protocol to be used.
805809
#### 8️⃣ Request:
806810

807811
```console
808-
curl -L -X POST 'http://localhost:4041/iot/devices' \
812+
curl -L -X POST \
813+
'http://localhost:4041/iot/devices' \
809814
-H 'fiware-service: openiot' \
810815
-H 'fiware-servicepath: /' \
811816
-H 'Content-Type: application/json' \
@@ -846,7 +851,8 @@ command directly as shown:
846851
#### 9️⃣ Request:
847852

848853
```console
849-
curl -L -X PATCH 'http://localhost:4041/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
854+
curl -L -X PATCH \
855+
'http://localhost:4041/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
850856
-H 'fiware-service: openiot' \
851857
-H 'fiware-servicepath: /' \
852858
-H 'Content-Type: application/json' \
@@ -867,7 +873,8 @@ The result of the command to turn on the irrigation system can be read by queryi
867873
#### 1️⃣0️⃣ Request:
868874

869875
```console
870-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001' \
876+
curl -L -X GET \
877+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001' \
871878
-H 'NGSILD-Tenant: openiot' \
872879
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
873880
-H 'Accept: application/json'
@@ -914,7 +921,8 @@ both `attributes` and `command` attributes in the body of the request.
914921
#### 1️⃣1️⃣ Request:
915922

916923
```console
917-
curl -L -X POST 'http://localhost:4041/iot/devices' \
924+
curl -L -X POST \
925+
'http://localhost:4041/iot/devices' \
918926
-H 'fiware-service: openiot' \
919927
-H 'fiware-servicepath: /' \
920928
-H 'Content-Type: application/json' \
@@ -970,7 +978,8 @@ Similarly, a **Tractor** with two commands (`start` and `stop`) and two attribut
970978
#### 1️⃣2️⃣ Request:
971979

972980
```console
973-
curl -L -X POST 'http://localhost:4041/iot/devices' \
981+
curl -L -X POST \
982+
'http://localhost:4041/iot/devices' \
974983
-H 'fiware-service: openiot' \
975984
-H 'fiware-servicepath: /' \
976985
-H 'Content-Type: application/json' \
@@ -1005,7 +1014,8 @@ The full list of provisioned devices can be obtained by making a GET request to
10051014
#### 1️⃣3️⃣ Request:
10061015

10071016
```console
1008-
curl -L -X GET 'http://localhost:4041/iot/devices' \
1017+
curl -L -X GET \
1018+
'http://localhost:4041/iot/devices' \
10091019
-H 'fiware-service: openiot' \
10101020
-H 'fiware-servicepath: /'
10111021
```
@@ -1028,7 +1038,8 @@ To invoke the `on` command, the `on` attribute must be updated in the context.
10281038
#### 1️⃣4️⃣ Request:
10291039

10301040
```console
1031-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
1041+
curl -L -X PATCH \
1042+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
10321043
-H 'NGSILD-Tenant: openiot' \
10331044
-H 'Content-Type: application/json' \
10341045
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
@@ -1051,7 +1062,8 @@ To invoke the `start` command, the `start` attribute must be updated in the cont
10511062
#### 1️⃣5️⃣ Request:
10521063

10531064
```console
1054-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:tractor001/attrs/start' \
1065+
curl -L -X PATCH \
1066+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:tractor001/attrs/start' \
10551067
-H 'NGSILD-Tenant: openiot' \
10561068
-H 'Content-Type: application/json' \
10571069
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
@@ -1070,7 +1082,8 @@ Change the state of the **Fillling System**, the `add` attribute must be updated
10701082
#### 1️⃣6️⃣ Request:
10711083

10721084
```console
1073-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:filling001/attrs/add' \
1085+
curl -L -X PATCH \
1086+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:filling001/attrs/add' \
10741087
-H 'NGSILD-Tenant: openiot' \
10751088
-H 'Content-Type: application/json' \
10761089
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \

0 commit comments

Comments
 (0)