@Path("{resourceName}")
  public Object getResource(@PathParam("resourceName") String resourceName) throws IOException {

    Object service = resourceServiceMap.get(resourceName);
    if (service == null) {
      throw new IllegalArgumentException("A resource type " + resourceName + " for view instance " +
          viewName + "/" + instanceName + " can not be found.");
    }

    return service;
  }
Handles: GET /resources/{resourceName} Get a specific external resource.

@param resourceName  resource name

@return resource service instance representation

@throws IllegalArgumentException if the given resource name is unknown
ambari-server/src/main/java/org/apache/ambari/server/api/services/views/ViewExternalSubResourceService.java