Added Resources support to return the port range for the given number of ports.

Review: https://reviews.apache.org/r/24810