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