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.
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
Example
http://bppmwsserver:80/bppmws/api/CI/bppmh_123/
getEvents?eventType=IMPACTING
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. |
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:
content-type application/json
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" } } }
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" }