<?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: policyCleanUp.py issue in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56679#M3643</link>
    <description>&lt;P&gt;You need to add "&lt;SPAN class="pl-s"&gt;--port&lt;/SPAN&gt; 4434" when running the script to connect to non-default port.&lt;/P&gt;&lt;P&gt;By default, it will connect to port 443.&lt;/P&gt;&lt;P&gt;/Sigbjorn&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2019 07:54:13 GMT</pubDate>
    <dc:creator>Sigbjorn</dc:creator>
    <dc:date>2019-06-26T07:54:13Z</dc:date>
    <item>
      <title>policyCleanUp.py issue</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56652#M3639</link>
      <description>&lt;P&gt;Hi there, Pretty new to Checkpoint API/Scripting but was trying to do a policy cleanup and this looks like it could be a huge help.&lt;/P&gt;&lt;P&gt;-Running directly on SMS R80.20 M2&lt;BR /&gt;-Check Point API Python SDK&amp;nbsp;added and variable set&lt;/P&gt;&lt;P&gt;Ran&amp;nbsp;policyCleanUp.py multiple ways - but to keep it simple examples below&lt;/P&gt;&lt;P&gt;as User&amp;nbsp;&lt;/P&gt;&lt;P&gt;# python policyCleanUp.py -op plan&lt;BR /&gt;[2019-06-25 22:39:10] Failed to login. Error: APIResponse received a response which is not a valid JSON.&lt;/P&gt;&lt;P&gt;User has access to management api in user settings, API is set to accept from all IP addresses&lt;/P&gt;&lt;P&gt;using the root flag&lt;/P&gt;&lt;P&gt;# python policyCleanUp.py -op plan -r true&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "policyCleanUp.py", line 1118, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;BR /&gt;File "policyCleanUp.py", line 989, in main&lt;BR /&gt;check_validation_for_mds(client, user_args.domain)&lt;BR /&gt;File "policyCleanUp.py", line 935, in check_validation_for_mds&lt;BR /&gt;if int(api_res.data.get('total')) != 0:&lt;BR /&gt;AttributeError: 'NoneType' object has no attribute 'get'&lt;/P&gt;&lt;P&gt;Any ideas? This seemed like it would be really helpful to run for me.&lt;BR /&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 02:47:35 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56652#M3639</guid>
      <dc:creator>Shawn_Fletcher</dc:creator>
      <dc:date>2019-06-26T02:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: policyCleanUp.py issue</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56654#M3640</link>
      <description>Most likely you have not enabled the API to be usable from hosts other than localhost.&lt;BR /&gt;You can confirm this with the command api status on the management server.&lt;BR /&gt;To fix this problem, see: &lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Enabling-web-api/m-p/32641/highlight/true#M2011" target="_blank"&gt;https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Enabling-web-api/m-p/32641/highlight/true#M2011&lt;/A&gt;</description>
      <pubDate>Wed, 26 Jun 2019 03:07:56 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56654#M3640</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-06-26T03:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: policyCleanUp.py issue</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56655#M3641</link>
      <description>&lt;P&gt;i think i did but let me know if this is wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# api status&lt;/P&gt;&lt;P&gt;API Settings:&lt;BR /&gt;---------------------&lt;BR /&gt;Accessibility: Require all granted&lt;BR /&gt;Automatic Start: Enabled&lt;/P&gt;&lt;P&gt;Processes:&lt;/P&gt;&lt;P&gt;Name State PID More Information&lt;BR /&gt;-------------------------------------------------&lt;BR /&gt;API Started 9954&lt;BR /&gt;CPM Started 7079 Check Point Security Management Server is running and ready&lt;BR /&gt;FWM Started 24951&lt;BR /&gt;APACHE Started 7453&lt;/P&gt;&lt;P&gt;Port Details:&lt;BR /&gt;-------------------&lt;BR /&gt;JETTY Internal Port: 50277&lt;BR /&gt;APACHE Gaia Port: 4434 (a non-default port)&lt;BR /&gt;When running mgmt_cli commands add '--port 4434'&lt;BR /&gt;When using web-services, add port 4434 to the URL&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;Overall API Status: Started&lt;BR /&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;API readiness test SUCCESSFUL. The server is up and ready to receive connections&lt;/P&gt;&lt;P&gt;Notes:&lt;BR /&gt;------------&lt;BR /&gt;To collect troubleshooting data, please run 'api status -s &amp;lt;comment&amp;gt;'&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 03:20:51 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56655#M3641</guid>
      <dc:creator>Shawn_Fletcher</dc:creator>
      <dc:date>2019-06-26T03:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: policyCleanUp.py issue</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56658#M3642</link>
      <description>You'll probably have to modify the script to use a non-standard port.&lt;BR /&gt;While I'm not familiar with the script, it probably assumes port 443, not 4434.</description>
      <pubDate>Wed, 26 Jun 2019 04:35:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56658#M3642</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-06-26T04:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: policyCleanUp.py issue</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56679#M3643</link>
      <description>&lt;P&gt;You need to add "&lt;SPAN class="pl-s"&gt;--port&lt;/SPAN&gt; 4434" when running the script to connect to non-default port.&lt;/P&gt;&lt;P&gt;By default, it will connect to port 443.&lt;/P&gt;&lt;P&gt;/Sigbjorn&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 07:54:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56679#M3643</guid>
      <dc:creator>Sigbjorn</dc:creator>
      <dc:date>2019-06-26T07:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: policyCleanUp.py issue</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56722#M3645</link>
      <description>&lt;P&gt;thank you both, clearly i should have caught that but definitely the solution&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 13:32:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/policyCleanUp-py-issue/m-p/56722#M3645</guid>
      <dc:creator>Shawn_Fletcher</dc:creator>
      <dc:date>2019-06-26T13:32:34Z</dc:date>
    </item>
  </channel>
</rss>

