Red Hat Training
A Red Hat training course is available for Red Hat JBoss Operations Network
REST API
For developing remote clients
3.3.9 Edition
Tyler Kelly
tkelly@redhat.com
Jared Morgan
jmorgan@redhat.com
Zach Rhoads
zach@redhat.com
Ella Deon Ballard
dlackey@redhat.com
Abstract
Chapter 1. REST Interface
1.1. http://localhost:7080/rest/ : Handle the root context to have an anchor for discoverability
Defining class: org.rhq.enterprise.server.rest.RootHandlerBean
Produces: application/json, application/xml, text/html, application/vnd.rhq.wrapped+json
Methods
GET //index
Description
Return links from the root /index of the REST-resource treeThis method has no parameters
Return type: javax.ws.rs.core.Response
GET /
Description
Return links from the root / of the REST-resource treeThis method has no parameters
Return type: javax.ws.rs.core.Response
1.2. http://localhost:7080/rest/alert : Deal with Alerts
This api deals with alerts that have fired.
Defining class: org.rhq.enterprise.server.rest.AlertHandlerBean
Produces: application/json, application/xml, text/html, application/vnd.rhq.wrapped+json
Methods
GET /alert
Description
List all alerts, possibly limiting by resource or alert definition, priority and start timeSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value page Query Page number false int all 0 size Query Page size; use -1 for 'unlimited' false int all 100 prio Query Limit to priority false String High, Medium, Low, All All slim Query Should full resources and definitions be sent false boolean all false since Query If non-null only send alerts that have fired after this time, time is millisecond since epoch false Long all resourceId Query Id of a resource to limit search for false Integer all definitionId Query If of an alert definition to search for false Integer all unacknowledgedOnly Query Should only unacknowledged alerts be sent false boolean all false Return type: List<AlertRest> (multi)
Error codes:
Code Reason 406 There are 'resourceId' and 'definitionId' passed as query parameters 406 Page size was 0 406 Page number was < 0 GET /alert/count
Description
Return a count of alerts in the system depending on criteriaParameters:
Name P.Type Description Required Type Allowed values Default value since Query If non-null only send alerts that have fired after this time, time is millisecond since epoch false Long all Return type: IntegerValue
GET /alert/{id}
Description
Get one alert with the passed idParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the alert to retrieve true int all slim Query Should full resources and definitions be sent false boolean all false Return type: AlertRest
GET /alert/{id}/conditions
Description
Return the condition logs for the given alertParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the alert to retrieve true int all Return type: javax.ws.rs.core.Response
GET /alert/{id}/notifications
Description
Return the notification logs for the given alertParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the alert to retrieve true int all Return type: javax.ws.rs.core.Response
PUT /alert/{id}
Description
Mark the alert as acknowledged (by the caller)Notes
Returns a slim version of the alert
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the alert to acknowledge true int all Return type: AlertRest
DELETE /alert/{id}
Description
Remove the alert from the list of alertsNotes
This operation is by default idempotent, returning 204.If you want to check if the alert 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 alert to remove true int all validate Query Validate if the alert exists false boolean all false Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 204 Alert was deleted or did not exist with validation not set 404 Alert did not exist and validate was set GET /alert/{id}/definition
Description
Get the alert definition (basics) for the alertParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the alert to show the definition true int all Return type: AlertDefinitionRest
1.3. http://localhost:7080/rest/alert : Deal with Alert Definitions
This api deals with alert definitions.
Defining class: org.rhq.enterprise.server.rest.AlertDefinitionHandlerBean
Produces: application/json, application/xml, text/html, application/vnd.rhq.wrapped+json
Methods
GET /alert/definition
Description
Redirects to /alert/definitionsThis method has no parameters
Return type: javax.ws.rs.core.Response
GET /alert/definitions
Description
List all Alert DefinitionSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value full Query Should conditions and notifications be returned too? false boolean all false page Query Page number false Integer all ps Query Page size false int all 20 resourceId Query Resource id to filter by false Integer all Return type: AlertDefinitionRest (multi)
GET /alert/definition/{id}
Description
Get one AlertDefinition by idParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the alert definition to retrieve true int all full Query Should conditions and notifications be returned too? false boolean all true Return type: AlertDefinitionRest
Error codes:
Code Reason 404 No definition found with the passed id. POST /alert/definitions
Description
Create an AlertDefinition for the resource/group/resource type passed as query param. One and only one of the three params must be given at any time. Please also check the POST method for conditions and notifications to see their optionsParameters:
Name P.Type Description Required Type Allowed values Default value resourceId Query The id of the resource to attach the definition to false Integer all groupId Query The id of the group to attach the definition to false Integer all resourceTypeId Query The id of the resource type to attach the definition to false Integer all -body- The data for the new definition true AlertDefinitionRest all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 406 There was not exactly one of 'resourceId','groupId' or 'resourceTypeId' given 406 The passed condition failed validation 406 The passed group was a mixed group, that can not have alert definitions 404 A non existing alert notification sender was requested. 404 A referenced alert to recover does not exist PUT /alert/definition/{id}
Description
Update the alert definition (priority, enablement, dampening, recovery)Notes
Priority must be HIGH,LOW,MEDIUM. If not provided, LOW is assumed.
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the alert definition to update true int all -body- Data for the update true AlertDefinitionRest all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No AlertDefinition with the passed id exists DELETE /alert/definition/{id}
Description
Delete an alert definitionNotes
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 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 DELETE /alert/condition/{cid}
Description
Remove an alert conditionNotes
This operation is by default idempotent, returning 204.If you want to check if the condition existed at all, you need to pass the 'validate' query parameter.
Parameters:
Name P.Type Description Required Type Allowed values Default value cid Path The id of the condition to remove true int all validate Query Validate if the condition exists false boolean all false Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 204 Condition was deleted or did not exist with validation not set 404 Condition did not exist and validate was set POST /alert/definition/{id}/conditions
Description
Add a new alert condition to an existing alert definitionNotes
Each condition falls into a category. Allowed categories are AVAILABILITY, AVAIL_DURATION, BASELINE(m), CHANGE(m), CONTROL, DRIFT, EVENT, RANGE(m), RESOURCE_CONFIG, THRESHOLD(m), TRAIT(m).Categories with an appended (m) are for metrics and need a metricDefinition, but no name, as the name is obtained from the metric definition. Parameters vary depending on the category:- AVAILABILITY: name is one of AVAIL_GOES_DOWN, AVAIL_GOES_DISABLED, AVAIL_GOES_UNKNOWN, AVAIL_GOES_NOT_UP and AVAIL_GOES_UP.
- AVAIL_DURATION: name is one of AVAIL_DURATION_DOWN andAVAIL_DURATION_NOT_UP; option gives the duration in seconds.
- BASELINE: option is one of 'min','mean','max', threshold gives the percentage (0.01=1%), comparator is one of '<','=' and '>'.
- CONTROL: option gives the Operation status (FAILURE,SUCCESS,INPROGRESS,CANCELED), name is the name of the operation (not the display-name).
- EVENT: name is the severity (DEBUG,INFO,WARN,ERROR,FATAL), option is an optional RegEx to match against.
- DRIFT: name is optional and matches drift-definitions; option is optional and matches directories.
- RANGE: threshold has the lower bound, option the higher bound, comparator is one of '<','<=','=','>=' or '>'.
- RESOURCE_CONFIG: no additional params needed.
- THRESHOLD: comparator is one of '<','=','>'; threshold is the value to compare against.
- TRAIT: option is an optional RegEx to match against.
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path The id of the alert definition true int all -body- The condition to add true AlertConditionRest all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No AlertDefinition with the passed id exists 406 The passed condition failed validation. A more detailed message is provided PUT /alert/condition/{cid}
Description
Update an existing condition of an alert definition.Note that the update will change the id of the conditionParameters:
Name P.Type Description Required Type Allowed values Default value cid Path The id of the condition to update true int all -body- The updated condition true AlertConditionRest all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 Condition with passed id does not exist 406 The passed category or condition operator was invalid GET /alert/condition/{cid}
Description
Retrieve a condition of an alert definition by its condition idParameters:
Name P.Type Description Required Type Allowed values Default value cid Path The id of the condition to retrieve true int all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No condition with the passed id exists GET /alert/notification/{nid}
Description
Return a notification definition by its idParameters:
Name P.Type Description Required Type Allowed values Default value nid Path The id of the notification definition to retrieve true int all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No notification with the passed id found DELETE /alert/notification/{nid}
Description
Remove a notification definitionNotes
This operation is by default idempotent, returning 204.If you want to check if the notification existed at all, you need to pass the 'validate' query parameter.
Parameters:
Name P.Type Description Required Type Allowed values Default value nid Path The id of the notification definition to remove true int all validate Query Validate if the notification exists false boolean all false Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 204 Notification was deleted or did not exist with validation not set 404 Notification did not exist and validate was set PUT /alert/notification/{nid}
Description
Update a notification definitionParameters:
Name P.Type Description Required Type Allowed values Default value nid Path The id of the notification definition to update true int all -body- The updated notification definition to use true AlertNotificationRest all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 There is no notification with the passed id POST /alert/definition/{id}/notifications
Description
Add a new notification definition to an alert definitionParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the alert definition that should get the notification definition true int all -body- The notification definition to add true AlertNotificationRest all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 Requested alert notification sender does not exist 404 There is no alert definition with the passed id GET /alert/senders
Description
Return a list of alert notification senders with a short description. The list does not include the configuration definition.Supports returning a gzip'ed Content-Encoding
This method has no parameters
Return type: javax.ws.rs.core.Response
GET /alert/sender/{name}
Description
Return an alert notification sender by name. This includes information about the configuration it expectsSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value name Path Name of the sender to retrieve true String all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 There is no sender with the passed name
1.4. http://localhost:7080/rest/content : Content related
This endpoint deals with content (upload)
Defining class: org.rhq.enterprise.server.rest.ContentHandlerBean
Produces: application/json, application/xml
Methods
POST /content/fresh
Description
Upload content to the server. This will return a handle that can be used later to retrieve and further process the contentParameters:
Name P.Type Description Required Type Allowed values Default value -body- An application/octet-stream to be stored. true java.io.InputStream -all- -none- Return type: javax.ws.rs.core.Response
GET /content/{handle}/info
Description
Retrieve the length of the content with the passed handleParameters:
Name P.Type Description Required Type Allowed values Default value handle Path none String -all- -none- Return type: IntegerValue
PUT /content/{handle}/plugins
Description
Put the uploaded content into the plugin drop box.Notes
This endpoint allows to deploy previously uploaded content as a plugin. You need to provide a valid plugin (file) name in order for the plugin processing to succeed. Optionally you can request that a plugin scan will be started and the plugin be registered in the system. You can also specify a delay in milliseconds after which the plugin will be automatically pushed out to the agents.Note that a non-negative "pushOutDelay" only makes sense when the "scan" is set to true, otherwise no update on the agents can occur because there will be no updated plugins on the server. If a non-negative "pushOutDelay" is given together with "scan" set to false a 406 error is returned.The content identified by the handle is not removed. Note that this method is deprecated - use a PUT to /plugins.
Parameters:
Name P.Type Description Required Type Allowed values Default value handle Path Name of the handle retrieved from upload true String all name Query Name of the plugin file false String all scan Query Should a discovery scan be started? false boolean all false pushOutDelay Query The delay in milliseconds before the agents update their plugins. Any negative value disables the automatic update of agents false long all -1 Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 406 No name provided or invalid combination of parameters supplied 404 No content for handle found 403 Caller has not rights to upload plugins DELETE /content/{handle}
Description
Remove the content with the passed handleNotes
This operation is by default idempotent, returning 204.If you want to check if the content existed at all, you need to pass the 'validate' query parameter.
Parameters:
Name P.Type Description Required Type Allowed values Default value handle Path none String -all- -none- validate Query Validate if the content exists false boolean all false Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 204 Content was deleted or did not exist with validation not set 404 Content did not exist and validate was set
1.5. http://localhost:7080/rest/event : Api that deals with Events (e.g snmp traps, log file lines)
Defining class: org.rhq.enterprise.server.rest.EventHandlerBean
Produces: application/json, application/xml, text/html, application/vnd.rhq.wrapped+json
Methods
GET /event/{id}/sources
Description
List the defined event sources for the resourceParameters:
Name P.Type Description Required Type Allowed values Default value id Path id of the resource true int all Return type: EventSourceRest (multi)
GET /event/{id}/definitions
Description
List the defined event source definitions for the resourceParameters:
Name P.Type Description Required Type Allowed values Default value id Path id of the resource true int all Return type: EventDefinitionRest (multi)
GET /event/source/{id}
Description
Retrieve the event source with the passed idParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the source to retrieve true int all Return type: EventSourceRest
Error codes:
Code Reason 404 There is no event source with the passed id POST /event/{id}/sources
Description
Add a new event source for a resource. This can e.g. be a different log file. The source name must match an existing definition for this resource. If an event source for the definition name and resource with the same location already exists, no new source is created. NOTE: An Event source added this way will not show up in the connection properties.Parameters:
Name P.Type Description Required Type Allowed values Default value id Path id of the resource true int all -body- The event source to be added. true EventSourceRest -all- -none- Return type: EventSourceRest
Error codes:
Code Reason 404 Resource with the passed id does not exist 404 Event definition with the passed name not found 406 Tried to create an event source on the same definition with the same location DELETE /event/source/{id}
Description
Delete the event source with the passed idNotes
This operation is by default idempotent, returning 204.If you want to check if the source 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 source to delete true int all validate Query Validate if the content exists false boolean all false Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 204 Source was deleted or did not exist with validation not set 404 Source did not exist and validate was set GET /event/source/{id}/events
Description
List the events for the event source with the passed id. If no time range is given, the last 200 entries will be displayedSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path none int -all- -none- startTime Query none long -all- -none- endTime Query none long -all- -none- severity Query Select the severity to display. Default is to show all false String DEBUG, INFO, WARN, ERROR, FATAL ps Query Page size for paging false int all 20 page Query Page for paging, 0-based false Integer all Return type: EventRest (multi)
GET /event/{id}/events
Description
List the events for the resource with the passed id. If no time range is given, the last 200 entries will be displayedSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path none int -all- -none- startTime Query none long -all- -none- endTime Query none long -all- -none- ps Query Page size for paging false int all 20 page Query Page for paging, 0-based false Integer all severity Query Select the severity to display. Default is to show all false String DEBUG, INFO, WARN, ERROR, FATAL Return type: EventRest (multi)
POST /event/source/{id}/events
Description
Submit multiple events for one given event source; the event source in the passed Events is ignored. Make sure your events are ordered by timestamp to get alerts fired correctly.Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the source to add data to true int all -body- A list of events to add. true List<EventRest> -all- -none- Return type: javax.ws.rs.core.Response
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
1.7. http://localhost:7080/rest/metric : Deal with metrics
This part of the API deals with exporting and adding metrics
Defining class: org.rhq.enterprise.server.rest.MetricHandlerBean
Produces: application/json, application/xml, text/html
Methods
GET /metric/data/{scheduleId}
Description
Get the bucketized metric values for the schedule.Supports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value scheduleId Path Schedule Id of the values to query true int all startTime Query Start time since epoch. false long all End time - 8h endTime Query End time since epoch. false long all Now dataPoints Query Number of buckets false int all 60 hideEmpty Query Hide rows that are NaN only false boolean all false Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No schedule with the passed id exists GET /metric/data/group/{groupId}/{definitionId}
Description
Get the bucketized metric values for the metric definition of the groupSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value groupId Path Id of the group to query true int all definitionId Path Id of the metric definition to retrieve true int all startTime Query Start time since epoch. false long all End time - 8h endTime Query End time since epoch. false long all Now dataPoints Query Number of buckets false int all 60 hideEmpty Query Hide rows that are NaN only false boolean all false Return type: javax.ws.rs.core.Response
GET /metric/data
Description
Return bucketized metric data (60 points) for the passed schedulesSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value sid Query A comma separated list of schedule ids true String all startTime Query Start time in ms since epoch. Default is now -8h false long all endTime Query End time in ms since epoch. Default is now false long all dataPoints Query Number of buckets false int all 60 hideEmpty Query Should empty datapoints be hidden false boolean all false Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No schedule with the passed id exists 406 No schedules requested 406 Schedule Ids are not numeric GET /metric/schedule/{id}
Description
Get the metric schedule for the passed idParameters:
Name P.Type Description Required Type Allowed values Default value id Path Schedule Id true int all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No schedule with the passed id exists GET /metric/data/resource/{resourceId}
Description
Retrieve a list of high/low/average/data aggregates for the resourceSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value resourceId Path Id of the resource to query true int all startTime Query Start time since epoch. false long all End time - 8h endTime Query End time since epoch. false long all Now includeDataPoints Query Include data points false boolean all false dataPoints Query Number of buckets (if include data points)) false int all 60 hideEmpty Query Hide rows that are NaN only false boolean all false Return type: List<MetricAggregate>
Error codes:
Code Reason 404 If no resource with the passed id exists GET /metric/data/group/{groupId}
Description
Retrieve a list of high/low/average/data aggregates for the groupSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value groupId Path Id of the group to query true int all startTime Query Start time since epoch. false long all End time - 8h endTime Query End time since epoch. false long all Now Return type: List<MetricDefinitionAggregate>
Error codes:
Code Reason 404 There is no group with the passed id PUT /metric/schedule/{id}
Description
Update the schedule (enabled, interval)Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the schedule to update true int all -body- New schedule data true MetricSchedule all Return type: MetricSchedule
Error codes:
Code Reason 404 No schedule with the passed id exists GET /metric/definition/{id}
Description
Get the definitionParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the definition to obtain true int all Return type: MetricSchedule
Error codes:
Code Reason 404 No definition exists for the given id. PUT /metric/definition/{id}
Description
Update the definition (default enabled, default interval)Notes
This operation may internally take a long time to complete and is thus only triggered by this call. A return code of 200 only indicates that the operation was successfully submitted.
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the definition to update true int all -body- New definition data true MetricSchedule all updateExisting Query Update existing schedules for this definition as well? false boolean all false Return type: MetricSchedule
Error codes:
Code Reason 404 No definition exists for the given id. GET /metric/data/{scheduleId}/raw
Description
Expose the raw metrics of a single schedule. This can only expose raw data, which means the start date may not be older than 7 days.Supports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value scheduleId Path none true int all startTime Query Start time since epoch false long all Now - 8h endTime Query End time since epoch false long all Now duration Query Timespan in ms false long all 8h = 28800000ms Return type: javax.ws.rs.core.StreamingOutput
Error codes:
Code Reason 404 No schedule with the passed id exists GET /metric/data/{scheduleId}/callTime
Description
Expose callTime data for given scheduleIdParameters:
Name P.Type Description Required Type Allowed values Default value scheduleId Path none true int all startTime Query Start time since epoch false long all Now - 8h endTime Query End time since epoch false long all Now aggregate Query True to return callTimes aggregated by callDestination false boolean all true Return type: javax.ws.rs.core.StreamingOutput
Error codes:
Code Reason 404 No schedule with the passed id exists PUT /metric/data/{scheduleId}/callTime
Description
Submit a callTime metrics to the serverParameters:
Name P.Type Description Required Type Allowed values Default value scheduleId Path Id of the schedule true int all -body- A list of call time values to add. true List<CallTimeValueRest> -all- -none- Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No schedule with the passed id exists 406 beginTime is older than 7 days 406 callDestination is null 406 duration is negative number PUT /metric/data/{scheduleId}/raw/{timeStamp}
Description
Submit a single (numerical) metric to the serverParameters:
Name P.Type Description Required Type Allowed values Default value scheduleId Path Id of the schedule true int all timeStamp Path Timestamp of the metric true long all -body- Data value true DoubleValue all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No schedule with the passed id exists 406 Timestamp is older than 7 days PUT /metric/data/{scheduleId}/trait/{timeStamp}
Description
Submit a new trait value for the passed schedule idParameters:
Name P.Type Description Required Type Allowed values Default value scheduleId Path Id of the schedule true int all timeStamp Path Timestamp of the metric true long all -body- Data value true StringValue all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No schedule with the passed id exists 406 Timestamp is older than 7 days GET /metric/data/{scheduleId}/trait
Description
Get the current value of the trait with the passed schedule idParameters:
Name P.Type Description Required Type Allowed values Default value scheduleId Path Id of the schedule true int all Return type: StringValue
Error codes:
Code Reason 404 No schedule with the passed id exists POST /metric/data/raw
Description
Submit a series of (numerical) metric values to the serverParameters:
Name P.Type Description Required Type Allowed values Default value -body- A collection of numeric data point values with their schedule id set. true Collection<NumericDataPoint> -all- -none- Return type: No response
Error codes:
Code Reason 201 There are some submitted datapoints with non-existing scheduleId, API returns rejected values back to client, valid values are accepted 403 All submitted datapoints have non-existing scheduleId, API returns rejected values back to client POST /metric/data/raw/{resourceId}
Description
Submit a series of (numerical) metric values for a single resource to the serverParameters:
Name P.Type Description Required Type Allowed values Default value resourceId Path none int -all- -none- -body- A collection of numeric data point values with their metric definition name set. true Collection<NumericDataPoint> -all- -none- Return type: No response
Error codes:
Code Reason 403 Any metric from received dataPoints does not exist for given resource GET /metric/data/{scheduleId}/baseline
Description
Get the current baseline for the scheduleParameters:
Name P.Type Description Required Type Allowed values Default value scheduleId Path Id of the schedule true int all Return type: Baseline
Error codes:
Code Reason 404 No schedule with the passed id exists PUT /metric/data/{scheduleId}/baseline
Description
Set a new baseline for the scheduleParameters:
Name P.Type Description Required Type Allowed values Default value scheduleId Path Id of the schedule true int all -body- The baseline value. true Baseline -all- -none- Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No schedule with the passed id exists 406 Baseline data is incorrect
1.8. http://localhost:7080/rest/operation : Endpoints for operations.
These endpoints deal with scheduling of operations and retrieval of operation results.
Defining class: org.rhq.enterprise.server.rest.OperationsHandlerBean
Produces: application/json, application/xml
Methods
GET /operation/definition/{id}
Description
Retrieve a single operation definition by its idParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the definition to retrieve true int all resourceId Query Id of a resource that supports this operation false Integer all Return type: javax.ws.rs.core.Response
GET /operation/definitions
Description
List all operation definitions for a resourceSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value resourceId Query Id of the resource true Integer all Return type: javax.ws.rs.core.Response
POST /operation/definition/{id}
Description
Create a new (draft) operation from the passed definition id for the passed resourceParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the definition true int all resourceId Query Id of the resource true Integer all Return type: javax.ws.rs.core.Response
GET /operation/{id}
Description
Return a (draft) operationParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the operation to retrieve true int all Return type: javax.ws.rs.core.Response
PUT /operation/{id}
Description
Update a (draft) operation. If the state is set to 'ready', the operation will be scheduledParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the operation to update true int all -body- The operation definition to use for the update. true OperationRest -all- -none- Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 No draft operation with the passed id exists 406 Draft was set for scheduling, but parameters failed validation 200 Update was successful, operation was scheduled if requested DELETE /operation/{id}
Description
Delete a (draft) operationParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the operation to remove true int all Return type: javax.ws.rs.core.Response
GET /operation/history/{id}
Description
Return the outcome of the scheduled operationSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Name of the submitted job. true String all Return type: javax.ws.rs.core.Response
GET /operation/history
Description
Return the outcome of the executed operations for a resourceSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value resourceId Query Id of a resource to limit to false int all ps Query Page size for paging false int all 20 page Query Page for paging, 0-based false Integer all Return type: javax.ws.rs.core.Response
DELETE /operation/history/{id}
Description
Delete the operation history item with the passed idNotes
This operation is by default idempotent, returning 204.If you want to check if the job existed at all, you need to pass the 'validate' query parameter.
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Name for the submitted job true String all validate Query Validate if the job exists false boolean all false Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 204 Item was deleted or did not exist with validation not set 404 Item did not exist and validate was set 406 Passed Job ID did not pass name validation
1.9. http://localhost:7080/rest/plugins : Plugin related
This endpoint deals with RHQ's plugins
Defining class: org.rhq.enterprise.server.rest.PluginHandlerBean
Produces: application/json, application/xml
Methods
GET /plugins
Description
Looks for the plugins currently present in the system, optionally reloading them from the server's filesystemParameters:
Name P.Type Description Required Type Allowed values Default value name Query none String -all- -none- enabled Query Look for enabled, disabled or both kinds of plugins? false Boolean all version Query The version of the plugin to look for false String all deleted Query Whether to look for deleted, installed or both plugins false Boolean all false reload Query Whether to reload the plugins from the filesystem before performing the search. This can be used to take into effect the plugins that have been manually put into server's plugin "dropbox" directory. false boolean all ps Query Page size for paging false int all 20 page Query Page for paging, 0-based false Integer all Return type: javax.ws.rs.core.Response
GET /plugins/{id}
Description
Gets info about a single pluginParameters:
Name P.Type Description Required Type Allowed values Default value id Path The id of the plugin true int all Return type: javax.ws.rs.core.Response
PUT /plugins/{id}
Description
Updates the enablement of a plugin.Parameters:
Name P.Type Description Required Type Allowed values Default value id Path The id of the plugin true int all enabled Query true means plugin is enabled, false means plugin is disabled false boolean all Return type: javax.ws.rs.core.Response
DELETE /plugins/{id}
Description
Deletes a single plugin, optionally purging it.Parameters:
Name P.Type Description Required Type Allowed values Default value id Path The id of the plugin true int all Return type: javax.ws.rs.core.Response
POST /plugins
Description
Puts the plugin provided using a content handle into a dropbox and scans the dropbox for changes. In another words, this can result in more than just the provided plugin to become registered in the server if there were some unregistered plugins waiting in the dropbox directory. The content identified by the handle is NOT deleted afterwards.Parameters:
Name P.Type Description Required Type Allowed values Default value handle Query The handle retrieved from upload false String all name Query Name of the plugin file false String all Return type: javax.ws.rs.core.Response
POST /plugins/deploy
Description
Pushes out all the enabled plugins to all the agents running at that point in time. Defaults to start that process immediately. The returned string is a handle that can be used to check whether all the agents received the updated plugins.Parameters:
Name P.Type Description Required Type Allowed values Default value delay Query The delay in milliseconds before triggering the update on the agents false long all 0 Return type: javax.ws.rs.core.Response
GET /plugins/deploy/{handle}
Description
Checks whether the deployment to the agents identified by the provided handle has finished or not.Parameters:
Name P.Type Description Required Type Allowed values Default value handle Path The deploy handle true String all Return type: javax.ws.rs.core.Response
1.10. http://localhost:7080/rest/reports : Provide the reports that are also run from the Reports section of the UI. All reports are only available in CSV format
Defining class: org.rhq.enterprise.server.rest.ReportsHandlerBean
Produces: text/csv
Methods
GET /reports
Description
List the available reportsThis method has no parameters
Return type: String (multi)
GET /reports/alertDefinitions
Description
Export the AlertDefinitions as CSVSupports returning a gzip'ed Content-Encoding
This method has no parameters
Return type: String (multi)
GET /reports/configurationHistory
Description
Export the Configuration History data as CSVSupports returning a gzip'ed Content-Encoding
This method has no parameters
Return type: String (multi)
GET /reports/driftCompliance
Description
Export the drift compliance dataSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value resourceTypeId Query none String -all- -none- version Query none String -all- -none- Return type: String (multi)
GET /reports/inventorySummary
Description
Export the Inventory Summary data as CSVSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value resourceTypeId Query none String -all- -none- version Query none String -all- -none- Return type: String (multi)
GET /reports/platformUtilization
Description
Export the Platform utilization data as CSVSupports returning a gzip'ed Content-Encoding
This method has no parameters
Return type: String (multi)
GET /reports/recentAlerts
Description
Export the Recent Alert data as CSVSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value alertPriority Query none String -all- high,medium,low startTime Query none Long -all- -none- endTime Query none Long -all- -none- Return type: String (multi)
GET /reports/recentDrift
Description
Export the Recent drift data as CSVSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value categories Query Drift categories to report on false String FILE_ADDED, FILE_CHANGED, FILE_REMOVED snapshot Query none Integer -all- -none- path Query none String -all- -none- definition Query none String -all- -none- startTime Query none Long -all- -none- endTime Query none Long -all- -none- Return type: String (multi)
Error codes:
Code Reason 404 If no category is provided or the category is wrong GET /reports/recentOperations
Description
Export the Recent Operations Data as CSVSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value status Query Status to look for. If parameter is not given, all values are used false String all inprogress,success,failure,canceled startTime Query The start time in ms since epoch of the time range to export. false Long all endTime Query The end time in ms since epoch of the time range to export. Defaults to 'now' if only the start time is given false Long all Return type: String (multi)
GET /reports/suspectMetrics
Description
Export the Suspect Metrics data as CSVSupports returning a gzip'ed Content-Encoding
This method has no parameters
Return type: String (multi)
1.11. http://localhost:7080/rest/resource : Resource related
This endpoint deals with individual resources, not resource groups
Defining class: org.rhq.enterprise.server.rest.ResourceHandlerBean
Produces: application/json, application/xml, text/html, application/vnd.rhq.wrapped+json
Methods
GET /resource/{id:\d+}
Description
Retrieve a single resourceParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to retrieve true int all Return type: ResourceWithType
Error codes:
Code Reason 404 If no resource with the passed id exists PUT /resource/{id:\d+}
Description
Update a single resource or import a new resource from the discovery queue.Notes
You can either update a resource that is already in inventory, in which case the fieldsname, description and location can be updated. Or you can import a Platform or Server resource that is in state NEW.To do this you need to PUT the resource retrieved with a COMMITTED state
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to import true int all -body- Resource to update true ResourceWithType all Return type: ResourceWithType
Error codes:
Code Reason 404 If no resource with the passed id exists 406 Tried to update a resource that is not COMMITTED GET /resource/search
Description
Search for resources based on query parametersNotes
You can use any parameters based on org.rhq.core.domain.criteria.ResourceCriteria#addFilter*, , but note that only one value is passed to filter method (even if it may support multiple values). For example parameter name=value transforms to ResourceCriteria#addFilterName(value), parameter pluginName=value transforms to ResourceCriteria#addFilterPluginName(value). For some parameter names, following are equivalent : status=inventoryStatus, availability=currentAvailability, category=resourceCategories, plugin=pluginName, parentId=parentResourceId, parentName=parentResourceName, type=resourceTypeName. For example, to find all running AS7 Standalone Servers on a platform do GET /resource/search?parentId=10001&type=JBossAS7 Standalone Server&availability=UP
Supports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value ps Query Page size for paging false int all 20 page Query Page for paging, 0-based false Integer all 0 strict Query Enable strict filtering false boolean all false Return type: ResourceWithType
Error codes:
Code Reason 406 The passed inventory status was invalid GET /resource
Description
Search for resources by the given search string, possibly limited by category and pagedSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value q Query Limit results to param in the resource name false String all category Query Limit to category (PLATFORM, SERVER, SERVICE false String all ps Query Page size for paging false int all 20 page Query Page for paging, 0-based false Integer all 0 status Query Limit to Inventory status of the resources false String ALL, NEW, IGNORED, COMMITTED, DELETED, UNINVENTORIED COMMITTED Return type: ResourceWithType
Error codes:
Code Reason 406 The passed inventory status was invalid GET /resource/platforms
Description
List all platforms in the systemSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value ps Query Page size for paging false int all 20 page Query Page for paging, 0-based false Integer all 0 Return type: ResourceWithType (multi)
GET /resource/{id}/hierarchy
Description
Retrieve the hierarchy of resources starting with the passed oneSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to start with true int all Return type: ResourceWithType (multi)
Error codes:
Code Reason 404 If no resource with the passed id exists GET /resource/{id}/availability
Description
Return the current availability for the passed resourceParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to query true int all Return type: AvailabilityRest
Error codes:
Code Reason 404 If no resource with the passed id exists GET /resource/{id}/availability/history
Description
Return the availability history for the passed resourceSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to query true int all start Query Start time false long all 30 days ago end Query End time false long all Now Return type: AvailabilityRest (multi)
Error codes:
Code Reason 404 If no resource with the passed id exists GET /resource/{id}/availability/summary
Description
Return the availability history for the passed resourceParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to query true int all Return type: AvailabilitySummary
Error codes:
Code Reason 404 If no resource with the passed id exists PUT /resource/{id}/availability
Description
Set the current availability of the passed resourceParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to update true int all -body- New Availability setting true AvailabilityRest all Return type: void
GET /resource/{id}/schedules
Description
Get the metric schedules of the passed resource idSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to obtain the schedules for true int all type Query Limit by type false String <empty>, all, metric, trait, measurement all enabledOnly Query Limit by enabled schedules false boolean all true name Query Limit by name false String all Return type: MetricSchedule (multi)
Error codes:
Code Reason 404 If no resource with the passed id exists GET /resource/{id}/children
Description
Get the direct children of the passed resourceSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to get children true int all ps Query Page size for paging false int all 20 page Query Page for paging, 0-based false Integer all 0 q Query Limit results to param in the resource name false String all category Query Limit to category (PLATFORM, SERVER, SERVICE) false String all status Query Limit to Inventory status of the resources false String ALL, NEW, IGNORED, COMMITTED, DELETED, UNINVENTORIED COMMITTED Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 404 If no resource with the passed id exists GET /resource/{id}/alerts
Description
Get a list of links to the alerts for the passed resourceSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource to query true int all Return type: List<Link>
Error codes:
Code Reason 404 If no resource with the passed id exists POST /resource/platform/{name}
Description
Create a new platform in the Server. If the platform already exists, this is a no-op.The platform internally has a special name so that it will not clash with one that was generated via a normal RHQ agent. DEPRECATED Use POST /platforms insteadParameters:
Name P.Type Description Required Type Allowed values Default value name Path Name of the platform true String all -body- Type of the platform true StringValue Linux,Windows,... TODO Return type: javax.ws.rs.core.Response
POST /resource/platforms
Description
Create a new platform in the Server. If the platform already exists, this is a no-op.The platform internally has a special name so that it will not clash with one that was generated via a normal RHQ agent. Only resourceName and typeName need to be supplied in the passed objectParameters:
Name P.Type Description Required Type Allowed values Default value -body- The info about the platform. Only type name and resource name need to be supplied true ResourceWithType all Return type: javax.ws.rs.core.Response
POST /resource/{name}
Description
Create a resource with a given type below a certain parent. DEPRECATED Use POST / insteadParameters:
Name P.Type Description Required Type Allowed values Default value name Path Name of the new resource true String all -body- Name of the Resource type true StringValue all plugin Query Name of the plugin providing the type false String all parentId Query Id of the future parent to attach this to false int all Return type: javax.ws.rs.core.Response
POST /resource
Description
Create a new resource as a child of an existing resource.Notes
If a handle is given, a content based resource is created; the content identified by the handle is not removed from the content store.If no handle is given, a resource is created from the data of the passed 'resource' object.
Parameters:
Name P.Type Description Required Type Allowed values Default value -body- The info about the resource. You need to supply resource name, resource type name, plugin name, id of the parent true CreateCBResourceRequest all handle Query A handle that identifies content that has been uploaded to the server before. false String all Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 302 Creation is still happening. Check back with a GET on the Location. GET /resource/creationStatus/{id}
Description
Get the status of a resource creation for content based resources.Parameters:
Name P.Type Description Required Type Allowed values Default value id Path none int -all- -none- Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 302 Creation is still going on. Check back later with the same URL. DELETE /resource/{id}
Description
Remove a resource from inventoryNotes
This operation is by default idempotent, returning 204.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 none int -all- -none- physical Query none false boolean all false validate Query Validate that the resource exists false boolean all false Return type: javax.ws.rs.core.Response
Error codes:
Code Reason 204 Resource was removed or did not exist with validation not set 404 Resource did not exist and validate was set
1.12. http://localhost:7080/rest/resource/type : Resource type related
This endpoint deals with resource types
Defining class: org.rhq.enterprise.server.rest.ResourceTypeHandlerBean
Produces: application/json, application/xml
Methods
GET /resource/type/{id}
Description
Return information about the resource type with the passed idParameters:
Name P.Type Description Required Type Allowed values Default value id Path none int -all- -none- Return type: ResourceTypeRest
Error codes:
Code Reason 404 There is no type with the passed id GET /resource/type
Description
Search for resource typesSupports returning a gzip'ed Content-Encoding
Parameters:
Name P.Type Description Required Type Allowed values Default value q Query Limit results to param in the resource type name false String all plugin Query Limit results to the plugin with the passed name false String all ps Query Page size for paging false int all 20 page Query Page for paging, 0-based false Integer all Return type: ResourceTypeRest (multi)
1.13. http://localhost:7080/rest/status : Provide system status information
Defining class: org.rhq.enterprise.server.rest.StatusHandlerBean
Produces: application/json, application/xml, text/html
Methods
GET /status
Description
Retrieve the current configured state of the server along with some runtime information.Caller must have MANAGE_SETTINGS to access this endpoint.Supports returning a gzip'ed Content-Encoding
This method has no parameters
Return type: Map 'values' with map of key-value pairs describing the status
GET /status/server
Description
Get the operation mode of this serverThis method has no parameters
Return type: StringValue
1.14. http://localhost:7080/rest/user : Api that deals with user related stuff
Defining class: org.rhq.enterprise.server.rest.UserHandlerBean
Produces: application/json, application/xml, text/plain, text/html
Methods
GET /user/favorites/resource
Description
Return a list of favorite resources of the callerSupports returning a gzip'ed Content-Encoding
This method has no parameters
Return type: ResourceWithType (multi)
GET /user/favorites/group
Description
Return a list of favorite groups of the callerSupports returning a gzip'ed Content-Encoding
This method has no parameters
Return type: GroupRest (multi)
PUT /user/favorites/resource/{id}
Description
Add a resource as favorite for the callerParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource true int all Return type: void
PUT /user/favorites/group/{id}
Description
Add a group as favorite for the callerParameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the group true int all Return type: void
DELETE /user/favorites/resource/{id}
Description
Remove a resource from favoritesNotes
This operation is by default idempotent, returning 204.If you want to check if the resource was a favorite, you need to pass the 'validate' query parameter.
Parameters:
Name P.Type Description Required Type Allowed values Default value id Path Id of the resource true int all validate Query Validate if the resource is a favorite false boolean all false Return type: void
Error codes:
Code Reason 204 Resource was removed or was no favorite with validation not set 404 Resource was no favorite and validate was set DELETE /user/favorites/group/{id}
Description
Remove a group from favoritesNotes
This operation is by default idempotent, returning 204.If you want to check if the group was a favorite, 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 true int all validate Query Validate if the group is a favorite false boolean all false Return type: void
Error codes:
Code Reason 204 Group was removed or was no favorite with validation not set 404 Group was no favorite and validate was set GET /user/{id}
Description
Get info about a userParameters:
Name P.Type Description Required Type Allowed values Default value id Path Login of the user true String all Return type: UserRest
Chapter 2. REST API Data Classes
2.1. Data-Class: AlertConditionRest
One condition for an alert definition
Name | Type | Description |
---|---|---|
name | String | Comparator to use with this definition. See POST /alert/definition/{id}/condition for details. |
category | String | The category. See POST /alert/definition/{id}/condition for details. |
id | int | Id of the condition. Note that this is not stable - when you update the condition, its id will change |
threshold | Double | The threshold to compare against. See POST /alert/definition/{id}/condition for details. |
option | String | Options to this condition. Depends on the category used. See POST /alert/definition/{id}/condition for details. |
triggerId | Integer | |
comparator | String | Comparator for conditions. See POST /alert/definition/{id}/condition for details. |
measurementDefinition | int | The id of the measurement *definition*, this comparator should apply to. A metric schedule can be identified by a resource id and a definition id. |
2.2. Data-Class: AlertDefinitionRest
Representation of an AlertDefinition
Name | Type | Description |
---|---|---|
id | int | The id of the definition |
name | String | The name of the definition |
enabled | boolean | Is the definition enabled(=active)? |
priority | String | The priority of the definition |
recoveryId | int | Id of an alert definition to recover |
conditionMode | String | Expression to use for condition logic |
conditions | List<AlertConditionRest> | List of Conditions. Only sent if explicitly requested. |
notifications | List<AlertNotificationRest> | List of notifications. Only sent if explicitly requested. |
dampeningCategory | String | Category for dampening. ONCE means 'disable definition after firing' |
dampeningCount | int | Number of occurrences of an alert (in a given period). Valid values are > -1 |
dampeningPeriod | int | Period to check events. Only applicable for PARTIAL_COUNT, DURATION_COUNT, INVERSE_COUNT |
dampeningUnit | String | Unit of the dampening period. |
links | List<Link> |
2.3. Data-Class: AlertNotificationRest
Represents an alert notification definition
Name | Type | Description |
---|---|---|
id | int | Id of the definition. This will change if the notification is updated. |
senderName | String | A name taken from the <short-name> field of the plugin descriptor |
config | Map<String,Object> | Configuration that needs to be passed to the definition. |
extraConfig | Map<String,Object> |
2.4. Data-Class: AlertRest
This class represents a single fired alert.
Name | Type | Description |
---|---|---|
id | int | The id of the alert |
name | String | Name of the alert, taken from the AlertDefinition |
alertDefinition | AlertDefinitionRest | AlertDefinition from which the alert was fired |
definitionEnabled | boolean | Is the definition enabled (=active)? |
ackBy | String | The user that acknowledged the alert (if any) |
ackTime | long | Timestamp of the acknowledgement |
alertTime | long | Timestamp when the alert has been fired |
description | String | Description of the alert |
resource | ResourceWithType | The resource on which the alert was fired |
links | List<Link> |
2.5. Data-Class: AlertSender
Name | Type | Description |
---|---|---|
senderName | String | Name of the alert sender - this is also its unique identifier |
description | String | A description of this sender |
link | Link | |
configDefinition | Map<String,String> | The configuration definition of the sender |
2.6. Data-Class: AvailabilityRest
Represents the availability of a resource
Name | Type | Description |
---|---|---|
since | long | Time since the type is valid |
type | String | Type of availability |
resourceId | int | Id of the resource that reports the availability |
until | Long | Time until the type is valid. May be null if type is ongoing |
2.7. Data-Class: AvailabilitySummary
Describes the availability summary for a resource
Name | Type | Description |
---|---|---|
current | org.rhq.core.domain.measurement.AvailabilityType | |
disabled | int | |
disabledTime | long | |
downTime | long | |
failures | int | |
lastChange | long | |
links | List<Link> | |
currentTime | long | |
resourceId | int | |
unknownTime | long | |
upTime | long | |
disabledPercentage | double | |
downPercentage | double | |
knownTime | long | |
mtbf | long | |
mttr | long | |
upPercentage | double |
2.8. Data-Class: Baseline
Representation of a metric baseline/-band
Name | Type | Description |
---|---|---|
min | double | The lower value of the base band |
max | double | The higher value of the base band |
mean | double | The baseline value (i.e. the average of the metrics |
computeTime | long | Time this value was computed |
2.9. Data-Class: CallTimeValueRest
One callTime data point of a metric (aka schedule)
Name | Type | Description |
---|---|---|
beginTime | long | Time in milliseconds since epoch when the request occurred |
callDestination | String | Destination URI of request |
duration | long | Time in milliseconds - duration of request |
2.10. Data-Class: CreateCBResourceRequest
A request to create a content-based resource. For this to work, it is required that the content to be deployed is already uploaded to the server.
Name | Type | Description |
---|---|---|
pluginConfig | Map<String,Object> | The configuration of the connection properties |
resourceConfig | Map<String,Object> | The configuration of the resource to be created |
2.11. Data-Class: DoubleValue
Encapsulates a simple double value. In XML this is represented as <value value="..."/>
Name | Type | Description |
---|---|---|
value | Double | The actual value |
2.12. Data-Class: EventDefinitionRest
An Event definition
Description: You can retrieve an EventDefinition and with its name create new EventSources for that resource
Name | Type | Description |
---|---|---|
id | int | |
name | String | The name of the definition, used to create EventSources |
displayName | String | |
description | String |
2.13. Data-Class: EventRest
This class represents one event.
Name | Type | Description |
---|---|---|
id | int | RHQ-Internal Id of the event |
detail | String | The message to be transmited |
sourceId | int | Id of the source on retrieval. When adding new events, this parameter is ignored. |
timestamp | long | Time in milliseconds since epoch when the event occurred |
severity | String | Severity of the event. Allowed values are DEBUG, INFO, WARN, ERROR, FATAL |
2.14. Data-Class: EventSourceRest
This class represents an EventSource - e.g. a log file.
Name | Type | Description |
---|---|---|
id | int | Id of the EventSource |
name | String | Name of the EventSource - defined in the definition. This is required when adding a new EventSource |
displayName | String | Display name of the EventSource - defined in the definition |
location | String | 'Location' of the EventSource. This is e.g. the path to the log file being monitored. This is required when adding a new EventSource |
resourceId | int | Id of the resource this |
description | String | A description of this EventSource |
2.15. Data-Class: GroupDefinitionRest
One DynaGroup definition
Name | Type | Description |
---|---|---|
id | int | The id of the definition |
name | String | The name of the definition |
description | String | A description of the definition |
expression | List<String> | Individual lines of the group expression |
recalcInterval | long | Interval in ms at which the expression should be re-evaluated. A value of 0 means no recalculation. |
generatedGroupIds | List<Integer> | List of ids for the groups generated by this group expression |
recursive | boolean | Is this definition generating rescursive groups? |
links | List<Link> |
2.16. Data-Class: GroupRest
Representation of a resource group
Name | Type | Description |
---|---|---|
id | int | Id of the group |
name | String | Name of the group |
resourceTypeId | Integer | ResourceType id for compatible groups |
recursive | boolean | True if the group is recursive (i.e. includes child resources |
category | org.rhq.core.domain.resource.group.GroupCategory | Category of the group. |
links | List<Link> | |
dynaGroupDefinitionId | int | Id of a DynaGroup definition if the group was defined by a DynaGroup. |
explicitCount | int | Number of explicitly added resources in the group |
implicitCount | int | Number of resources in the group (explict + children for a recursive group |
2.17. Data-Class: IntegerValue
Encapsulates a simple integer value. In XML this is represented as <value value="..."/>
Name | Type | Description |
---|---|---|
value | Integer | The actual value |
2.18. Data-Class: Link
Link between two resources
Name | Type | Description |
---|---|---|
rel | String | Name of the relation |
href | String | Target of the relation |
2.19. Data-Class: MetricAggregate
An aggregate of metrics data for a given schedule
Name | Type | Description |
---|---|---|
dataPoints | List<MetricAggregate.DataPoint> | List of individual data points |
min | Double | Minimum value for the data |
avg | Double | Average value for the data |
max | Double | Maximum value for the data |
numDataPoints | int | Number of data points i.e. size of the dataPoints list |
scheduleId | Integer | Id of the metric |
minTimeStamp | long | Timestamp of the earliest data point in the list |
maxTimeStamp | long | Timestamp for the latest data point in the list |
group | boolean | Determines if this is data for a group |
2.20. Data-Class: MetricDefinitionAggregate
An aggregate of metrics data for a given metric definition (for a group)
Name | Type | Description |
---|---|---|
min | Double | Minimum value for the data |
avg | Double | Average value for the data |
max | Double | Maximum value for the data |
definitionId | Integer | Id of the metric *definition* |
minTimeStamp | long | Timestamp of the earliest data point in the list |
maxTimeStamp | long | Timestamp for the latest data point in the list |
2.21. Data-Class: MetricSchedule
A single metrics schedule
Description: A schedule represents the collection interval for a metric and if the collection is enabled
Name | Type | Description |
---|---|---|
scheduleId | int | The id of the schedule |
scheduleName | String | The name of the metric |
enabled | Boolean | Is the collection enabled? |
collectionInterval | long | The collection interval in milliseconds |
displayName | String | The name of the metric as shown in the UI |
unit | String | The base unit of the metric |
type | String | Type of metric |
definitionId | int | |
mtime | long | Last modification timestamp of the schedule |
links | List<Link> |
2.22. Data-Class: NumericDataPoint
One numerical data point of a metric (aka schedule)
Name | Type | Description |
---|---|---|
timeStamp | long | The timestamp when the metric was taken |
value | Double | The numerical value |
scheduleId | int | The id of the metric |
2.23. Data-Class: OperationDefinitionRest
The template from which operations are created
Name | Type | Description |
---|---|---|
name | String | Name of the definition |
id | int | Id of the definition |
links | List<Link> | |
params | List<SimplePropDef> | List of properties for this operation definition |
2.24. Data-Class: OperationHistoryRest
Denotes the outcome of an operation that has been scheduled to run.
Name | Type | Description |
---|---|---|
status | String | The status of the history |
result | Map<String,Object> | Map with key/value pairs for the operation result |
errorMessage | String | Error message if the operation was not successful |
links | List<Link> | |
operationName | String | Name of the operation that was run |
resourceName | String | Name of the resource the operation was run on |
lastModified | long | |
jobId | String | Job-ID of this history item |
2.25. Data-Class: OperationRest
Represents an operation to be scheduled.
Description: You use this object to prepare the operation to be scheduled. The object is derived from an OperationDefinition. When you are ready preparing,you need to set 'readyToSubmit' to true.
Name | Type | Description |
---|---|---|
id | int | Id of the operation schedule |
name | String | Name of the operation |
readyToSubmit | boolean | Is this schedule ready to finally be submitted (and thus be scheduled to run) |
resourceId | int | The id of the resource the operation should run |
definitionId | int | The id of the operation definition this schedule was created from |
params | Map<String,Object> | A key/value map of parameters. Keys are strings. The map is populated at the time the schedule is created from its definition |
links | List<Link> |
2.26. Data-Class: PluginRest
Represents an agent plugin installed in RHQ.
Name | Type | Description |
---|---|---|
id | int | |
name | String | |
displayName | String | |
version | String | |
enabled | boolean | |
status | org.rhq.core.domain.plugin.PluginStatusType | |
links | List<Link> |
2.27. Data-Class: ResourceTypeRest
A resource type
Name | Type | Description |
---|---|---|
createPolicy | org.rhq.core.domain.resource.CreateDeletePolicy | |
dataType | org.rhq.core.domain.resource.ResourceCreationDataType | |
id | int | |
links | List<Link> | |
name | String | |
pluginName | String |
2.28. Data-Class: ResourceWithChildren
One resource with its direct child resources
Name | Type | Description |
---|---|---|
id | String | Id of the resource |
name | String | Name of the resource |
children | List<ResourceWithChildren> | List of child resources |
2.29. Data-Class: ResourceWithType
One resource
Name | Type | Description |
---|---|---|
resourceName | String | Name of the resource |
resourceId | int | ID of the resource |
typeName | String | Name of the resource type of the resource |
typeId | Integer | Id of the resource type of the resource |
pluginName | String | Name of the plugin defining the resource type |
parentId | Integer | Id of the parent resource. Can be null if there is no parent (i.e. the category is platform |
status | String | Inventory status of the resource. |
links | List<Link> | |
ancestry | String | The ancestry gives the path to the root resource |
availability | String | The availability of the resource at the time of retrieval. Please note that when caching the resource, this value may become outdated. |
location | String | The location of the resource (e.g. data center / rack |
description | String | A description of the resource |
2.30. Data-Class: SimplePropDef
A simple property definition
Description: This bean is e.g. used for parameters of operations
Name | Type | Description |
---|---|---|
name | String | The name of the property |
required | boolean | Indicates if the property is required i.e. has to have a value set |
type | org.rhq.core.domain.configuration.definition.PropertySimpleType | The type of the property |
defaultValue | String | The string representation of a default value if defined. |
2.31. Data-Class: Status
Place holder for the system status
Name | Type | Description |
---|---|---|
values | Map<String,String> | Contains the status as a map of key/value pairs |
2.32. Data-Class: StringValue
Encapsulates a simple string value. In XML this is represented as <value value="..."/>
Name | Type | Description |
---|---|---|
value | String | The actual value |
2.33. Data-Class: UserRest
Information about a user in RHQ
Name | Type | Description |
---|---|---|
id | int | The ID of the user |
login | String | The login name of the user |
tel | String | The telephone number of the user |
String | The email address of the user | |
firstName | String | The first name of the user |
lastName | String | The last name of the user |