Class HardwareInventoryResource

  • Direct Known Subclasses:
    NodeHardwareInventoryRestService

    @Component("hardwareInventoryResource")
    @Path("hardwareInventory")
    @Transactional
    public class HardwareInventoryResource
    extends OnmsRestService
    The Class HardwareInventoryResource. Retrieve the root entity (all hardware inventory) GET /nodes/{nodeId}/hardwareInventory Override the root entity (all hardware inventory) POST /nodes/{nodeId}/hardwareInventory Retrieve a specific entity GET /nodes/{nodeId}/hardwareInventory/{entPhysicalIndex} Delete a specific entity DELETE /nodes/{nodeId}/hardwareInventory/{entPhysicalIndex} Modify an existing entity PUT /nodes/{nodeId}/hardwareInventory/{entPhysicalIndex} Add a child entity POST /nodes/{nodeId}/hardwareInventory/{entPhysicalIndex}
    Author:
    Alejandro Galue
    • Constructor Detail

      • HardwareInventoryResource

        public HardwareInventoryResource()
    • Method Detail

      • getHardwareInventory

        @GET
        @Produces({"application/xml","application/json"})
        public OnmsHwEntity getHardwareInventory​(@PathParam("nodeCriteria")
                                                 String nodeCriteria)
        Gets the hardware inventory.
        Parameters:
        nodeCriteria - the node criteria
        Returns:
        the root hardware entity
      • getHwEntityByIndex

        @GET
        @Path("{entPhysicalIndex}")
        @Produces({"application/xml","application/json"})
        public OnmsHwEntity getHwEntityByIndex​(@PathParam("nodeCriteria")
                                               String nodeCriteria,
                                               @PathParam("entPhysicalIndex")
                                               Integer entPhysicalIndex)
        Gets the hardware entity by index.
        Parameters:
        nodeCriteria - the node criteria
        entPhysicalIndex - the entity physical index
        Returns:
        the hardware entity
      • setHardwareInventory

        @POST
        @Consumes({"application/xml","application/json"})
        public javax.ws.rs.core.Response setHardwareInventory​(@PathParam("nodeCriteria")
                                                              String nodeCriteria,
                                                              OnmsHwEntity entity)
        Sets the hardware inventory (root object)
        Parameters:
        nodeCriteria - the node criteria
        entity - the root entity object
        Returns:
        the response
      • addOrReplaceChild

        @POST
        @Path("{parentEntPhysicalIndex}")
        @Consumes({"application/xml","application/json"})
        public javax.ws.rs.core.Response addOrReplaceChild​(@PathParam("nodeCriteria")
                                                           String nodeCriteria,
                                                           @PathParam("parentEntPhysicalIndex")
                                                           Integer parentEntPhysicalIndex,
                                                           OnmsHwEntity child)
        Adds or replaces a child entity.
        Parameters:
        nodeCriteria - the node criteria
        parentEntPhysicalIndex - the parent entity physical index
        child - the child
        Returns:
        the response
      • updateHwEntity

        @PUT
        @Path("{entPhysicalIndex}")
        @Consumes("application/x-www-form-urlencoded")
        public javax.ws.rs.core.Response updateHwEntity​(@PathParam("nodeCriteria")
                                                        String nodeCriteria,
                                                        @PathParam("entPhysicalIndex")
                                                        Integer entPhysicalIndex,
                                                        MultivaluedMapImpl params)
        Update hardware entity.
        Parameters:
        nodeCriteria - the node criteria
        entPhysicalIndex - the entity physical index
        params - the parameters
        Returns:
        the response
      • deleteHwEntity

        @DELETE
        @Path("{entPhysicalIndex}")
        public javax.ws.rs.core.Response deleteHwEntity​(@PathParam("nodeCriteria")
                                                        String nodeCriteria,
                                                        @PathParam("entPhysicalIndex")
                                                        Integer entPhysicalIndex)
        Delete hardware entity.
        Parameters:
        nodeCriteria - the node criteria
        entPhysicalIndex - the entity physical index
        Returns:
        the response