- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- show services-tcp conflicting answers
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
show services-tcp conflicting answers
Hi,
I get different results when using the Web Services API contra the mgmt_cli.
Eg. when asking for total number of tcp services, I get 'total': 217 when using the API and "total" : 225 when asking via the CLI.
Same goes for other services eg. "Other".
It seems that API only returns objects created by the system and CLI returns all objects.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How precisely are you constructing the API query?
Show the full query you are making with all arguments.
How precisely are you constructing the mgmt_cli query? (Which also uses the API)
Show the full CLI command used.
What version/JHF level of management is this against?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi PhoneBoy,
API call is done with Python3's request-module, like this,
request:
url = https://ip-address/web_api/show-services-tcp
json_payload = {"limit" : 300, "offset" : 0, "details-level" : "uid"}
request_headers = {'Content-Type' : 'application/json', 'X-chkp-sid' : sessionID}
response = requests.post(url, json = json_payload, headers=request_headers)<200b>
response:
...
'total': 217
CLI call from SmartConsole,
request:
show services-tcp
response:
...
total: 226
The firewall is running R81.10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are exceeding the default limit for that API call.
These limits exist to ensure the API server remains performant and should not be exceeded.
When you do, you may see the inconsistent results you are observing.
The proper way to get all the results is to make multiple API calls using the limit/offset parameters to ensure you get all the results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi again,
I've tried using the default limit(50), same result:
API:
to: 50
total: 226
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like @Bob_Zimmerman mentioned, best to diff the output between the two and see what the differences are.
I also recommend a TAC case.
@Omer_Kleinstern
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @SuneB ,
Are you using a Multi-Domain Server?
Is the same administrator running the API and SmartConsole CLI?
Thanks,
Omer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dump the results from both to files and diff them.
Are any services in the network call results but not the SmartConsole call results?
Which services are in the SmartConsole call results but not the network call results?
