Open jimmycuadra opened 9 years ago
I agree.
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.
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.