There is a method on YARNClient called getNodeReports(). You pass it in a list of node states and it returns a list of NodeReport instances. On NodeReport you can invoke getCapability(). It returns a Resource object from which you can obtain the number of vcores and amount of memory for the node.
I’m looking at the YARNClient for Hadoop 2.2.0 (the HortonWorks 2.0.6 GA release).