(bind-func fleet_set_unit_state
(let ((url:i8* (zalloc 256)))
(lambda (host:i8* port:i32 unit_name:i8* unit:json_t*)
(sprintf url "http://%s:%d/%s/units/%s" host port FLEET_API_VERSION unit_name)
(let ((response (ghttp_request_body_as_json (ghttp_perform_PUT url unit))))
(if (not (fleet_response_error_p response #t))
(println "Fleet: successfully modified unit"))
(json_decref response)))))