Skip to content

Commit

Permalink
Add type to PATCH for provisioned actuator.
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Jan 18, 2024
1 parent fe9c197 commit 82da78d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions docs/iot-agent-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,11 @@ Effectively the IoT Agent is offering a simplified facade pattern of well-known
Therefore, this section of registering and invoking commands **duplicates** the instructions found in the
[previous tutorial](iot-agent.md)

> **Note:** If the device is provisioned, but no data concerning the Entity is present in the context broker yet, the invocation must
> include the `type` of the Entity to succeed. However if the Entity `type` is already known
> to the broker, this hint
> is not necessary. This is because the registration is matched on both `id` and `type`.

### Ringing the Bell

To invoke the `ring` command, the `ring` attribute must be updated in the context.
Expand All @@ -822,7 +827,7 @@ To invoke the `ring` command, the `ring` attribute must be updated in the contex

```bash
curl -iX PATCH \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Bell:001/attrs' \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Bell:001/attrs?type=Bell' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
Expand All @@ -846,7 +851,7 @@ To invoke the `open` command, the `open` attribute must be updated in the contex

```bash
curl -iX PATCH \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Door:001/attrs' \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Door:001/attrs?type=Door' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
Expand All @@ -866,7 +871,7 @@ To switch on the **Smart Lamp**, the `on` attribute must be updated in the conte

```bash
curl -iX PATCH \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Lamp:001/attrs' \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Lamp:001/attrs?type=Lamp' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
Expand Down
11 changes: 8 additions & 3 deletions docs/iot-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,11 @@ Once the commands have been registered it will be possible to ring the **Bell**,
switch the **Smart Lamp** on and off by sending requests to the Orion Context Broker, rather than sending UltraLight 2.0
requests directly the IoT devices as we did in the [previous tutorial](iot-sensors.md).

> **Note:** If the device is provisioned, but no data concerning the Entity is present in the context broker yet, the invocation must
> include the `type` of the Entity to succeed. However if the Entity `type` is already known
> to the broker, this hint
> is not necessary. This is because the registration is matched on both `id` and `type`.

### Ringing the Bell

To invoke the `ring` command, the `ring` attribute must be updated in the context.
Expand All @@ -851,7 +856,7 @@ To invoke the `ring` command, the `ring` attribute must be updated in the contex

```bash
curl -iX PATCH \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Bell:001/attrs' \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Bell:001/attrs?type=Bell' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
Expand All @@ -875,7 +880,7 @@ To invoke the `open` command, the `open` attribute must be updated in the contex

```bash
curl -iX PATCH \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Door:001/attrs' \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Door:001/attrs?type=Door' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
Expand All @@ -895,7 +900,7 @@ To switch on the **Smart Lamp**, the `on` attribute must be updated in the conte

```bash
curl -iX PATCH \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Lamp:001/attrs' \
'http://localhost:1026/v2/entities/urn:ngsi-ld:Lamp:001/attrs?type=Lamp' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
Expand Down

0 comments on commit 82da78d

Please sign in to comment.