<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Checkpoint Python SDK in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96589#M5151</link>
    <description>&lt;P&gt;Hi Simon - Martin was saying to create a folder on your management server and call it "cpapi". Then download all of the files API into it like the instructions say on the github page.&lt;/P&gt;
&lt;P&gt;Example CPAPI path: /home/admin/cpapi&lt;/P&gt;
&lt;P&gt;If you put your script in this folder: /home/admin/&lt;/P&gt;
&lt;P&gt;This should allow it to find the CPAPI module. See the example I did using the find_dup_ip.py sample script:&lt;/P&gt;
&lt;P&gt;[Expert@mgmt-sa1:0]# pwd&lt;BR /&gt;/home/admin&lt;/P&gt;
&lt;P&gt;[Expert@mgmt-sa1:0]# ls -d c*&lt;BR /&gt;cpapi&lt;/P&gt;
&lt;P&gt;[Expert@mgmt-sa1:0]# cd cpapi/&lt;BR /&gt;[Expert@mgmt-sa1:0]# ls&lt;BR /&gt;__init__.py __init__.pyc api_exceptions.py api_exceptions.pyc api_response.py api_response.pyc cli.py mgmt_api.py mgmt_api.pyc utils.py utils.pyc&lt;/P&gt;
&lt;P&gt;[Expert@mgmt-sa1:0]# cd ..&lt;BR /&gt;[Expert@mgmt-sa1:0]# python find_dup_ip.py&lt;BR /&gt;Enter server IP address or hostname:x.x.x.x&lt;BR /&gt;Enter username: admin&lt;BR /&gt;Enter password:&lt;BR /&gt;Processing. Please wait...&lt;/P&gt;
&lt;P&gt;Saving data to debug file api_calls.json&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;List of Duplicate IP addresses:&lt;BR /&gt;-------------------------------&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Fri, 11 Sep 2020 15:52:31 GMT</pubDate>
    <dc:creator>Joseph_Audet</dc:creator>
    <dc:date>2020-09-11T15:52:31Z</dc:date>
    <item>
      <title>Checkpoint Python SDK</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96533#M5148</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Can the Checkpoint python sdk for the management api be installed or references on the management server itself?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to automate the execution of some python scripts for&amp;nbsp;policy maintenance from AWX against the management server using the ansible&amp;nbsp; cp_mgmt_run_script module. This module requires you to specify a&amp;nbsp;target host in the playbook, which in this case is the management server itself.&lt;/P&gt;&lt;P&gt;It will then attempt to run the script locally from the target host (mgmt server).&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I've copied the scripts to a location on the management server, however when I try to run them the mgmt server report the require module cpapi is missing - which was expected as the sdk is not installed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The README.md in the github site (&lt;A href="https://github.com/CheckPointSW/cp_mgmt_api_python_sdk" target="_blank"&gt;https://github.com/CheckPointSW/cp_mgmt_api_python_sdk&lt;/A&gt;) refers to configuring the sdk on a management machine - not sure 100 what this would be. It requires you to download then sdk (not install it using pip), then configure a reference to it in an environment variable.&lt;/P&gt;&lt;P&gt;export PYTHONPATH=$PYTHONPATH:/home/admin/cp_mgmt_api_python_sdk/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 02:56:46 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96533#M5148</guid>
      <dc:creator>Simon_Macpherso</dc:creator>
      <dc:date>2020-09-11T02:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Checkpoint Python SDK</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96539#M5149</link>
      <description>&lt;P&gt;it's enough to create folder called "cpapi" and put those files to it and script which will be running in same folder where "cpapi" is located it will load it.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 06:29:46 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96539#M5149</guid>
      <dc:creator>Martin_Valenta</dc:creator>
      <dc:date>2020-09-11T06:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Checkpoint Python SDK</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96545#M5150</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;Can you please explain that in a bit more detail.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 06:57:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96545#M5150</guid>
      <dc:creator>Simon_Macpherso</dc:creator>
      <dc:date>2020-09-11T06:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Checkpoint Python SDK</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96589#M5151</link>
      <description>&lt;P&gt;Hi Simon - Martin was saying to create a folder on your management server and call it "cpapi". Then download all of the files API into it like the instructions say on the github page.&lt;/P&gt;
&lt;P&gt;Example CPAPI path: /home/admin/cpapi&lt;/P&gt;
&lt;P&gt;If you put your script in this folder: /home/admin/&lt;/P&gt;
&lt;P&gt;This should allow it to find the CPAPI module. See the example I did using the find_dup_ip.py sample script:&lt;/P&gt;
&lt;P&gt;[Expert@mgmt-sa1:0]# pwd&lt;BR /&gt;/home/admin&lt;/P&gt;
&lt;P&gt;[Expert@mgmt-sa1:0]# ls -d c*&lt;BR /&gt;cpapi&lt;/P&gt;
&lt;P&gt;[Expert@mgmt-sa1:0]# cd cpapi/&lt;BR /&gt;[Expert@mgmt-sa1:0]# ls&lt;BR /&gt;__init__.py __init__.pyc api_exceptions.py api_exceptions.pyc api_response.py api_response.pyc cli.py mgmt_api.py mgmt_api.pyc utils.py utils.pyc&lt;/P&gt;
&lt;P&gt;[Expert@mgmt-sa1:0]# cd ..&lt;BR /&gt;[Expert@mgmt-sa1:0]# python find_dup_ip.py&lt;BR /&gt;Enter server IP address or hostname:x.x.x.x&lt;BR /&gt;Enter username: admin&lt;BR /&gt;Enter password:&lt;BR /&gt;Processing. Please wait...&lt;/P&gt;
&lt;P&gt;Saving data to debug file api_calls.json&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;List of Duplicate IP addresses:&lt;BR /&gt;-------------------------------&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 11 Sep 2020 15:52:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96589#M5151</guid>
      <dc:creator>Joseph_Audet</dc:creator>
      <dc:date>2020-09-11T15:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Checkpoint Python SDK</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96683#M5152</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/25384"&gt;@Joseph_Audet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did this on Friday and it works.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 04:03:40 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96683#M5152</guid>
      <dc:creator>Simon_Macpherso</dc:creator>
      <dc:date>2020-09-14T04:03:40Z</dc:date>
    </item>
  </channel>
</rss>

