ServiceNowITOM / ansible-sn-inventory

Ansible Dynamic Inventory for ServiceNow
Apache License 2.0
79 stars 45 forks source link

add SN_FILTER_RESULTS option #23

Closed epicanthal closed 5 years ago

epicanthal commented 5 years ago

5 @ursetto @metabsd @amittell @stumpr

I have the use case that @ursetto describes, i.e. limiting for performance, both in the time it takes for results to be return, but also limiting the stress on my company's instance.

ursetto commented 5 years ago

Looks just like my local solution except I called it query / SN_QUERY instead of filter_results / SN_FILTER_RESULTS. This functionality is definitely useful.

The only bad part is that complex queries look weird due to urlencoding and .ini escaping; for example percent signs need to be doubled (line break inserted for clarity):

sys_class_nameINcmdb_ci_linux_server%%2Ccmdb_ci_unix_server
%%2Ccmdb_ci_solaris_server^operational_status!=6

You might want to note in your doc that percent signs should be doubled in the filter string in the config file.

epicanthal commented 5 years ago

Done, thanks. Hopefully @amittell is amenable to this addition. If so, maybe he has a preference for naming this option.