Class NodeResource


  • @Path("/nodes")
    @Produces("application/json")
    public class NodeResource
    extends java.lang.Object
    Resource providing API endpoints for NodeInfo and Node objects.

    Roles defined: HOST_GET

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      uk.co.ractf.polaris.api.node.NodeInfo getHostInfo​(java.lang.String id)
      Gets NodeInfo from the host's id.
      java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.node.NodeInfo> listHostInfo​(java.lang.String filter)
      Return a Map of host to NodeInfo for all hosts matching the host id regex.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NodeResource

        @Inject
        public NodeResource​(ClusterState clusterState)
    • Method Detail

      • listHostInfo

        @GET
        @Timed
        @ExceptionMetered
        @RolesAllowed("ROOT")
        public java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.node.NodeInfo> listHostInfo​(@QueryParam("filter") @DefaultValue("")
                                                                                                        java.lang.String filter)
        Return a Map of host to NodeInfo for all hosts matching the host id regex. Results are only filtered if a filter is not omitted.
        Parameters:
        filter - The regex to filter host ids by
        Returns:
        the matching hosts
      • getHostInfo

        @GET
        @Timed
        @Path("/{id}")
        @ExceptionMetered
        @RolesAllowed("ROOT")
        public uk.co.ractf.polaris.api.node.NodeInfo getHostInfo​(@PathParam("id")
                                                                 java.lang.String id)
        Gets NodeInfo from the host's id.
        Parameters:
        id - host id
        Returns:
        host info