public static int getClusterControllerIndex(ConfigId configId) {
        Matcher matcher = CONTROLLER_INDEX_PATTERN.matcher(configId.s());
        if (!matcher.matches()) {
            throw new IllegalArgumentException("Unable to extract cluster controller index from config ID " + configId);
        }

        return Integer.parseInt(matcher.group(1));
    }
@param configId  Must be of the form admin/cluster-controllers/2 or NAME/standalone/NAME-controllers/2,
                 where NAME is the name of the content cluster.  NAME-controllers is also the cluster ID of
                 the cluster controller cluster.
@return the Cluster Controller index given its config ID.
@throws java.lang.IllegalArgumentException if the config ID is not of the proper format.
orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java