Bug 1039107 - RFE: Support GET /alert/definitions by resourceId
Summary: RFE: Support GET /alert/definitions by resourceId
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: REST
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHQ 4.10
Assignee: Heiko W. Rupp
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-06 16:32 UTC by Libor Zoubek
Modified: 2015-11-02 00:43 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-23 12:31:44 UTC
Embargoed:


Attachments (Terms of Use)

Description Libor Zoubek 2013-12-06 16:32:18 UTC
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

Comment 1 Heiko W. Rupp 2013-12-07 22:23:45 UTC
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

Comment 2 Heiko W. Rupp 2014-04-23 12:31:44 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.