- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- API - SmartConsole CLI - usual script commands lik...
- 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
API - SmartConsole CLI - usual script commands like error check, if then etc.
Hi,
I am sorry, but the API reference does not point out how to check for error codes, breaks, doing loops etc.
As the CLi window allows to open a file, which implies you are able to use more then one command, my expectation would be to be able to control the flow. Found no excamples. Everything I found was shell based stuff with mgmt_cli.
My actual issue i.e is to install several policies one after the other. The issue is, when the script command finished, the real task has not finished yet. So you get an error only one install can run the same time.
But this is only one example I struggled with earlier.
I've tried shell commands, but the seems not to be allowed. Did I found a further limitation of the API?
- Labels:
-
General
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would check out the usage examples by Python cp_mgmt_api_python_sdk/examples_python3 at master · CheckPointSW/cp_mgmt_api_python_sdk · GitHub or Java cp-mgmt-api-java-sdk/samples/clone_host at master · CheckPointSW/cp-mgmt-api-java-sdk · GitHub .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. Regarding error codes/breaks/loops etc.:
This has to be done by your scripting. You can't do such things inside the window provided by SmartConsole CLI. You have to use either mgmt_cli binary or REST API.
2. Regarding access from mgmt_cli
The default API setting only allows access from localhost. Means through SmartConsole CLI or from the CLISH/BASH from the management server itself using mgmt/mgmt_cli command.
To enable access from IPs which are defined as GUI client (trusted client) or from anywhere, please refere to API documentation:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The API (and consequentially mgmt_cli and the SmartConsole CLI) is not a scripting language.
It follows the principles of REST: You send it a query, it gives you a response based on that query.
Processing the results of the query (and deciding what to do next) is a function of the program/script you write that calls the API.
The SmartConsole CLI is not a general purpose scripting engine, it merely allows you to make API calls with no scripting logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would check out the usage examples by Python cp_mgmt_api_python_sdk/examples_python3 at master · CheckPointSW/cp_mgmt_api_python_sdk · GitHub or Java cp-mgmt-api-java-sdk/samples/clone_host at master · CheckPointSW/cp-mgmt-api-java-sdk · GitHub .
