REST API
JBoss Operations Network 3.2
for developing remote clients
Copyright © 2013 Red Hat, Inc.
December 4, 2013
Abstract
This is an API reference for the REST interface. The REST interfaces provides a more flexible, scalable, and dynamic way to create remote clients and monitoring consoles.
Base path (if not otherwise specified) : http://localhost:7080/rest
1. http://localhost:7080/rest/: Root Context
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
- application/json
- application/xml
- text/html
- application/vnd.rhq.wrapped+json
1.1. GET //index
Return links from the root /index of the REST-resource tree
- Parameters
- None
- Return Type
- javax.ws.rs.core.Response
1.2. GET /
Return links from the root / of the REST-resource tree
- Parameters
- None
- Return Type
- javax.ws.rs.core.Response
2. 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
- application/vnd.rhq.wrapped+json
- text/html
- Methods
- application/json
- application/xml
- application/vnd.rhq.wrapped+json
- text/html
2.1. GET /alert/definition
Redirects to /alert/definitions
- Parameters
- None
- Return Type
- javax.ws.rs.core.Response
2.2. GET /alert/definitions
List all Alert Definition
Supports 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 |
- Return Type
- AlertDefinitionRest (multi)
2.3. GET /alert/definition/{id}
Get one AlertDefinition by ID
- Parameters
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. |
2.4. POST /alert/definitions
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 options
- Parameters
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 | Section 14.2, “Data-Class: 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 |
2.5. PUT /alert/definition/{id}
Update the alert definition (priority, enablement, dampening, recovery)
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 | Section 14.2, “Data-Class: AlertDefinitionRest” | all |
- Return Type
- javax.ws.rs.core.Response
- Error Codes
Code | Reason |
---|---|
404 | No AlertDefinition with the passed ID exists |
2.6. DELETE /alert/definition/{id}
Delete an alert definition
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 |
2.7. DELETE /alert/condition/{cid}
Remove an alert condition
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 |
2.8. POST /alert/definition/{id}/conditions
Add a new alert condition to an existing alert definition
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 | Section 14.1, “Data-Class: 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 |
2.9. PUT /alert/condition/{cid}
Update an existing condition of an alert definition.Note that the update will change the ID of the condition
- Parameters
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 | Section 14.1, “Data-Class: 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 |
2.10. GET /alert/condition/{cid}
Retrieve a condition of an alert definition by its condition ID
- Parameters
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 |
2.11. GET /alert/notification/{nid}
Return a notification definition by its ID
- Parameters
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 |
2.12. DELETE /alert/notification/{nid}
Remove a notification definition
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 |
2.13. PUT /alert/notification/{nid}
Update a notification definition
- Parameters
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 | Section 14.3, “Data-Class: AlertNotificationRest” | all |
- Return Type
- javax.ws.rs.core.Response
- Error Codes
Code | Reason |
---|---|
404 | There is no notification with the passed ID |
2.14. POST /alert/definition/{id}/notifications
Add a new notification definition to an alert definition
- Parameters
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 | Section 14.3, “Data-Class: 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 |
2.15. GET /alert/senders
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
- Parameters
- None
- Return Type
- javax.ws.rs.core.Response
2.16. GET /alert/sender/{name}
Return an alert notification sender by name. This includes information about the configuration it expects
Supports 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 |
3. http://localhost:7080/rest/alert: 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
- application/json
- application/xml
- text/html
- application/vnd.rhq.wrapped+json
3.1. GET /alert
List all alerts, possibly limiting by resource or alert definition, priority and start time
Supports 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 |
- 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 |
3.2. GET /alert/count
Return a count of alerts in the system depending on criteria
- Parameters
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
3.3. GET /alert/{id}
Get one alert with the passed ID
- Parameters
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
3.4. GET /alert/{id}/conditions
Return the condition logs for the given alert
- Parameters
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
3.5. GET /alert/{id}/notifications
Return the notification logs for the given alert
- Parameters
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
3.6. PUT /alert/{id}
Mark the alert as acknowledged (by the caller)
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
3.7. DELETE /alert/{id}
Remove the alert from the list of alerts
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 |
3.8. GET /alert/{id}/definition
Get the alert definition (basics) for the alert
- Parameters
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
4. http://localhost:7080/rest/content: Content
This endpoint deals with content (upload)
- Defining Class
- org.rhq.enterprise.server.rest.ContentHandlerBean
- Produces
- application/json
- application/xml
- Methods
- application/json
- application/xml
4.1. POST /content/fresh
Upload content to the server. This will return a handle that can be used later to retrieve and further process the content
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
contentStream | -body- | none | java.io.InputStream | -all- | -none- |
- Return Type
- javax.ws.rs.core.Response
4.2. GET /content/{handle}/info
Retrieve the length of the content with the passed handle
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
handle | Path | none | String | -all- | -none- |
- Return Type
4.3. PUT /content/{handle}/plugins
Put the uploaded content into the plugin drop box.
This endpoint allows to deploy previously uploaded content as a plugin. You need to providea valid plugin (file) name in order for the plugin processing to succeed. Optionally you canrequest that a plugin scan will be started and the plugin be registered in the system.The content identified by the handle is not removed.
- 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 |
- Return Type
- javax.ws.rs.core.Response
- Error Codes
Code | Reason |
---|---|
406 | No name provided |
404 | No content for handle found |
403 | Caller has not rights to upload plugins |
4.4. DELETE /content/{handle}
Remove the content with the passed handle
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 |
5. http://localhost:7080/rest/event: Events, SNMP Traps, and Logs
- Defining Class
- org.rhq.enterprise.server.rest.EventHandlerBean
- Produces
- application/json
- application/xml
- text/html
- application/vnd.rhq.wrapped+json
- Methods
- application/json
- application/xml
- text/html
- application/vnd.rhq.wrapped+json
5.1. GET /event/{id}/sources
List the defined event sources for the resource
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
id | Path | id of the resource | true | int | all |
- Return Type
- EventSourceRest (multi)
5.2. GET /event/{id}/definitions
List the defined event source definitions for the resource
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
id | Path | id of the resource | true | int | all |
- Return Type
- EventDefintionRest (multi)
5.3. GET /event/source/{id}
Retrieve the event source with the passed ID
- Parameters
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 |
5.4. POST /event/{id}/sources
Add a new event source for a resource. This can e.g. be a different logfile. The source.name must match an existing definition fo 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 | |
esr | -body- | none | Section 14.13, “Data-Class: EventSourceRest” | -all- | -none- |
- Return Type
- 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 |
5.5. DELETE /event/source/{id}
Delete the event source with the passed ID
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 |
5.6. GET /event/source/{id}/events
List the events for the event source with the passed ID. If no time range is given, the last 200 entries will be displayed
Supports 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)
5.7. GET /event/{id}/events
List the events for the resource with the passed ID. If no time range is given, the last 200 entries will be displayed
Supports 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)
5.8. POST /event/source/{id}/events
Submit multiple events for one given event source; the event source in the passed Events is ignored.
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
id | Path | Id of the source to add data to | true | int | all | |
eventRest | -body- | none | Section 14.12, “Data-Class: EventRest” | -all- | -none- |
- Return Type
- javax.ws.rs.core.Response
6. http://localhost:7080/rest/group: Groups and Dynamic Groups
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
- application/json
- application/xml
- text/html
- application/vnd.rhq.wrapped+json
6.1. GET /group
List all groups
Supports 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)
6.2. GET /group/{id}
Get the group with the passed ID
- 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 passed ID not found |
6.3. POST /group
Create a new group
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
-body- | A GroupRest object containing at least a name for the group | true | Section 14.15, “Data-Class: 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 |
6.4. PUT /group/{id}
Update the passed group. Currently only name change is supported
- Parameters
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 | Section 14.15, “Data-Class: 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 |
6.5. DELETE /group/{id}
Delete the group with the passed ID
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 |
6.6. GET /group/{id}/resources
Get the resources of the group
Supports 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 |
6.7. PUT /group/{id}/resource/{resourceId}
Add a resource to an existing group
If you have created the group as a compatible group and a resource type was provided on creation, only resources with this typemay 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 |
6.8. DELETE /group/{id}/resource/{resourceId}
Remove the resource with the passed ID from the group
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 |
6.9. GET /group/{id}/metricDefinitions
Get the metric definitions for the compatible group with the passed ID
Supports 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 |
6.10. GET /group/definitions
List all existing GroupDefinitions
Supports 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)
6.11. GET /group/definition/{id}
Retrieve a single GroupDefinition by ID
Supports 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. |
6.12. DELETE /group/definition/{id}
Delete the GroupDefinition with the passed ID
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 |
6.13. POST /group/definitions
Create a new GroupDefinition.
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 |
---|---|---|---|---|---|---|
definition | -body- | none | Section 14.14, “Data-Class: 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 |
6.14. PUT /group/definition/{id}
Update or recalculate an existing GroupDefinition
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 recalcIntervalof 0 means no recalculation.
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
id | Path | Id fo the definition to update | true | int | all | |
recalculate | Query | If true, trigger a re-calculation | false | boolean | all | false |
definition | -body- | none | Section 14.14, “Data-Class: 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 |
7. http://localhost:7080/rest/metric: 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
- application/json
- application/xml
- text/html
7.1. GET /metric/data/{scheduleId}
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 |
7.2. GET /metric/data/group/{groupId}/{definitionId}
Get the bucketized metric values for the metric definition of the group
Supports 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
7.3. GET /metric/data
Return bucketized metric data (60 points) for the passed schedules
Supports 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 |
7.4. GET /metric/schedule/{id}
Get the metric schedule for the passed ID
- Parameters
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 |
7.5. GET /metric/data/resource/{resourceId}
Retrieve a list of high/low/average/data aggregates for the resource
Supports 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
- Error Codes
Code | Reason |
---|---|
404 | If no resource with the passed ID exists |
7.6. GET /metric/data/group/{groupId}
Retrieve a list of high/low/average/data aggregates for the group
Supports 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
- Error Codes
Code | Reason |
---|---|
404 | There is no group with the passed ID |
7.7. PUT /metric/schedule/{id}
Update the schedule (enabled, interval)
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
id | Path | Id of the schedule to query | true | int | all | |
-body- | New schedule data | true | Section 14.20, “Data-Class: MetricSchedule” | all |
- Return Type
- MetricSchedule
- Error Codes
Code | Reason |
---|---|
404 | No schedule with the passed ID exists |
7.8. GET /metric/data/{scheduleId}/raw
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 |
7.9. PUT /metric/data/{scheduleId}/raw/{timeStamp}
Submit a single (numerical) metric to the server
- Parameters
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 | Section 14.10, “Data-Class: 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 |
7.10. PUT /metric/data/{scheduleId}/trait/{timeStamp}
Submit a new trait value for the passed schedule ID
- Parameters
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 | Section 14.30, “Data-Class: 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 |
7.11. GET /metric/data/{scheduleId}/trait
Get the current value of the trait with the passed schedule ID
- Parameters
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 |
7.12. POST /metric/data/raw
Submit a series of (numerical) metric values to the server
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
points | -body- | none | Section 14.21, “Data-Class: NumericDataPoint” | -all- | -none- |
- Return Type
- No response
7.13. POST /metric/data/raw/{resourceId}
Submit a series of (numerical) metric values for a single resource to the server
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
resourceId | Path | The ID of the resource. | int | -all- | -none- | |
points | -body- | The list of objects, ordered by Timestamp, Value, then Metric order: [{"timestamp":<metric_timestamp>, "value":<metric_value>, "metric":<metric_name>}, ...] | Datapoint | -all- | -none- |
- Return Type
- No response
7.14. GET /metric/data/{scheduleId}/baseline
Get the current baseline for the schedule
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
scheduleId | Path | Id of the schedule | true | int | all |
- Return Type
- Error Codes
Code | Reason |
---|---|
404 | No schedule with the passed ID exists |
7.15. PUT /metric/data/{scheduleId}/baseline
Set a new baseline for the schedule
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
scheduleId | Path | Id of the schedule | true | int | all | |
baseline | -body- | none | Section 14.8, “Data-Class: 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 |
8. http://localhost:7080/rest/operation: Operations and Results
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
- application/json
- application/xml
8.1. GET /operation/definition/{id}
Retrieve a single operation definition by its ID.
- Parameters
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
8.2. GET /operation/definitions
List all operation definitions for a resource
Supports 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
8.3. POST /operation/definition/{id}
Create a new (draft) operation from the passed definition ID for the passed resource
- Parameters
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
8.4. GET /operation/{id}
Return a (draft) operation
- Parameters
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
8.5. PUT /operation/{id}
Update a (draft) operation. If the state is set to 'ready', the operation will be scheduled
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
id | Path | Id of the operation to update | true | int | all | |
operation | -body- | none | Section 14.24, “Data-Class: 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 |
8.6. DELETE /operation/{id}
Delete a (draft) operation
- Parameters
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
8.7. GET /operation/history/{id}
Return the outcome of the scheduled operation
Supports 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
8.8. GET /operation/history
Return the outcome of the executed operations for a resource
Supports 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
8.9. DELETE /operation/history/{id}
Delete the operation history item with the passed ID
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 fo 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 |
9. http://localhost:7080/rest/reports: Reports
These are the deault reports configured in JBoss ON, such as suspect metrics, unavailable resources, and recent alerts. All report information is returned in a CSV file.
- Defining Class
- org.rhq.enterprise.server.rest.ReportsHandlerBean
- Produces
- text/csv
- Methods
- text/csv
9.1. GET /reports
List the available reports
- Parameters
- None
- Return Type
- String (multi)
9.2. GET /reports/alertDefinitions
Export the AlertDefinitions as CSV
Supports returning a gzip'ed Content-Encoding
- Parameters
- None
- Return Type
- String (multi)
9.3. GET /reports/configurationHistory
Export the Configuration History data as CSV
Supports returning a gzip'ed Content-Encoding
- Parameters
- None
- Return Type
- String (multi)
9.4. GET /reports/driftCompliance
Export the drift compliance data
Supports 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)
9.5. GET /reports/inventorySummary
Export the Inventory Summary data as CSV
Supports 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)
9.6. GET /reports/platformUtilization
Export the Platform utilization data as CSV
Supports returning a gzip'ed Content-Encoding
- Parameters
- None
- Return Type
- String (multi)
9.7. GET /reports/recentAlerts
Export the Recent Alert data as CSV
Supports 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)
9.8. GET /reports/recentDrift
Export the Recent drift data as CSV
Supports 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 |
9.9. GET /reports/recentOperations
Export the Recent Operations Data as CSV
Supports 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)
9.10. GET /reports/suspectMetrics
Export the Suspect Metrics data as CSV
Supports returning a gzip'ed Content-Encoding
- Parameters
- None
- Return Type
- String (multi)
10. http://localhost:7080/rest/resource: Resources
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
- application/json
- application/xml
- text/html
- application/vnd.rhq.wrapped+json
10.1. GET /resource/{id:\d+}
Retrieve a single resource
- Parameters
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 |
10.2. PUT /resource/{id:\d+}
Update a single resource or import a new resource from the discovery queue.
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 | Section 14.27, “Data-Class: 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 |
10.3. GET /resource
Search for resources by the given search string, possibly limited by category and paged
Supports 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 | |
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 |
10.4. GET /resource/platforms
List all platforms in the system
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 |
- Return Type
- ResourceWithType (multi)
10.5. GET /resource/{id}/hierarchy
Retrieve the hierarchy of resources starting with the passed one
Supports 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 |
10.6. GET /resource/{id}/availability
Return the current availability for the passed resource
- Parameters
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 |
10.7. GET /resource/{id}/availability/history
Return the availability history for the passed resource
Supports 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 |
10.8. GET /resource/{id}/availability/summary
Return the availability history for the passed resource
- Parameters
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 |
10.9. PUT /resource/{id}/availability
Set the current availability of the passed resource
- Parameters
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 | Section 14.6, “Data-Class: AvailabilityRest” | all |
- Return Type
- void
10.10. GET /resource/{id}/schedules
Get the metric schedules of the passed resource ID
Supports 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 |
10.11. GET /resource/{id}/children
Get the direct children of the passed resource
Supports 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 |
- Return Type
- javax.ws.rs.core.Response
- Error Codes
Code | Reason |
---|---|
404 | If no resource with the passed ID exists |
10.12. GET /resource/{id}/alerts
Get a list of links to the alerts for the passed resource
Supports 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
- Error Codes
Code | Reason |
---|---|
404 | If no resource with the passed ID exists |
10.13. POST /resource/platform/{name}
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 generatedvia a normal JBoss ON agent. DEPRECATED Use POST /platforms instead
- Parameters
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 | Section 14.30, “Data-Class: StringValue” | Linux,Windows,... TODO |
- Return Type
- javax.ws.rs.core.Response
10.14. POST /resource/platforms
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 generatedvia a normal JBoss ON agent. Only resourceName and typeName need to be supplied in the passed object
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
-body- | The information about the platform. Only type name and resource name need to be supplied | true | Section 14.27, “Data-Class: ResourceWithType” | all |
- Return Type
- javax.ws.rs.core.Response
10.15. POST /resource/{name}
Create a resource with a given type below a certain parent. DEPRECATED Use POST / instead
- Parameters
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 | Section 14.30, “Data-Class: 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
10.16. POST /resource
Create a new resource as a child of an existing resource.
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 information about the resource. You need to supply resource name, resource type name, plugin name, ID of the parent | true | Section 14.9, “Data-Class: CreateCBRresourceRequest” | 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. |
10.17. GET /resource/creationStatus/{id}
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. |
10.18. DELETE /resource/{id}
Remove a resource from inventory
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 |
11. http://localhost:7080/rest/resource/type: Resource Types
This endpoint deals with resource types.
- Defining Class
- org.rhq.enterprise.server.rest.ResourceTypeHandlerBean
- Produces
- application/json
- application/xml
- Methods
- application/json
- application/xml
11.1. GET /resource/type/{id}
Return information about the resource type with the passed ID
- Parameters
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 |
11.2. GET /resource/type
Search for resource types
Supports 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)
12. http://localhost:7080/rest/status: Server Status
- Defining Class
- org.rhq.enterprise.server.rest.StatusHandlerBean
- Produces
- application/json
- application/xml
- text/html
- Methods
- application/json
- application/xml
- text/html
12.1. GET /status
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
- Parameters
- None
- Return Type
- Map 'values' with map of key-value pairs describing the status
12.2. GET /status/server
Get the operation mode of this server
- Parameters
- None
- Return Type
13. http://localhost:7080/rest/user: Users and Favorites
- Defining Class
- org.rhq.enterprise.server.rest.UserHandlerBean
- Produces
- application/json
- application/xml
- text/plain
- text/html
- Methods
- application/json
- application/xml
- text/plain
- text/html
13.1. GET /user/favorites/resource
Return a list of favorite resources of the caller
Supports returning a gzip'ed Content-Encoding
- Parameters
- None
- Return Type
- ResourceWithType (multi)
13.2. GET /user/favorites/group
Return a list of favorite groups of the caller
Supports returning a gzip'ed Content-Encoding
- Parameters
- None
- Return Type
- GroupRest (multi)
13.3. PUT /user/favorites/resource/{id}
Add a resource as favorite for the caller
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
id | Path | Id of the resource | true | int | all |
- Return Type
- void
13.4. PUT /user/favorites/group/{id}
Add a group as favorite for the caller
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
id | Path | Id of the group | true | int | all |
- Return Type
- void
13.5. DELETE /user/favorites/resource/{id}
Remove a resource from favorites
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 |
13.6. DELETE /user/favorites/group/{id}
Remove a group from favorites
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 |
13.7. GET /user/{id}
Get information about a user.
- Parameters
Name | P.Type | Description | Required | Type | Allowed values | Default value |
---|---|---|---|---|---|---|
id | Path | Login of the user | true | String | all |
- Return Type
- UserRest
14. Data Classes
14.1. Data-Class: AlertConditionRest
One condition for an alert definition
Name | Type | Description |
---|---|---|
name | String | Comparator to use with this definition. See POST /alert/defintion/{id}/condition for details. |
category | String | The category. See POST /alert/defintion/{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/defintion/{id}/condition for details. |
option | String | Options to this condition. Depends on the category used. See POST /alert/defintion/{id}/condition for details. |
triggerId | Integer | |
comparator | String | Comparator for conditions. See POST /alert/defintion/{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. |
14.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> |
14.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. |
14.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> |
14.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 |
14.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 |
14.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 |
14.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 |
14.9. Data-Class: CreateCBRresourceRequest
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 |
14.10. Data-Class: DoubleValue
Encapsulates a simple double value. In XML this is represented as <value value=""/>
Name | Type | Description |
---|---|---|
value | Double | The actual value |
14.11. 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 |
14.12. 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 millis since epoch when the event occurred |
severity | String | Severity of the event. Allowed values are DEBUG, INFO, WARN, ERROR, FATAL |
14.13. Data-Class: EventSourceRest
This class represents an EventSource - e.g. a logfile.
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 logfile being monitored. This is required when adding a new EventSource |
resourceId | int | Id of the resource this |
description | String | A description of this EventSource |
14.14. 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> |
14.15. 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 |
14.16. Data-Class: IntegerValue
Encapsulates a simple integer value. In XML this is represented as <value value=""/>
Name | Type | Description |
---|---|---|
value | Integer | The actual value |
14.17. Data-Class: Link
Link between two resources
Name | Type | Description |
---|---|---|
rel | String | Name of the relation |
href | String | Target of the relation |
14.18. Data-Class: MetricAggregate
An aggregate of metrics data for a given schedule
Name | Type | Description |
---|---|---|
dataPoints | List<MetricAggregate.DataPoint> | List of indiviudual 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 fo the latest data point in the list |
group | boolean | Determines if this is data for a group |
14.19. 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 fo the latest data point in the list |
14.20. 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> |
14.21. 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 |
14.22. 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 |
14.23. 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 fo 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 |
14.24. 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> |
14.25. 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 |
14.26. 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 |
14.27. 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 |
14.28. 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. |
14.29. 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 |
14.30. Data-Class: StringValue
Encapsulates a simple string value. In XML this is represented as <value value=""/>
Name | Type | Description |
---|---|---|
value | String | The actual value |
14.31. Data-Class: UserRest
Information about a user in JBoss ON
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 |