Skip to content

Commit

Permalink
replace compatibility table with a more readable version
Browse files Browse the repository at this point in the history
A html table offers better control over the widths, and allows using multi line code blocks. The previous table was too wide to be rendered without the topics being broken over multiple lines.

More notably, the commands section was removed as this was never a public API, so I would avoid the effort going into detail about it.

Signed-off-by: Reuben Miller <[email protected]>
  • Loading branch information
reubenmiller committed Jul 14, 2023
1 parent f0e09b7 commit 51bae82
Showing 1 changed file with 172 additions and 21 deletions.
193 changes: 172 additions & 21 deletions docs/src/references/mqtt-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,24 +676,175 @@ The compatibility layer would be deactivated via configuration after all entitie

Below details some examples showing the mapping between the legacy and new topics:

|Legacy topic|New topic|New payload|
|------------|---------|-----|
| **Telemetry** |
| **_Main device_** |
|`tedge/measurements`|`tedge/device/main///m/ThinEdgeMeasurement`| Same |
|`tedge/events/<type>`|`tedge/device/main///e/<type>`| Same |
|`tedge/alarms/<severity>/<type>`|`tedge/device/main///a/<type>`| `{ "severity": <severity>, ...same }` |
| **_Child device_** |
|`tedge/measurements/<child-id>`|`tedge/device/<child-id>///m/ThinEdgeMeasurement`| Same |
|`tedge/events/<type>/<child-id>`|`tedge/device/<child-id>///e/<type>`| Same |
|`tedge/alarms/<severity>/<type>/<child-id>`|`tedge/device/<child-id>///a/<type>`|`{ "severity": <severity>, ...same }`|
| **Commands** |
| **_Main device_** |
|`tedge/commands/req/software/list`|`tedge/device/main///cmd/software_list`| `{ "status": "init", ...same }` |
|`tedge/commands/res/software/list`|`tedge/device/main///cmd/software_list`| Same |
|`tedge/commands/req/control/restart`|`tedge/device/main///cmd/restart`| `{ "status": "init", ...same }` |
| **_Child device_** |
|`tedge/commands/<child-id>/req/config_snapshot`|`tedge/device/<child-id>///cmd/config_snapshot`| `{ "status": "init", ...same }` |
|`tedge/commands/<child-id>/res/config_snapshot`|`tedge/device/<child-id>///cmd/config_snapshot`| Same |
|`tedge/commands/<child-id>/req/config_update`|`tedge/device/<child-id>///cmd/config_update`| `{ "status": "init", ...same }` |
|`tedge/commands/<child-id>/res/config_update`|`tedge/device/<child-id>///cmd/config_update`| Same |
### Telemetry: Main device

<table style={{width:'100%'}}>
<tr>
<th>Type</th>
<th>Topic</th>
<th>Payload Changes</th>
</tr>

<!-- Measurements -->
<tr>
<td>Measurements</td>
<td>
<p>Legacy</p>

```sh
tedge/measurements
```

<p>New</p>

```sh
te/device/main///m/<type>
```

</td>
<td>
No Change
</td>
</tr>

<!-- Events -->
<tr>
<td>Events</td>
<td>
<p>Legacy</p>

```sh
tedge/events/<type>
```

<p>New</p>

```sh
te/device/main///e/<type>
```

</td>
<td>
No Change
</td>
</tr>

<!-- Alarms -->
<tr>
<td>Alarms</td>
<td>
<p>Legacy</p>

```sh
tedge/alarms/<severity>/<type>
```

<p>New</p>

```sh
te/device/main///a/<type>
```

</td>
<td>

The alarm severity should be set in the payload.

```json
{
"severity": "<severity>"
// ...
}
```

</td>
</tr>

</table>


### Telemetry: Child device

<table style={{width:'100%'}}>
<tr>
<th>Type</th>
<th>Topic</th>
<th>Payload Changes</th>
</tr>

<!-- Measurements -->
<tr>
<td>Measurements</td>
<td>
<p>Legacy</p>

```sh
tedge/measurements/<child_id>
```

<p>New</p>

```sh
te/device/<child_id>///m/<type>
```

</td>
<td>
No Change
</td>
</tr>

<!-- Events -->
<tr>
<td>Events</td>
<td>
<p>Legacy</p>

```sh
tedge/events/<type>/<child_id>
```

<p>New</p>

```sh
te/device/<child_id>///e/<type>
```

</td>
<td>
No Change
</td>
</tr>

<!-- Alarms -->
<tr>
<td>Alarms</td>
<td>
<p>Legacy</p>

```sh
tedge/alarms/<severity>/<type>/<child_id>
```

<p>New</p>

```sh
te/device/<child_id>///a/<type>
```

</td>
<td>

The alarm severity should be set in the payload.

```json
{
"severity": "<severity>"
// ...
}
```

</td>
</tr>

</table>

0 comments on commit 51bae82

Please sign in to comment.