Skip to content

Commit e886cad

Browse files
committed
Update Requests to use pick and format
1 parent 06ef9e2 commit e886cad

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 [specification](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/d?k=4jggokgpepnvsb2uv4s40d59ov&i=temperature001' \
686+
curl -L -X POST \
687+
'http://localhost:7896/iot/d?k=4jggokgpepnvsb2uv4s40d59ov&i=temperature001' \
686688
-H 'Content-Type: text/plain' \
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
#### レスポンス:
@@ -757,7 +760,8 @@ curl -iX POST 'http://localhost:7896/iot/d?k=4jggokgpepnvsb2uv4s40d59ov&i=motion
757760
#### 7️⃣ リクエスト:
758761

759762
```console
760-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/?type=Device' \
763+
curl -L -X GET \
764+
'http://localhost:1026/ngsi-ld/v1/entities/?type=Device' \
761765
-H 'NGSILD-Tenant: openiot' \
762766
-H 'Accept: application/ld+json' \
763767
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
@@ -809,7 +813,8 @@ UltraLight コマンドを送信する必要がある場所を保持し、`comma
809813
#### 8️⃣ リクエスト:
810814

811815
```console
812-
curl -L -X POST 'http://localhost:4041/iot/devices' \
816+
curl -L -X POST \
817+
'http://localhost:4041/iot/devices' \
813818
-H 'fiware-service: openiot' \
814819
-H 'fiware-servicepath: /' \
815820
-H 'Content-Type: application/json' \
@@ -850,7 +855,8 @@ Context Broker によって呼び出されるのはこのエンドポイント
850855
#### 9️⃣ リクエスト:
851856

852857
```console
853-
curl -L -X PATCH 'http://localhost:4041/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
858+
curl -L -X PATCH \
859+
'http://localhost:4041/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
854860
-H 'fiware-service: openiot' \
855861
-H 'fiware-servicepath: /' \
856862
-H 'Content-Type: application/json' \
@@ -871,7 +877,8 @@ Water sprinkler をオンにするコマンドの結果は、Context Broker 内
871877
#### 1️⃣0️⃣ リクエスト:
872878

873879
```console
874-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001' \
880+
curl -L -X GET \
881+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001' \
875882
-H 'NGSILD-Tenant: openiot' \
876883
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
877884
-H 'Accept: application/json'
@@ -920,7 +927,8 @@ curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:wat
920927
#### 1️⃣1️⃣ リクエスト:
921928

922929
```console
923-
curl -L -X POST 'http://localhost:4041/iot/devices' \
930+
curl -L -X POST \
931+
'http://localhost:4041/iot/devices' \
924932
-H 'fiware-service: openiot' \
925933
-H 'fiware-servicepath: /' \
926934
-H 'Content-Type: application/json' \
@@ -979,7 +987,8 @@ curl -L -X POST 'http://localhost:4041/iot/devices' \
979987
#### 1️⃣2️⃣ リクエスト:
980988

981989
```console
982-
curl -L -X POST 'http://localhost:4041/iot/devices' \
990+
curl -L -X POST \
991+
'http://localhost:4041/iot/devices' \
983992
-H 'fiware-service: openiot' \
984993
-H 'fiware-servicepath: /' \
985994
-H 'Content-Type: application/json' \
@@ -1014,7 +1023,8 @@ curl -L -X POST 'http://localhost:4041/iot/devices' \
10141023
#### 1️⃣3️⃣ リクエスト:
10151024

10161025
```console
1017-
curl -L -X GET 'http://localhost:4041/iot/devices' \
1026+
curl -L -X GET \
1027+
'http://localhost:4041/iot/devices' \
10181028
-H 'fiware-service: openiot' \
10191029
-H 'fiware-servicepath: /'
10201030
```
@@ -1041,7 +1051,8 @@ IoT Agent を IoT デバイスに接続すると、Orion Context Broker にコ
10411051
#### 1️⃣4️⃣ リクエスト:
10421052

10431053
```console
1044-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
1054+
curl -L -X PATCH \
1055+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
10451056
-H 'NGSILD-Tenant: openiot' \
10461057
-H 'Content-Type: application/json' \
10471058
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
@@ -1066,7 +1077,8 @@ curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:w
10661077
#### 1️⃣5️⃣ リクエスト:
10671078

10681079
```console
1069-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:tractor001/attrs/start' \
1080+
curl -L -X PATCH \
1081+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:tractor001/attrs/start' \
10701082
-H 'NGSILD-Tenant: openiot' \
10711083
-H 'Content-Type: application/json' \
10721084
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
@@ -1087,7 +1099,8 @@ curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:t
10871099
#### 1️⃣6️⃣ リクエスト:
10881100

10891101
```console
1090-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:filling001/attrs/add' \
1102+
curl -L -X PATCH \
1103+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:filling001/attrs/add' \
10911104
-H 'NGSILD-Tenant: openiot' \
10921105
-H 'Content-Type: application/json' \
10931106
-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
@@ -598,7 +598,8 @@ Three types of measurement attributes can be provisioned:
598598
#### 3️⃣ Request:
599599

600600
```console
601-
curl -L -X POST 'http://localhost:4041/iot/devices' \
601+
curl -L -X POST \
602+
'http://localhost:4041/iot/devices' \
602603
-H 'fiware-service: openiot' \
603604
-H 'fiware-servicepath: /' \
604605
-H 'Content-Type: application/json' \
@@ -667,7 +668,8 @@ making the following request
667668
#### 4️⃣ Request:
668669

669670
```console
670-
curl -L -X POST 'http://localhost:7896/iot/d?k=4jggokgpepnvsb2uv4s40d59ov&i=temperature001' \
671+
curl -L -X POST \
672+
'http://localhost:7896/iot/d?k=4jggokgpepnvsb2uv4s40d59ov&i=temperature001' \
671673
-H 'Content-Type: text/plain' \
672674
--data-raw 't|3'
673675
```
@@ -689,11 +691,12 @@ add the `fiware-service` and `fiware-service-path` headers.
689691
#### 5️⃣ Request:
690692

691693
```console
692-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:temperature001' \
694+
curl -G -iX GET \
695+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:temperature001' \
693696
-H 'NGSILD-Tenant: openiot' \
694697
-H 'Accept: application/ld+json' \
695698
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
696-
-d 'attrs=temperature'
699+
-d 'pick=id,type,temperature'
697700
```
698701

699702
#### Response:
@@ -743,7 +746,8 @@ based on the knowledge of the service group
743746
#### 7️⃣ Request:
744747

745748
```console
746-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/?type=Device' \
749+
curl -L -X GET \
750+
'http://localhost:1026/ngsi-ld/v1/entities/?type=Device' \
747751
-H 'NGSILD-Tenant: openiot' \
748752
-H 'Accept: application/ld+json' \
749753
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
@@ -794,7 +798,8 @@ communications protocol to be used.
794798
#### 8️⃣ Request:
795799

796800
```console
797-
curl -L -X POST 'http://localhost:4041/iot/devices' \
801+
curl -L -X POST \
802+
'http://localhost:4041/iot/devices' \
798803
-H 'fiware-service: openiot' \
799804
-H 'fiware-servicepath: /' \
800805
-H 'Content-Type: application/json' \
@@ -835,7 +840,8 @@ command directly as shown:
835840
#### 9️⃣ Request:
836841

837842
```console
838-
curl -L -X PATCH 'http://localhost:4041/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
843+
curl -L -X PATCH \
844+
'http://localhost:4041/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
839845
-H 'fiware-service: openiot' \
840846
-H 'fiware-servicepath: /' \
841847
-H 'Content-Type: application/json' \
@@ -856,7 +862,8 @@ The result of the command to turn on the irrigation system can be read by queryi
856862
#### 1️⃣0️⃣ Request:
857863

858864
```console
859-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001' \
865+
curl -L -X GET \
866+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001' \
860867
-H 'NGSILD-Tenant: openiot' \
861868
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
862869
-H 'Accept: application/json'
@@ -903,7 +910,8 @@ both `attributes` and `command` attributes in the body of the request.
903910
#### 1️⃣1️⃣ Request:
904911

905912
```console
906-
curl -L -X POST 'http://localhost:4041/iot/devices' \
913+
curl -L -X POST \
914+
'http://localhost:4041/iot/devices' \
907915
-H 'fiware-service: openiot' \
908916
-H 'fiware-servicepath: /' \
909917
-H 'Content-Type: application/json' \
@@ -959,7 +967,8 @@ Similarly, a **Tractor** with two commands (`start` and `stop`) and two attribut
959967
#### 1️⃣2️⃣ Request:
960968

961969
```console
962-
curl -L -X POST 'http://localhost:4041/iot/devices' \
970+
curl -L -X POST \
971+
'http://localhost:4041/iot/devices' \
963972
-H 'fiware-service: openiot' \
964973
-H 'fiware-servicepath: /' \
965974
-H 'Content-Type: application/json' \
@@ -994,7 +1003,8 @@ The full list of provisioned devices can be obtained by making a GET request to
9941003
#### 1️⃣3️⃣ Request:
9951004

9961005
```console
997-
curl -L -X GET 'http://localhost:4041/iot/devices' \
1006+
curl -L -X GET \
1007+
'http://localhost:4041/iot/devices' \
9981008
-H 'fiware-service: openiot' \
9991009
-H 'fiware-servicepath: /'
10001010
```
@@ -1017,7 +1027,8 @@ To invoke the `on` command, the `on` attribute must be updated in the context.
10171027
#### 1️⃣4️⃣ Request:
10181028

10191029
```console
1020-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
1030+
curl -L -X PATCH \
1031+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:water001/attrs/on' \
10211032
-H 'NGSILD-Tenant: openiot' \
10221033
-H 'Content-Type: application/json' \
10231034
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
@@ -1040,7 +1051,8 @@ To invoke the `start` command, the `start` attribute must be updated in the cont
10401051
#### 1️⃣5️⃣ Request:
10411052

10421053
```console
1043-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:tractor001/attrs/start' \
1054+
curl -L -X PATCH \
1055+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:tractor001/attrs/start' \
10441056
-H 'NGSILD-Tenant: openiot' \
10451057
-H 'Content-Type: application/json' \
10461058
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
@@ -1059,7 +1071,8 @@ Change the state of the **Fillling System**, the `add` attribute must be updated
10591071
#### 1️⃣6️⃣ Request:
10601072

10611073
```console
1062-
curl -L -X PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:filling001/attrs/add' \
1074+
curl -L -X PATCH \
1075+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Device:filling001/attrs/add' \
10631076
-H 'NGSILD-Tenant: openiot' \
10641077
-H 'Content-Type: application/json' \
10651078
-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)