-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command entity creation documentation #1551
Conversation
Co-authored-by: Fermín Galán Márquez <[email protected]>
After some tests, command works as expected before. More info here: telefonicaid/fiware-orion#4430 (comment) Nevertheless, it this PR should be changed to include the entity type as URL parameter into the documentation |
Co-authored-by: Fermín Galán Márquez <[email protected]>
For those agents that uses IoTA Node LIB version 3.4.0 or higher, you should consider that the entity is not created | ||
automatically when a device is created. This means that all entities into the Context Broker are created when data | ||
arrives from a device, no matter if the device is explicitly provisioned (via [device provisioning API](#create-device-post-iotdevices)) or autoprovisioned. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should a paragraph explaining what to do if you need the entity in advance? Something like this:
If for any reason you need the entity at CB before the first measure of the corresponding device arrives to the IOTAgent, you can create it in advance using the CB NGSIv2 API.
Please, adapt/improve the text as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 557f75a
doc/api.md
Outdated
|
||
Once the command request is issued to the IoT agent, the command is stored waiting to be retrieved by the device. In that moment, the status of the command is `"<command>_status": "PENDING"`. | ||
|
||
For HTTP devices, in order to retrieve a poll command, the need to make a GET request to the IoT Agent to the path `/iot/json` with the following parameters: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this path hardwired? Or it depends on some parametrization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path depends of the resource definition, but it seems have some issues using a different one that the default (see #1524)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that it works (i.e. assuming that #1524 get fully solved), resource
can be used only at group provisioning? or it is also in the API of device provisioning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking in api.md:
- Group provisioning: includes
resource
- Device provisioning doesn't include
resource
So it seems it can be configured only at group level. @AlvaroVega could you confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking in api.md:
- Group provisioning: includes
resource
- Device provisioning doesn't include
resource
So it seems it can be configured only at group level. @AlvaroVega could you confirm?
Yes it is. But resource is still a leftover in device mongo model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based in the feedback above, I'd suggest the following modification:
For HTTP devices, in order to retrieve a poll command, the need to make a GET request to the IoT Agent to the path `/iot/json` with the following parameters: | |
For HTTP devices, in order to retrieve a poll command, the need to make a GET request to the IoT Agent to the path used as `resource` in the provisioned group (`/iot/json` by default if no `resource` is used) with the following parameters: | |
**FIXME [#1524](https://github.com/telefonicaid/iotagent-node-lib/issues/1524):** `resource` different to `/iot/json` is not working at the present moment, but it will when this issue gets solved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added here 99eb516
doc/api.md
Outdated
{"ping":"Ping request"} | ||
``` | ||
|
||
For IoT Agents different from IoTA-JSON it is exactly the same just changing in the request the resource, `/iot/json` by the corresponding resource employed by the agent (i.e., IoTA-UL uses `/iot/d` as default resource) and setting the correct `<apikey>` and `<deviceId>`. The response will be also different depending on the IoT Agent employed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For IoT Agents different from IoTA-JSON it is exactly the same just changing in the request the resource, `/iot/json` by the corresponding resource employed by the agent (i.e., IoTA-UL uses `/iot/d` as default resource) and setting the correct `<apikey>` and `<deviceId>`. The response will be also different depending on the IoT Agent employed. | |
For IoT Agents different from IoTA-JSON it is exactly the same just changing in the request the resource by the corresponding resource employed by the agent (i.e., IoTA-UL uses `/iot/d` as default resource instead of `/iot/json`) and setting the correct `<apikey>` and `<deviceId>`. The response will be also different depending on the IoT Agent employed. | |
**FIXME [#1524](https://github.com/telefonicaid/iotagent-node-lib/issues/1524)**: `resource` different to `/iot/json` is not working at the present moment, but it will when this issue gets solved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added here 99eb516
Co-authored-by: Fermín Galán Márquez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
telefonicaid/fiware-orion#4430
#1465