From 82da78d7bb473767ae99f10d80a5b12e8befb03f Mon Sep 17 00:00:00 2001 From: Jason Fox Date: Thu, 18 Jan 2024 17:27:12 +0100 Subject: [PATCH] Add type to PATCH for provisioned actuator. --- docs/iot-agent-json.md | 11 ++++++++--- docs/iot-agent.md | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/iot-agent-json.md b/docs/iot-agent-json.md index d9fb15e..00682d0 100644 --- a/docs/iot-agent-json.md +++ b/docs/iot-agent-json.md @@ -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. @@ -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: /' \ @@ -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: /' \ @@ -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: /' \ diff --git a/docs/iot-agent.md b/docs/iot-agent.md index 2e4abc8..76bf02b 100644 --- a/docs/iot-agent.md +++ b/docs/iot-agent.md @@ -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. @@ -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: /' \ @@ -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: /' \ @@ -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: /' \