Refactor new ReST endpoints to share more code rather than duplicating it

Description

We provide more and more new angular UIs which also requires implementing new ReST services. In order to provide useful error messages to the user a generic error object is returned in error scenarios. However each module is implementing these logic individually.
For example See Geocoder, Classification or Endpoints API.

These common functionalities should be consolidated and put either in opennms-web-api or if not reasonable in a "commons" or "shared" module.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Seth Leger August 30, 2017 at 4:05 AM

A final PR has been created to implement a limit parameter on the property value endpoint.

https://github.com/OpenNMS/opennms/pull/1650

Seth Leger August 29, 2017 at 3:41 AM

The changes for this feature have been backported to foundation-2017. Another PR for this has been merged that implements the /alarms/properties/{propertyId} endpoint to implement autocomplete for the property values.

https://github.com/OpenNMS/opennms/pull/1638

The last remaining thing to do here is implement a limit query property for the autocomplete to provide a limit to the results that are returned.

Jesse White August 4, 2017 at 2:52 PM

https://github.com/OpenNMS/opennms/pull/1616 was merged to develop.

Property enumeration is currently working, auto-complete and looking up specific properties in pending.

Seth Leger July 10, 2017 at 8:30 PM

Note that CXF can export Swagger by scanning annotations but I don't see an appropriate Swagger annotation for this sort of thing, ie. search terms in a string query value.

http://cxf.apache.org/docs/swagger2feature.html

Seth Leger July 5, 2017 at 3:53 PM

One thing that would be nice here is to also provide autocomplete support for each search/orderBy term. I'm thinking something like:

/alarms/properties: Returns a list of all search/orderBy property objects for the alarms endpoint. The objects would include name, type (String, Long, Timestamp), and human-readable name.
/alarms/properties?q=node: Returns a list of all search/orderBy property names that match the q expression to use for autocomplete.
/alarms/properties/node.label: Returns a list of all node labels.
/alarms/properties/node.label?q=www.mycompan: Returns node labels matching the q expression to use for autocomplete.

We could reuse the node.label, etc. resources on all endpoints that support the same parameters.

Details

Assignee

Reporter

Components

Sprint

Affects versions

Priority

PagerDuty

Created May 28, 2019 at 9:23 AM
Updated September 21, 2021 at 9:27 PM
Loading...
Loading...