Get events for a CI
Search events API (POST method) uses the POST method to search the events for a specified CI. It searches the events based on the input parameters provided in the JSON format.
You also have the option of sorting the search results. You must provide authentication credentials by using the login API before accessing the data. For information about authentication, see Web-services-authentication.
URL to access the search events API (POST method)
The generic format of a URL for search events API (POST method) is as follows:
http|https://<serverHost>:<port>/bppmws/api/CI/<CI_ID>/getEvents?
eventType=IMPACTING/ALL/DIRECT
Entry | Description |
---|---|
http|https | Type of protocol to send the request. BMC TrueSight Infrastructure Management web services support both HTTP and HTTPS protocols. |
serverHost | Host name of the Infrastructure Management Server |
port | Port number through which communication is established. The default port number is 80 if you use the HTTP protocol and 443 if you use the HTTPS protocol. |
Available query parameters (Optional) | |
idType | The supported value is RECON_ID. |
eventType | Type of events to be searched. The supported values are IMPACTING, ALL, and DIRECT. The default value is DIRECT. |
Input parameters in the JSON format for the search events API (POST method)
When you provide input parameters for any web service request, you must specify the content-type parameter in the header of the web service request as follows:
Sample input parameters in the JSON format are as follows:
Sample input parameters for the search events API (POST method) without sort criteria
"criteria": {
"value": "CRITICAL",
"identifier": "severity",
"operator": "EQUALS"
}
}
Sample input parameters for the search events API (POST method) with sort criteria
"sortCriteria": [
{
"sortOrder": 1,
"attributeName": "date_reception"
}
],
"criteria": {
"groupingOperator": "AND",
"leftExpression": {
"value": "bppm1r",
"identifier": "mc_host",
"operator": "EQUALS"
},
"rightExpression": {
"value": "admin",
"identifier": "mc_owner",
"operator": "equals"
}
}
}
Attributes | Description |
---|---|
totalResultCount | Total number of events to be searched. The default value is 200. You can change this by modifying the value of maxEventsResultCount parameter in the bppmws.properties file. |
startIndex | The start index of the list from where events have to be searched. The default value is 1. |
className | Name of the event class from which the events have to be searched. This is mandatory and it will display an error message if it is not specified. |
slotList | The list of slots to be searched from the Cell. By default, it will return all the available and visible slots, with their values. |
sortCriteria | Condition based on which search results are sorted. You can define up to three sort criteria. If two or more entries match the first criterion, sorting happens based on the second and third criteria. This parameter is optional.https://docs.bmc.com/docs/display/proactivenet95/Retrieving+searchable+slots+and+supported+enumerations+for+each+slot#Retrievingsearchableslotsandsupportedenumerationsforeachslot-61742 |
sortOrder | Type of sorting. It can either be ascending or descending. The supported values are as follows:
1 indicates ascending sort, and 2 indicates descending sort. |
attributeName | Slot name based on which the search results are sorted For example, if the value of attributeName parameter is CLASS and the value of sortOrder parameter is 1, the search results are sorted in the ascending order based on the values of class slot. |
criteria | Conditions based on which the events are searched. You can have a single condition using identifier, operator, and value parameters or nested conditions using the leftExpression, groupingOperator, and rightExpression parameters. |
groupingOperator | Boolean operator. The supported Boolean operators are as follows:
For example, if you use the AND operator, both the leftExpression condition and the rightExpression condition must be fulfilled for an event to match the search criteria. |
leftExpression | One of the conditions based on which the events are searched |
value | String to search |
identifier | Slot name of an event. All the specified slot values are searched for the specified string. You can use the usage API to know the supported values of any slot. |
operator | Condition that relates the identifier and value parameters To know the supported operators for an identifier, you can use the usage API. |
rightExpression | One of the conditions based on which the events are searched |
JSON response to the search events API (POST method)
A sample JSON response is as follows:
"responseList": [
{
"serverName": "BPPM_Server_1",
"cellName": "pncell_server1",
"statusCode": "200",
"statusMsg": "OK",
"list": [
{
"className": "<EVENT class name>",
"attributes": {
"mc_ueid": "mc.ueid.cellname.101",
"mc_object": "cell",
"mc_tool": "EVENT",
"mc_object_uri": "http://myapps:89/tester",
"mc_event_category": "AVAILABILITY_MANAGEMENT",
"severity": "WARNING",
"msg": "Event message",
"mc_original_severity": "OK",
"mc_original_priority": "PRIORITY_5",
"mc_smc_id": "vw-pun-sms-dv05_1",
"mc_object_owner": "admin",
"mc_owner": "admin",
"mc_priority": "PRIORITY_4",
"status": "OPEN"
}
}
]
}
],
"statusCode": "200",
"statusMsg": "OK",
"apiVersion": "10.0.0",
"responseTimeStamp": "2012-08-05T07:10:31"
}