Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
hugoparedes
Explorer

API search

Hello,

We are running 80.30. I am trying to use the API to search for example objects.

-- Is there a way I can search objects which contains ==? instead of exact which is the default?

-- Also in 80.30 can I search multiple cross domain?

=======================================

#!/usr/bin/env python3
#This script was created by

import http.client
import requests
import json
import ssl

ssl._create_default_https_context = ssl._create_unverified_context

conn = http.client.HTTPSConnection("x.x.x.x", 443)
payload = json.dumps({
"name": "ENTER THE NAME HERE",   <<<--- SEARCH CONTAINS INSTEAD OF EXACT
# "domain": "DMZ-Americas"
})
headers = {
'Content-Type': 'application/json',
'X-chkp-sid': 'SID_HERE'
}
conn.request("POST", "/web_api/where-used", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

0 Kudos
3 Replies
PhoneBoy
Admin
Admin

where-used is searching for usage of a precise object.
It is not used to find objects that contain a specific name.
You should use show objects with the filter parameter to achieve that.

To do a cross-domain search in R80.30, you need to use a script like: https://community.checkpoint.com/t5/API-CLI-Discussion/MDS-Global-search-across-CMAs-by-IP/m-p/75906
Otherwise, upgrade to R81, which has this functionality built into the API.

0 Kudos
hugoparedes
Explorer

Is there a way I can contact you directly?

0 Kudos
PhoneBoy
Admin
Admin

You can send me a PM, but it would definitely be best to reach out to your Check Point SE.
If you need help figuring out who that is, let me know.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events