Close

REST v4.1 & frontend v3.2 & mesh v2.7

A project log for Internet of Plants (IoP)

Internet of Plants is essentially a mesh-network of plant master and slave controllers for better & less plant care with affordable pricing

Bilal MahmoudBilal Mahmoud 04/12/2017 at 20:040 Comments

So what exactly changed?

To be honest, nothing you can really see. The frontend and mesh-network now support RESTv4, which increased the speed up to 100%.

In other news /responsible/ got removed and / added. The new path now returns a JSON object full of every endpoint and the possible data you can input. That's a quite important and visible addition to the REST-API. /discover now no longer uses a PUT request for execution but rather a POST boolean input called execute. The attribute dict is now also deprecated and should not be used anymore.

Also in the backend of the backend (REST-API), an own input verification system got added, that proves if the correct data got inserted and converts the data if possible and necessary. The new verification system uses the following syntax to gather the data:

{'name': STRING, 'type': TYPE, 'fallback': STRING, 'restricted': [STRING, {'name': STRING, 'fallback': STRING}], 'list': BOOLEAN}
A small explanation:

Also, the select statement now supports chaining. So you can now query for multiple things at once, in just one request. It get's returned as an object, where each item in select is a key. Here's an example:

Example request GET arguments:

?select=created_at,timestamp
Example input verification output:
{"select": ["created_at", "timestamp"]}
Example return output:
{'created_at': DATA, 'timestamp': DATA}

REST v4.2 will remove REST v3 and include a write only test case

Have a nice day

Discussions