Skip to content
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

Merged
merged 26 commits into from
Jul 31, 2024

Conversation

mapedraza
Copy link
Collaborator

doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
@mapedraza
Copy link
Collaborator Author

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

doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Show resolved Hide resolved
doc/api.md Show resolved Hide resolved
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.

Copy link
Member

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.

Copy link
Collaborator Author

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 Show resolved Hide resolved
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:
Copy link
Member

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?

Copy link
Collaborator Author

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)

Copy link
Member

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking in api.md:

So it seems it can be configured only at group level. @AlvaroVega could you confirm?

Copy link
Member

@AlvaroVega AlvaroVega Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking in api.md:

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.

Copy link
Member

@fgalan fgalan Jul 30, 2024

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:

Suggested change
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.

Copy link
Collaborator Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Collaborator Author

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 Show resolved Hide resolved
mapedraza and others added 5 commits July 30, 2024 15:58
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
doc/api.md Show resolved Hide resolved
Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlvaroVega
Copy link
Member

LGTM

@AlvaroVega AlvaroVega merged commit 46ac1d8 into master Jul 31, 2024
8 checks passed
@AlvaroVega AlvaroVega deleted the task/add-command-entity-provision branch July 31, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants