Closed perezmlal closed 5 years ago
I have conducted a similar test.
Create the entity with:
$ curl --request POST \
--url http://localhost:1026/v2/entities \
--header 'Content-Type: application/json' \
--data '{"id": "test_entity001", "type": "T", "example_attr":{"type":"StructuredValue","value":{"exampleField":"whatever"}}}'
Update the entity with:
$ curl --request POST \
--url http://localhost:1026/v2/entities/test_entity001/attrs \
--header 'Content-Type: application/json' \
--data '{"example_attr":{"type":"StructuredValue","value":{"exampleField":"exampleValue"}}}'
Get the entity:
$ curl --request GET \
--url http://localhost:1026/v2/entities/test_entity001
Result is correct:
{"id":"test_entity001","type":"T","example_attr":{"type":"StructuredValue","value":{"exampleField":"exampleValue"},"metadata":{}}}
Note I haven't include fiware-service and fiware-servicepath to make requests simpler, but I will conduct the same tests using them. In the meanwhile, could you conduct a test like mine (i.e. without headers and running CB without -multiservice
) in order to check if you get the same result?
In addition it would be useful to know:
contextBroker --version
provides that information)ps ax | grep contextBroker
provides that information)The exact Orion version you ares using (
contextBroker --version
provides that information)
For the record, mine is: 2.0.0-next (git version: 0d4e4bedf1ac59834087614514ad2bbce7893e96)
Thanks @fgalan I will check if it works running CB without -multiservice.
Currently i run a Orion with the following docker-compose
version: "3.7"
services:
orion:
image: fiware/orion:2.0.0
container_name: orion
restart: always
depends_on:
- mongo-orion
ports:
- "30000:1026"
command: -corsOrigin __ALL -corsMaxAge 600 -dbhost mongo-orion
I confirm that the problem appears when you use the iot-agent service to create a device with commands array like:
{
"devices": [
{
"device_id": "sensor002",
"entity_name": "sensor002",
"entity_type": "TestType",
"transport": "HTTP",
"protocol": "IoTA-JSON",
"endpoint": "http://simulator:3000/iot/test-type/sensor002",
"commands": [
{
"name": "ping",
"type": "command"
}
],
"attributes": [
{
"object_id": "status",
"name": "status",
"type": "Text"
}
],
"static_attributes": [
{
"name": "name",
"type": "Text",
"value": "Sensor 001"
}
]
}
]
}
And then when you add a new attribute of type StructuredValue and you request its value. The value for that attribute is not present.
So I am closing this issue and create a new one with the detailed spec.
Ok. Maybe it would be useful to add the link to the new issue here, for traceability.
Ok. Maybe it would be useful to add the link to the new issue here, for traceability.
STEP 1: Update or append entity with an attribute of type StructuredValue
WHEN: Retrieve an entity by ID test_entity001 or List entities
THEN: The response does not contains the value for the attribute example_attr
UPDATE:
I've deployed the iot stack with docker. These are the used containers:
[other containers not involved in the issue ...]
Documentation consulted: FIWARE-NGSI v2 Specification
GIVEN: A simple entity
WHEN: update or append that entity with an attribute of type StructuredValue
THEN: Retrieve an entity by ID test_entity001 or List entities