private String getBaseurl(String url) {
    int index = url.indexOf(API_PREFIX);
    return url.substring(0, index);
  }
Get baseurl of the cluster
baseurl wil be http://host:port

@param url will be in format like http://host:port/api/v1/clusters/clusterName
@return baseurl
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java