ResourceInstance createExtensionLinkResource(String stackName, String stackVersion,
                                  String extensionName, String extensionVersion) {
    Map<Resource.Type, String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.Stack, stackName);
    mapIds.put(Resource.Type.StackVersion, stackVersion);
    mapIds.put(Resource.Type.Extension, extensionName);
    mapIds.put(Resource.Type.ExtensionVersion, extensionVersion);

    return createResource(Resource.Type.ExtensionLink, mapIds);
  }
Service for extensions management.

An extension version is like a stack version but it contains custom services.  Linking an extension
version to the current stack version allows the cluster to install the custom services contained in
the extension version.
ambari-server/src/main/java/org/apache/ambari/server/api/services/ExtensionsService.java