ResourceInstance createStackServiceComponentResource(
      String stackName, String stackVersion, String serviceName, String componentName) {

    Map<Resource.Type, String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.Stack, stackName);
    mapIds.put(Resource.Type.StackVersion, stackVersion);
    mapIds.put(Resource.Type.StackService, serviceName);
    mapIds.put(Resource.Type.StackServiceComponent, componentName);

    return createResource(Resource.Type.StackServiceComponent, mapIds);
  }
Handles ANY /{stackName}/versions/{stackVersion}/compatible_repository_versions.

@param stackName stack name
@param stackVersion stack version
@return repository version service
ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java