Monday, May 28, 2012

RHQ REST api: added support for Group Definitions



I've just added some support for GroupDefinitions (aka "DynaGroups") to RHQ.

The following shows some examples:

List all definitions:

$ curl -i --user rhqadmin:rhqadmin http://localhost:7080/rest/1/group/definitions
[{"name":"group1",
"id":10001,
"description":"just some random test",
"expression":["groupby resource.type.plugin","groupby resource.type.name"],
"recursive":false,
"recalcInterval":180000,
"generatedGroupIds":[10082,10091]},
{"name":"platforms",
"id":10002,
"description":"",
"expression":["resource.type.category = PLATFORM","groupby resource.name"],
"recursive":false,
"recalcInterval":0,
"generatedGroupIds":[10152]}
]
Get a single definition by id:

$ curl -i --user rhqadmin:rhqadmin http://localhost:7080/rest/1/group/definition/10002
{"name":"platforms",
"id":10002,
"description":"",
"expression":["resource.type.category = PLATFORM","groupby resource.name"],
"recursive":false,
"recalcInterval":0,
"generatedGroupIds":[10152]
}


You see in the above examples that the actual expression is encoded as a list with each line being an item in the list. The recalculation interval needs to be given in milliseconds.

Delete a definition (by id):

$ curl -i --user rhqadmin:rhqadmin http://localhost:7080/rest/1/group/definition/10031 -X DELETE
Create a new definition:

$ curl -i --user rhqadmin:rhqadmin http://localhost:7080/rest/1/group/definitions \
-HContent-Type:application/json -HAccept:application/json -X POST \
-d '{"name":"test1","description":"Hello","expression":["groupBy resource.name"]}'
HTTP/1.1 201 Created
Location: http://localhost:7080/rest/1/group/definition/10041


For creation a name is required. The location of the created group definition is returned in the header of the response.

And finally to update a definition:

curl -i --user rhqadmin:rhqadmin http://localhost:7080/rest/1/group/definition/10041?recalculate=true \
-HContent-Type:application/json -HAccept:application/json -X PUT \
-d '{"name":"test4","description":"Hello","expression":["groupBy resource.name"]}'


By passing the query-param recalculate=true we can trigger a re-calculation of the groups defined by this group definition.

Wednesday, May 09, 2012

RHQ 4.4 released

I am proud to announce the immediate availability of RHQ 4.4

As before a lot of work has gone into this release:
  • Availability now knows a type of "disabled". This allows you to mark resources while maintenance or non-connected network interfaces so that they do not show up as down and also don't create false alerts. This also includes the possibility that plugins request to mark a resource as enabled or disabled
  • Faster availability reporting
  • Faster availability checking in the agent, that is also less bursty than in the past
  • Plugins can now request an availability check for a resource
  • Alerting has been improved: It is now possible to react on availability being in a certain state for some period of time (see the release notes for a long explanation
  • The JBoss AS 7 plugin has been massively improved
  • Denis Krusko has provided some initial Russian translations of the UI
  • Reports like Suspect Metrics, Recent Operations or Recent Drift can now be exported in CSV format to e.g. post-process them in Open/LibreOffice.


Of course we have fixed many small bugs too and made tweaks to the UI etc.

One very cool feature of this release is that the maven artifacts are already uploaded to the JBoss Nexus repository ;-)

Please check out the release notes, where you also find the download link. Also check out the RHQ 4.3 release notes, as 4.3 was more a slient release, which nevertheless brought enhancements in the UI (update of GWT/SmartGWT) and many bug fixes.

If you want to get a quick overview on the ways to interact with RHQ, have a look at this whitepaper (PDF)

As always: give use feedback, join us on Irc on #rhq and spread the word.

And last but not least I want to thank all our contributors for their valuable contributions.

Heiko on behalf of the RHQ team