<?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: Python tool for exporting specific types of objects from the management server in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38772#M2326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We have decided to continue maintaining this useful tool, fixed some bugs and uploaded the source code to GitHub repo (the link on top of the page).&lt;/P&gt;&lt;P&gt;Enjoy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Nov 2017 12:40:46 GMT</pubDate>
    <dc:creator>Robert_Decker</dc:creator>
    <dc:date>2017-11-20T12:40:46Z</dc:date>
    <item>
      <title>Python tool for exporting specific types of objects from the management server</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38766#M2320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H2&gt;Overview&lt;/H2&gt;&lt;P style="color: #24292e; margin-bottom: 16px;"&gt;This&amp;nbsp;tool enables you to export specific types of objects from a R80.10 Management database to a .csv file, which can then be imported into any other R80.10 Management database.&lt;/P&gt;&lt;P style="color: #24292e; margin-bottom: 16px;"&gt;This tool can be used for backups, database transfers, testing, and more.&lt;/P&gt;&lt;P style="color: #24292e; margin-bottom: 16px;"&gt;A typical run of the script to export all hosts will be along the lines of:&lt;/P&gt;&lt;P style="color: #24292e; margin-bottom: 16px;"&gt;export_hosts.py -m [management server IP] -o hosts.csv&lt;/P&gt;&lt;P style="color: #24292e; margin-bottom: 16px;"&gt;A lot more details can of course be accessed with the '-h' option.&lt;/P&gt;&lt;P style="color: #24292e; margin-bottom: 16px;"&gt;Later on, to import these hosts into other R80.10 Management database, you execute the command mgmt_cli with the batch flag [-b]:&lt;/P&gt;&lt;P style="color: #24292e; margin-bottom: 16px;"&gt;mgmt_cli add host -b hosts.csv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2 style="color: #000000; background-color: #ffffff; border: 0px; font-weight: 600; font-size: 22px; padding: 0px;"&gt;Tested on version&lt;/H2&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px; padding: 0px;"&gt;R80.10&lt;/P&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px; padding: 0px;"&gt;API version 1.1&amp;nbsp;&lt;/P&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;H2 style="color: #000000; background-color: #ffffff; border: 0px; font-weight: 600; font-size: 22px; padding: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: bold; font-size: 22px; padding: 0px;"&gt;&lt;STRONG&gt;Source Code Availability&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/H2&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px; padding: 0px;"&gt;The source code is now public on GitHub repository:&lt;/P&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px; padding: 0px;"&gt;&lt;A href="https://github.com/CheckPoint-APIs-Team/ExportObjects"&gt;ExportObjects Tool&lt;/A&gt;&lt;/P&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px; padding: 0px;"&gt;&lt;/P&gt;&lt;H2&gt;&lt;STRONG&gt;NOTICE: &lt;/STRONG&gt;&lt;SPAN style="font-size: 10.6667px; color: #999999;"&gt;&lt;STRONG&gt;By using this sample code you agree to terms and conditions in this &lt;A href="https://community.checkpoint.com/docs/DOC-1042"&gt;Terms and Conditions&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/H2&gt;&lt;P style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 12:01:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38766#M2320</guid>
      <dc:creator>Inbar_Moskovich</dc:creator>
      <dc:date>2016-10-13T12:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting specific types of objects from the management server</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38767#M2321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I got this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$ python export_hosts.py -m CP-MGMT&amp;nbsp;-o hosts.csv --port 18190&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Trying to get login credentials...&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Trying to login via `mgmt_cli login -r true`.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Trying to get username and password.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Enter username: admdevitog&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Enter password:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Got the following login credentials:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; Username: ************&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; Password: ************&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; Session ID: None&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Traceback (most recent call last):&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; File "export_hosts.py", line 15, in &amp;lt;module&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; get_objects("hosts", fields)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; File "/cygdrive/c/Users/************/Desktop/Fdown/import_export_objects/get_objects.py", line 129, in get_objects&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; output_file, output_file_format, user_created, client, args = process_args_and_login(showparameter=showparameter, fields=fields)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; File "/cygdrive/c/Users/************/Desktop/Fdown/import_export_objects/get_objects.py", line 68, in process_args_and_login&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; raise mgmt_api_lib.APIClientException("The server's fingerprint is different than your local record of it. The script cannot operate in this unsecure manner (unless running with --unsafe). Exiting...")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;mgmt_api_lib.api_exceptions.APIClientException: The server's fingerprint is different than your local record of it. The script cannot operate in this unsecure manner (unless running with --unsafe). Exiting...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jul 2017 12:23:45 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38767#M2321</guid>
      <dc:creator>Giuseppe_Devito</dc:creator>
      <dc:date>2017-07-28T12:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting specific types of objects from the management server</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38768#M2322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try this :&lt;BR /&gt;1.Delete the following files:&lt;BR /&gt;get_objects.pyc&lt;BR /&gt;get_objects.log&lt;BR /&gt;fingerprints.txt&lt;BR /&gt;hosts.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Run&lt;/P&gt;&lt;P&gt;# python export_hosts.py -m &amp;lt;IP&amp;gt; -o hosts.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;For working scenario , you should see :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You currently do not have a record of this server's fingerprint.&lt;BR /&gt;Server's fingerprint: &amp;lt;XXXXXXXXX&amp;gt;&lt;BR /&gt;&lt;STRONG&gt;Do you accept this fingerprint? [y/n] y&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Fingerprint saved.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;1 object received.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Done.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jul 2017 06:06:38 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38768#M2322</guid>
      <dc:creator>Ofir_Shikolski</dc:creator>
      <dc:date>2017-07-30T06:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting specific types of objects from the management server</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38769#M2323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have a problem. :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\import_export_objects&amp;gt;export_hosts.py -m 192.168.20.90 -o hosts.csv&lt;BR /&gt;Trying to get login credentials...&lt;BR /&gt;Trying to login via `mgmt_cli login -r true`.&lt;BR /&gt;Trying to get username and password.&lt;BR /&gt;Enter username: admin&lt;BR /&gt;Enter password:&lt;BR /&gt;Got the following login credentials:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Username: admin&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Password: *********&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session ID: None&lt;BR /&gt;50/33159 objects retrieved.&lt;BR /&gt;100/33159 objects retrieved.&lt;BR /&gt;150/33159 objects retrieved.&lt;BR /&gt;200/33159 objects retrieved.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ...&amp;nbsp; &lt;BR /&gt;4750/33159 objects retrieved.&lt;BR /&gt;4800/33159 objects retrieved.&lt;BR /&gt;4850/33159 objects retrieved.&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "C:\import_export_objects\export_hosts.py", line 15, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_objects("hosts", fields)&lt;BR /&gt;&amp;nbsp; File "C:\import_export_objects\get_objects.py", line 130, in get_objects&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = get_data(client, showparameter=showparameter if showparameter else args.showparameter[0], dependency_solver_args=dependency_solver_args)["objects"]&lt;BR /&gt;&amp;nbsp; File "C:\import_export_objects\get_objects.py", line 104, in get_data&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = get_raw_data(param=showparameter, client=client)&lt;BR /&gt;&amp;nbsp; File "C:\import_export_objects\get_objects.py", line 157, in get_raw_data&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for current_res in results:&lt;BR /&gt;&amp;nbsp; File "C:\import_export_objects\mgmt_api_lib\cp_mgmt_api.py", line 232, in gen_api_query&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise APIException(api_res.error_message)&lt;BR /&gt;mgmt_api_lib.api_exceptions.APIException: APIResponse received a response which is not valid JSON.&lt;/P&gt;&lt;P&gt;C:\import_export_objects&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When 4850 obejcts were retrieved, API Daemon died.&lt;BR /&gt;I think this problem happens because of&amp;nbsp; too many objects.&lt;BR /&gt;Do you have any solution to get all objects?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, I applied this commands. :&lt;/P&gt;&lt;P&gt;export NGM_WEB_API_JRE_64=1&lt;/P&gt;&lt;P&gt;export NGM_WEB_API_MAX_MEMORY=2048&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 03:23:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38769#M2323</guid>
      <dc:creator>jongsoo</dc:creator>
      <dc:date>2017-10-23T03:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting specific types of objects from the management server</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38770#M2324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Exporting "group", "group-with-exclusion", "service-group", "time-group" fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$ python export_groups.py -m 172.25.197.232 -o output/groups.csv&lt;BR /&gt;Trying to get login credentials...&lt;BR /&gt;Trying to login via `mgmt_cli login -r true`.&lt;BR /&gt;Trying to get username and password.&lt;BR /&gt;Enter username: admin&lt;BR /&gt;Enter password:&lt;BR /&gt;Got the following login credentials:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Username: admin&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Password: ******&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session ID: None&lt;BR /&gt;28/28 objects retrieved.&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "export_groups.py", line 14, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_objects("groups", fields, dependency_solver_args)&lt;BR /&gt;&amp;nbsp; File "/cygdrive/c/Users/rseifert/Desktop/import_export_objects/get_objects.py", line 130, in get_objects&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = get_data(client, showparameter=showparameter if showparameter else args.showparameter[0], dependency_solver_args=dependency_solver_args)["objects"]&lt;BR /&gt;&amp;nbsp; File "/cygdrive/c/Users/rseifert/Desktop/import_export_objects/get_objects.py", line 120, in get_data&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = dependency_loader.order_data()&lt;BR /&gt;&amp;nbsp; File "/cygdrive/c/Users/rseifert/Desktop/import_export_objects/get_objects.py", line 738, in order_data&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if item["type"] == self.type:&lt;BR /&gt;TypeError: 'NoneType' object has no attribute '__getitem__'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, export_times.py has "get_objects("networks", fields)". Changing it to "times" fails to save the results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2017 13:25:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38770#M2324</guid>
      <dc:creator>Russell_Seifert</dc:creator>
      <dc:date>2017-11-14T13:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting specific types of objects from the management server</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38771#M2325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;This library code is obsolete and is not maintained any more.&lt;/P&gt;&lt;P&gt;Instead, you should use a newer library package -&amp;nbsp;&lt;A href="https://github.com/CheckPoint-APIs-Team/ExportImportPolicyPackage"&gt;ExportImportPolicyPackage&lt;/A&gt;, hosted on GitHub, and discussed here -&amp;nbsp;&lt;A _jive_internal="true" href="https://community.checkpoint.com/docs/DOC-1938"&gt;ExportImport on Developers Network&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 09:55:23 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38771#M2325</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2017-11-16T09:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting specific types of objects from the management server</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38772#M2326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We have decided to continue maintaining this useful tool, fixed some bugs and uploaded the source code to GitHub repo (the link on top of the page).&lt;/P&gt;&lt;P&gt;Enjoy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 12:40:46 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38772#M2326</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2017-11-20T12:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting specific types of objects from the management server</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38773#M2327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;after accepting the fingerprint, I recieve the following error...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you accept this fingerprint? [y/n] y&lt;BR /&gt;Fingerprint saved.&lt;BR /&gt;Login failed: APIResponse received a response which is not a valid JSON.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 18:29:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38773#M2327</guid>
      <dc:creator>Steve_Moran1</dc:creator>
      <dc:date>2019-02-13T18:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting specific types of objects from the management server</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38774#M2328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does this script pull only custom objects? It says it's retrieved 103 objects, but then when we open the csv file there will only be a handful in there. Does it not pull anything that's there by default?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 20:56:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Python-tool-for-exporting-specific-types-of-objects-from-the/m-p/38774#M2328</guid>
      <dc:creator>Eric_Oakeson</dc:creator>
      <dc:date>2019-02-13T20:56:21Z</dc:date>
    </item>
  </channel>
</rss>

