- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2017 11:54 AM
hi
We are on Helsinki. Can someone please help and show me how to add Not Equal to condition to REST API url?
Please see the url below. And I want to filter out sys_class_name = Hyper-V Server from the result set. (i.e. sys_class_name =! 'Hyper-V Server')
The way I have added it, doesn't work.
Please advise.
Thanks,
Rajan Mehta
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2017 01:34 PM
I'm not on my computer right now, so I don't know the system name of the host name field, but the easiest way to build your query is go to cmdb_ci_list.do in your instance. Then use the filter to add all of the conditions you want and verify your results are correct.
then right click the filter text and click copy query. This will copy the encoded query for you, and then you can put that right after sysparm_query= in your URL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2017 01:08 PM
Rajan, you need to use the same as I typed exactly for it to work - you typed the hyper v server class name like the display value, but you need to use the one I suggested. Use cmdb_ci_hyper_v_server. Try that and let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2017 01:19 PM
Thanks Jonathan,
Awesome. That did work. Now I have one more condition to add to URL. Can you please guide me how or where do I add that?
Need to add condition host name contains "netapp" need to be exclude from the result.
Can I add at the end or it has to be with sysparm_query?
please advise.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2017 01:34 PM
I'm not on my computer right now, so I don't know the system name of the host name field, but the easiest way to build your query is go to cmdb_ci_list.do in your instance. Then use the filter to add all of the conditions you want and verify your results are correct.
then right click the filter text and click copy query. This will copy the encoded query for you, and then you can put that right after sysparm_query= in your URL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2017 01:45 PM
Perfect Jonathan.
That did help.
Thanks,
Rajan Mehta
