Check Point API Python Development Kit simplifies the use of the Check Point Management APIs. The kit contains the API library files, and sample files demonstrating the capabilities of the library. The kit is compatible with python 2 and 3.
cpapi
- the API library project.
add_access_rule
- demonstrates a basic flow of using the APIs: performs a login command, adds an access rule to the top of the access policy layer, and publishes the changes.
clone_host
- demonstrates cloning and replacing an existing host with a cloned host.
discard_sessions
- demonstrates how to discard the changes to the database for un-published sessions.
find_duplicate_ip
- demonstrates searching for all the hosts that share the same IP address.
Install the SDK by using the pip tool or by downloading the repository.
Run:
pip install git+https://github.com/CheckPointSW/cp_mgmt_api_python_sdk
Clone the repository with this command:
git clone https://github.com/CheckPointSW/cp_mgmt_api_python_sdk
or by clicking on the ‘Download ZIP’ button and using unzip.
Navigate to .../cp_mgmt_api_python_sdk/
directory and run:
pip install .
Upgrade the SDK by using pip tool:
pip install --upgrade git+https://github.com/CheckPointSW/cp_mgmt_api_python_sdk
Uninstall the SDK by using pip tool:
pip uninstall cpapi
Follow the instructions above in the "Download the repository" section, to download the repository but do not run pip install .
After the downloading, copy the SDK to the machine (use scp, WinSCP or similar tool).
Configure your environment variables
export PYTHONPATH=$PYTHONPATH:<“CP-SDK” FULL PATH>
For example, if you copied the SDK to the path “/home/admin/” the command will be:
export PYTHONPATH=$PYTHONPATH:/home/admin/cp_mgmt_api_python_sdk/
The kit is developed using Python versions 2.7 and 3.7