-
Notifications
You must be signed in to change notification settings - Fork 55
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
HTTP Swagger #412
base: master
Are you sure you want to change the base?
HTTP Swagger #412
Changes from 11 commits
c0fa899
3e1c1f9
53b15a6
8f66e1a
29983d1
2808c0b
2164dc0
43ed851
2c34c9a
f6a68ee
68b791f
8345090
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
- Add: check response obj before use it handling http commands | ||
- Upgrade NodeJS version from 8.16.1 to 10.17.0 in Dockerfile due to Node 8 End-of-Life | ||
- Add: /api-docs endpoint providing swagger-based documentation of the HTTP southbound interface |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,17 +193,18 @@ Some additional remarks regarding polling commands: | |
MQTT is a machine-to-machine (M2M)/IoT connectivity protocol, focused on a lightweight interaction between peers. MQTT | ||
is based on publish-subscribe mechanisms over a hierarchical set of topics defined by the user. | ||
|
||
This section specifies the topics and messages allowed when using MQTT as the transport protocol for Ultralight 2.0. All | ||
the topics subscribed by the agent (to send measures, to configuration command retrieval or to get result | ||
of a command) are prefixed with the agent procotol: | ||
This section specifies the topics and messages allowed when using MQTT as the transport protocol for Ultralight 2.0. All | ||
the topics subscribed by the agent (to send measures, to configuration command retrieval or to get result of a command) | ||
are prefixed with the agent procotol: | ||
|
||
```text | ||
/ul/<apiKey>/<deviceId> | ||
``` | ||
|
||
where `<apiKey>` is the API Key assigned to the service and `<deviceId>` is the ID of the device. | ||
|
||
All topis published by the agent (to send a comamnd or to send configuration information) to a device are not prefixed | ||
by the protocol, in this case '/ul', just include apikey and deviceid (e.g: `/FF957A98/MydeviceId/cmd` and | ||
All topics published by the agent (to send a comamnd or to send configuration information) to a device are not prefixed | ||
by the protocol, in this case `/ul`, just include apikey and deviceid (e.g: `/FF957A98/MydeviceId/cmd` and | ||
`/FF957A98/MyDeviceId/configuration/values` ). | ||
|
||
This transport protocol binding is still under development. | ||
|
@@ -544,3 +545,15 @@ To ensure consistent Markdown formatting run the following: | |
# Use git-bash on Windows | ||
npm run prettier:text | ||
``` | ||
|
||
### Swagger | ||
|
||
In order to run Swagger, you need to execute the IOT Agent (as explained [here](installationguide.md#usage) and then you | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Travis CI detects the following problem regarding this line:
Please, fix it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in 8345090 |
||
can access to: | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest to add a sentence about which API is being covered by the swagger documentation. Something like this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in 2c34c9a |
||
``` | ||
<server_host>:7896/api-docs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One doubt... IOTA exposes two ports: one corresponding to the "southbound interface" (to which the devices send measures and command responses) and another corresponding to the "nourthbound interface" (in which the IOTA provides the provisioning API, i.e. to create a new device, etc.). Does this /api-docs endpoint work in both ports? Or only in northbound/southbound? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have developed the Swagger documentation only for the HTTP protocol (https://fiware-iotagent-ul.readthedocs.io/en/latest/usermanual/index.html#http-binding), so this version of swagger documentation (1.0.0) works only in southbound. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Northbound is also HTTP-based... However, if /api-docs only works in southbound, fine with it. I just want to confirm how it works ;) Could you confirm? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This documentation has been based on the sending of measurements using exclusively the HTTP protocol, so works in southbound. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in 2164dc0 |
||
``` | ||
|
||
The swagger documentation provided at /api-docs covers the HTTP southbound interface of the agent. The northbound HTTP | ||
interface is not covered. |
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.
I'd suggest to add the following entry to CHANGES_NEXT_RELEASE:
or something similar
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.
fixed in 2808c0b