Constructing the resynchronization event query

To receive resynchronization events from OMi, the probe sends an HTTP request.

The URI in the HTTP request consists of the following parameters: query, start_index, page_size, data ordering flags, and data inclusion flags. These are described in the table that follows.

Table 1. Parameters used in the resynchronization HTTP request

Parameters in the request

Description

query=

The query expression is configured in the ResyncEventQuery property.

start_index=

This is a running number. The first request’s start_index is always 1. Each subsequent request’s start_index is the previous start_index plus the page_size.

page_size=

This value is configured by the PageSize property. The OMi system receives this number with the first request from the probe and uses this value as the batch size for the query results.

order_by=

order_direction=

These parameters allow you to specify which OMi field the resynchronization events are sorted by and whether they are sorted in ascending or descending order. They are configured by the ResyncDataOrder property using the following format:

<field>:<order_direction>, for example: time_changed:descending

include_closed

include_relationships

include_cis

include_history

include_annotations

These parameters allow you to specify which of the event attributes to include in the resynchronization.

They are configured by the ResyncDataInclusion property. For details about how to format the ResyncDataInclusion property see Including and ordering data in the resynchronization query.

Validating and formatting the resynchronization event query expression

The FormatEventQuery property controls whether the expression specified in the ResyncEventQuery property will be validated and formatted for use in the resynchronization request sent to the OMi system.

When FormatEventQuery is set to true, the probe processes the ResyncEventQuery expression in the following order: validation and formatting.

Each valid query expression can consist of multiple filter query statements joined by the symbols: ^ or | enclosed by parentheses.

Note: ^ represents AND; | represents OR.

Each filter query must comply with the OMi standard.

Validation: The probe checks the syntax of the entire query expression.

Note: The query expression validation process has the following limitations:
  • It does not recognize the syntax "<field> IN (value1, value2,…)" as valid.
  • It does not accept the characters( ) | ^ in quoted value, for example id="(abc)" will be declared an error.

Formatting: The probe converts ^ (caret) and | (pipe) symbols to AND and OR respectively, and encodes the query expression with URL escape characters where necessary.

If FormatEventQuery is set to true, you can write more readable filter expressions without having to manually replace characters with URL escape codes.

The ResyncEventQuery property’s default value is: 'time_changed GE ++LAST_TIMESTAMP++ ^ time_changed LT ++CURRENT_TIME++’.

++LAST_TIMESTAMP++ and ++CURRENT_TIME++ are special tokens recognized by the probe’s query expression parser.

In formatting query expressions, the probe encodes certain characters to URL escape codes and replaces ^ with AND.

The resultant expression is:

time_changed%20GE%202017-11-10T12:34:56.789%2B08:00%20AND%20 time_changed%20LT%202017-11-16T01:23:45.678%2B08:00

The date-time format is: yyyy-MM-ddThh:mm.ss.SSS+hh:mm, SSS is millisecond; +hh:mm is timezone offset from GMT, for example:

http://<omi_host>/opr-web/rest/event_list?query=time_changed%20GE%202017-11-10T12:34:56.789%2B08:00%20AND%20 time_changed%20LT%202017-11-16T01:23:45.678%2B08:00& &page_size=10&start_index=1

When ResyncEventQuery is left blank, the probe will receive all open events from OMi.

If you want to send an event query to OMi without the probe performing syntax validation and URL encoding, set FormatEventQuery to false. If you do this, you must ensure that the expression is syntactically correct and contains URL escape codes. Take care to escape the % character in the property configuration, for example, if the query in URI is:

“time_changed%20GE%202017-11-10T12:34:56.789%2B08:00”,

the ResyncEventQuery property should be set to:

“time_changed%%20GE%%202017-11-10T12:34:56.789%%2B08:00”