@Path("{instanceName}/{resources}")
  public Object getResourceHandler(@Context jakarta.ws.rs.core.Request request,
                                   @PathParam("viewName") String viewName, @PathParam("version") String version,
                                   @PathParam("instanceName") String instanceName,
                                   @PathParam("resources") String resources) {

    hasPermission(viewName, version, Request.Type.valueOf(request.getMethod()), instanceName);

    ViewInstanceEntity instanceDefinition =
        ViewRegistry.getInstance().getInstanceDefinition(viewName, version, instanceName);

    if (instanceDefinition == null) {
      String msg = "A view instance " +
          viewName + "/" + instanceName + " can not be found.";

      return new NotFoundResponse(msg);
    }

    Object service = instanceDefinition.getService(resources);

    if (service == null) {
      String msg = "A resource type " + resources + " for view instance " +
          viewName + "/" + instanceName + " can not be found.";
      return new NotFoundResponse(msg);
    }
    return service;
  }
Get the sub-resource

@param instanceName  the instance id

@return the service
ambari-server/src/main/java/org/apache/ambari/server/api/services/views/ViewInstanceService.java