The above API will fail because ZOOKEEPER is not the name of a host component. It should either be ZOOKEEPER_CLIENT or ZOOKEEPEER_SERVER. On the trunk build I get a NoSuchResourceException when using ZOOKEEPER as the component name. With the correct component name, the API succeeded.
The API to install the ZOOKEEPER service was successful: