Description of problem: curently rest api can return all alert definitions defined, but not for particular resource. Client has to iterate over all definitions in order to get definitions for 1 resource Version-Release number of selected component (if applicable): RHQ 4.10 - master How reproducible: always We could add either /resource/<id>/alertDefinitions resource or add optional queryParam resourceId to /alert/definitions
master bcd4952 server/jar hrupp$ curl -i -u rhqadmin:rhqadmin http://localhost:7080/rest/resource/10001.json HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 01:00:00 CET Cache-Control: max-age=120, private Content-Type: application/json Transfer-Encoding: chunked Date: Sat, 07 Dec 2013 22:20:15 GMT {"resourceName":"snert","resourceId":10001,"typeName":"Mac OS X","typeId":10013,"pluginName":"Platforms","parentId":0,"status":"COMMITTED","availability":"DOWN","links":[{"operationDefinitions":{"href":"http://localhost:7080/rest/operation/definitions?resourceId=10001"}},{"self":{"href":"http://localhost:7080/rest/resource/10001"}},{"schedules":{"href":"http://localhost:7080/rest/resource/10001/schedules"}},{"availability":{"href":"http://localhost:7080/rest/resource/10001/availability"}},{"children":{"href":"http://localhost:7080/rest/resource/10001/children"}},{"alerts":{"href":"http://localhost:7080/rest/resource/10001/alerts"}},{"alertDefinitions":{"href":"http://localhost:7080/rest/alert/definitions?resourceId=10001"}},{"coregui":{"href":"http://localhost:7080/coregui/#Resource/10001"}}],"ancestry":null,"location":null,"description":"Mac OS X Operating System"}snert:/im/rhq/modules/enterprise/server/jar hrupp$ curl -i -u rhqadmin:rhqadmin http://localhost:7080/rest/alert/definitions?resourceId=10001 HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 01:00:00 CET Link: <http://localhost:7080/rest/alert/definitions?resourceId=10001&page=-1>; rel="last" Link: <http://localhost:7080/rest/alert/definitions?resourceId=10001>; rel="current" X-collection-size: 1 Content-Type: */* Content-Length: 469 Date: Sat, 07 Dec 2013 22:20:37 GMT - !!org.rhq.enterprise.server.rest.domain.AlertDefinitionRest conditionMode: ANY conditions: [] dampeningCategory: ONCE dampeningCount: 0 dampeningPeriod: 0 dampeningUnit: null enabled: false id: 10091 links: - {href: 'http://localhost:7080/coregui/#Resource/10001/Alerts/Definitions/10091', rel: coregui} - {href: 'http://localhost:7080/rest/resource/10001', rel: resource} name: test notifications: [] priority: MEDIUM recoveryId: 0
Bulk closing of 4.10 issues. If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.