Is there some way to get my Hadoop cluster information programatically?
You can use Java API: https://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#getStatus()
The protocol to get this information from a namenode uses Google Protobuf.