(bind-func fleet_get_state
"get state of all units: see fleet_get_state_for_unit to get the state of a specific unit"
(let ((url:i8* (zalloc 256)))
(lambda (host:i8* port:i32)
(sprintf url "http://%s:%d/%s/state" host port FLEET_API_VERSION)
(let ((response (json_object_get (ghttp_request_body_as_json (ghttp_perform_GET url)) "states")))
(if (fleet_response_error_p response #t)
null
response)))))