coreos / fleet

fleet ties together systemd and etcd into a distributed init system
Apache License 2.0
2.42k stars 302 forks source link

Document possibly missing keys in API response bodies #1184

Open jimmycuadra opened 9 years ago

jimmycuadra commented 9 years ago

It would be very helpful if the API documentation explicitly stated which keys in the JSON responses are always present and which might be missing in certain conditions. For example, a unit may not have a "machineID" key if it isn't loaded onto a node, and while this may be intuitive, it's harder than it could be to write tools using the fleet API without having details like that in the docs.

bcwaldon commented 9 years ago

I agree.

jordan0day commented 9 years ago

This also appears to be the case for top-level resources. If you call /units on a node with no units, rather than getting a response like {"units": []}, you just get {}. The API documentation (and the discovery document) both seem to indicate that a response like {"units": []} is what should be expected.