private ResourceInstance createResource(String viewName, String instanceName) {
    Map<Resource.Type,String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.View, viewName);
    mapIds.put(Resource.Type.ViewVersion, version);
    mapIds.put(Resource.Type.ViewInstance, instanceName);
    return createResource(type, mapIds);
  }
Create an view instance resource.

@param viewName      view name
@param instanceName  instance name

@return a view instance resource
ambari-server/src/main/java/org/apache/ambari/server/api/services/views/ViewExternalSubResourceService.java