1.6. http://localhost:7080/rest/group : Deal with groups and DynaGroups
Api that deals with resource groups and group definitions
Defining class: org.rhq.enterprise.server.rest.GroupHandlerBean
Produces: application/json, application/xml, text/html, application/vnd.rhq.wrapped+json
Methods
GET /group
Description
List all groupsSupports returning a gzip'ed Content-Encoding
Parameters: Name P.Type Description Required Type Allowed values Default value q Query String to search in the group name false String all ps Query Page size for paging false int all 20 page Query Page number for paging, 0-based false Integer all Return type: GroupRest (multi)
GET /group/{id}
Description
Get the group with the passed idParameters: Name P.Type Description Required Type Allowed values Default value id Path Id of the group true int all Return type: javax.ws.rs.core.Response
Error codes: Code Reason 404 Group with passed id not found POST /group
Description
Create a new groupParameters: Name P.Type Description Required Type Allowed values Default value -body- A GroupRest object containing at least a name for the group true GroupRest all Return type: javax.ws.rs.core.Response
Error codes: Code Reason 404 Resource type for provided type id does not exist 406 No group provided 406 Provided group has no name PUT /group/{id}
Description
Update the passed group. Currently only name change is supportedParameters: Name P.Type Description Required Type Allowed values Default value id Path Id of the group to update true int all -body- New version of the group true GroupRest all Return type: javax.ws.rs.core.Response
Error codes: Code Reason 404 Group with the passed id does not exist 406 Updating the name failed DELETE /group/{id}
Description
Delete the group with the passed idNotes
This operation is by default idempotent, returning 204.If you want to check if the group existed at all, you need to pass the 'validate' query parameter.
Parameters: Name P.Type Description Required Type Allowed values Default value id Path Id of the group to delete true int all validate Query Validate if the group exists false boolean all false Return type: javax.ws.rs.core.Response
Error codes: Code Reason 204 Group was deleted or did not exist with validation not set 404 Group did not exist and validate was set GET /group/{id}/resources
Description
Get the resources of the groupSupports returning a gzip'ed Content-Encoding
Parameters: Name P.Type Description Required Type Allowed values Default value id Path Id of the group to retrieve the resources for true int all Return type: ResourceWithType (multi)
Error codes: Code Reason 404 Group with passed id does not exist PUT /group/{id}/resource/{resourceId}
Description
Add a resource to an existing groupNotes
If you have created the group as a compatible group and a resource type was provided on creation, only resources with this type may be added.
Parameters: Name P.Type Description Required Type Allowed values Default value id Path Id of the existing group true int all resourceId Path Id of the resource to add true int all Return type: javax.ws.rs.core.Response
Error codes: Code Reason 404 If there is no resource or group with the passed id 409 Resource type does not match the group one DELETE /group/{id}/resource/{resourceId}
Description
Remove the resource with the passed id from the groupNotes
This operation is by default idempotent, returning 204even if the resource was not member of the group.If you want to check if the resource existed at all, you need to pass the 'validate' query parameter.
Parameters: Name P.Type Description Required Type Allowed values Default value id Path Id of the existing group true int all resourceId Path Id of the resource to remove true int all validate Query Validate if the resource exists in the group false boolean all false Return type: javax.ws.rs.core.Response
Error codes: Code Reason 404 Group with the passed id does not exist 404 Resource with the passed id does not exist 204 Resource was removed from the group or was no member and validation was not set 404 Resource was no member of the group and validate was set GET /group/{id}/metricDefinitions
Description
Get the metric definitions for the compatible group with the passed idSupports returning a gzip'ed Content-Encoding
Parameters: Name P.Type Description Required Type Allowed values Default value id Path Id of the group true int all Return type: javax.ws.rs.core.Response
Error codes: Code Reason 404 Group with the passed id does not exist GET /group/definitions
Description
List all existing GroupDefinitionsSupports returning a gzip'ed Content-Encoding
Parameters: Name P.Type Description Required Type Allowed values Default value q Query String to search in the group definition name false String all Return type: GroupDefinitionRest (multi)
GET /group/definition/{id}
Description
Retrieve a single GroupDefinition by idSupports returning a gzip'ed Content-Encoding
Parameters: Name P.Type Description Required Type Allowed values Default value id Path The id of the definition to retrieve true int all Return type: GroupDefinitionRest
Error codes: Code Reason 404 Group definition with the passed id does not exist. DELETE /group/definition/{id}
Description
Delete the GroupDefinition with the passed idNotes
This operation is by default idempotent, returning 204.If you want to check if the definition existed at all, you need to pass the 'validate' query parameter.
Parameters: Name P.Type Description Required Type Allowed values Default value id Path The id of the definition to delete true int all validate Query Validate if the definition exists false boolean all false Return type: javax.ws.rs.core.Response
Error codes: Code Reason 204 Definition was deleted or did not exist with validation not set 404 Definition did not exist and validate was set POST /group/definitions
Description
Create a new GroupDefinition.Notes
The name of the group is required in the passed definition, as well as a non-empty expression. A recalcInterval of 0 means to never recalculate.
Parameters: Name P.Type Description Required Type Allowed values Default value -body- The group definition to use for the new group. true GroupDefinitionRest -all- -none- Return type: javax.ws.rs.core.Response
Error codes: Code Reason 406 Passed group definition has no name 406 Passed expression was empty 406 Recalculation interval is < 0 409 There already exists a definition by this name 406 Group creation failed PUT /group/definition/{id}
Description
Update or recalculate an existing GroupDefinitionNotes
If the query param 'recalculate' is set to true, the group with the passed id is recalculated. Otherwise the existing group will be updated with the passed definition. The expression in the definition must be empty. If the name is emtpy, the old name is kept. A recalcInterval of 0 means no recalculation.
Parameters: Name P.Type Description Required Type Allowed values Default value id Path Id for the definition to update true int all recalculate Query If true, trigger a re-calculation false boolean all false -body- The group definition to use for the update. This is required if recalculate is false. GroupDefinitionRest -all- -none- Return type: javax.ws.rs.core.Response
Error codes: Code Reason 404 Group with the passed id does not exist 406 Passed expression was empty 406 Recalculation interval is < 0 406 Group membership calculation failed