<?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: Migrating objects using the R80 Web APIs, Python, and cpauto in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38869#M2357</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to re-upload the zip file scripts.&lt;/P&gt;&lt;P&gt;I have tried several times to download but keep getting errors preventing me from unzipping using the default Windows 10 Zip client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Aug 2017 13:01:21 GMT</pubDate>
    <dc:creator>John_Tammaro1</dc:creator>
    <dc:date>2017-08-31T13:01:21Z</dc:date>
    <item>
      <title>Migrating objects using the R80 Web APIs, Python, and cpauto</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38861#M2349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H2&gt;Overview&lt;/H2&gt;&lt;P&gt;This script shows how objects can be migrated from one R80 manager to another R80 or R80.10 manager programmatically using the R80 web APIs, Python, and cpauto.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Description&lt;/H2&gt;&lt;P&gt;Script requires at least two R80/R80.10 managers with the web APIs enabled. The source manager should have some host and network objects defined for the demo to be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The provided code is merely an example but is a viable pattern that can be reused for virtually all object types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Instructions&lt;/H2&gt;&lt;P&gt;Download the ZIP archive and run the enclosed Python script on a system that meets the following requirements:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Python and cpauto installed correctly&lt;/LI&gt;&lt;LI&gt;Network access to the source and destination R80 web API resources&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information on cpauto: &lt;A href="https://github.com/dana-at-cp/cpauto"&gt;https://github.com/dana-at-cp/cpauto&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Code Version&lt;/H2&gt;&lt;P&gt;Code version 1.0.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Tested on version&lt;/H2&gt;&lt;P&gt;R80, API version 1.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #ff0000; font-size: 13px;"&gt;&lt;STRONG&gt;NOTICE: &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #999999; font-size: 10.66px;"&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;Not authorized to view the specified document 1042&lt;/A&gt;​&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&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>Mon, 23 Jan 2017 18:23:25 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38861#M2349</guid>
      <dc:creator>Dana_Traversie</dc:creator>
      <dc:date>2017-01-23T18:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating objects using the R80 Web APIs, Python, and cpauto</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38862#M2350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks pretty solid. Just tired it with my R80.10, getting &lt;STRONG&gt;connection error&lt;/STRONG&gt;, please advice&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;[docker@nms02m ~]$ python&lt;BR /&gt;&lt;STRONG&gt;Python 2.7.5&lt;/STRONG&gt; (default, Aug 2 2016, 04:20:16) &lt;BR /&gt;[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2&lt;BR /&gt;Type "help", "copyright", "credits" or "license" for more information.&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; import cpauto&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; cc=cpauto.CoreClient('root','password','10.254.253.110')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r=cc.login()&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt; File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt; File "/usr/lib/python2.7/site-packages/cpauto/core/sessions.py", line 196, in login&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt; r = self.http_post('login', send_sid=False, payload=payload)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt; File "/usr/lib/python2.7/site-packages/cpauto/core/sessions.py", line 161, in http_post&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt; raise ConnectionError('Connection error: ' + str(e))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;cpauto.core.exceptions.ConnectionError: &lt;STRONG&gt;Connection error&lt;/STRONG&gt;: HTTPSConnectionPool(host='10.254.253.110', port=443):&lt;STRONG&gt; Max retries exceeded with url&lt;/STRONG&gt;: /web_api/login (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),))&lt;/SPAN&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r.status_code&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt; File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;NameError: name 'r' is not defined&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jul 2017 14:18:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38862#M2350</guid>
      <dc:creator>Irek_Romaniuk</dc:creator>
      <dc:date>2017-07-31T14:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating objects using the R80 Web APIs, Python, and cpauto</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38863#M2351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Irek.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try again with SSL certificate verification disabled:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #f6f6f6;"&gt;&amp;gt;&amp;gt;&amp;gt; cc=cpauto.CoreClient('root','password','10.254.253.110',verify=False)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Aug 2017 05:17:56 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38863#M2351</guid>
      <dc:creator>Dana_Traversie</dc:creator>
      <dc:date>2017-08-11T05:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating objects using the R80 Web APIs, Python, and cpauto</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38864#M2352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you , I progressed a little further, getting&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;&lt;STRONG&gt;Missing header&lt;/STRONG&gt; error now ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; cc=cpauto.CoreClient('root','password','10.254.253.110',verify=False)&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; n = cpauto.Network(cc)&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r = n.add('Net_10.29.184.0/23', { 'subnet': '10.29.184.0', 'subnet-mask': '255.255.254.0' })&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings" rel="nofollow"&gt;https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; InsecureRequestWarning)&lt;/EM&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r = cc.publish()&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings" rel="nofollow"&gt;https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; InsecureRequestWarning)&lt;/EM&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r.status_code&lt;BR /&gt;400&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r.json()&lt;BR /&gt;{u'message': u'Missing header: [X-chkp-sid]', u'code': u'generic_err_missing_required_header'}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Aug 2017 17:48:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38864#M2352</guid>
      <dc:creator>Irek_Romaniuk</dc:creator>
      <dc:date>2017-08-12T17:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating objects using the R80 Web APIs, Python, and cpauto</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38865#M2353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.checkpoint.com/migrated-users/46301"&gt;https://community.checkpoint.com/people/iromaacad497a-dc2a-485a-9ac5-c7da8ab74009&lt;/A&gt;‌ ... it looks like you forgot to do cc.login() before attempting to create objects.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 14:49:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38865#M2353</guid>
      <dc:creator>Dana_Traversie</dc:creator>
      <dc:date>2017-08-16T14:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating objects using the R80 Web APIs, Python, and cpauto</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38866#M2354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;now I finally got '200' response but can't find my network object in GUI...removed '&lt;SPAN&gt;Unverified HTTPS request is being made' from output below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; r=cc.login()&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; n=cpauto.Network(cc)&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r=n.add('net_1.1.1.0/23',{'subnet':'1.1.1.0','subnet-mask':'255.255.254.0'})&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r=cc.publish()&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r.status_code&lt;BR /&gt;200&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; r.json()&lt;BR /&gt;{u'tasks': [{u'task-id': u'01234567-89ab-cdef-acb4-f3a1f5148efc', u'status': u'succeeded', u'progress-percentage': 100, u'task-name': u'Publish operation', u'task-details': [{u'revision': u'8cf71891-be04-4780-8519-5b12ed5d8bac', u'publishResponse': {u'numberOfPublishedChanges': 0}}], u'suppressed': False}]}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 20:03:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38866#M2354</guid>
      <dc:creator>Irek_Romaniuk</dc:creator>
      <dc:date>2017-08-22T20:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating objects using the R80 Web APIs, Python, and cpauto</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38867#M2355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.checkpoint.com/migrated-users/46301"&gt;Irek Romaniuk&lt;/A&gt;‌ ... I would check/print the HTTP status code after the network object add. I suspect that the object add returned a non-200 HTTP response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also print the entire response object for more detail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 20:29:09 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38867#M2355</guid>
      <dc:creator>Dana_Traversie</dc:creator>
      <dc:date>2017-08-22T20:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating objects using the R80 Web APIs, Python, and cpauto</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38868#M2356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct it returned 400 after&amp;nbsp;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;he network object added&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2017 19:04:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38868#M2356</guid>
      <dc:creator>Irek_Romaniuk</dc:creator>
      <dc:date>2017-08-24T19:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating objects using the R80 Web APIs, Python, and cpauto</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38869#M2357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to re-upload the zip file scripts.&lt;/P&gt;&lt;P&gt;I have tried several times to download but keep getting errors preventing me from unzipping using the default Windows 10 Zip client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2017 13:01:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Migrating-objects-using-the-R80-Web-APIs-Python-and-cpauto/m-p/38869#M2357</guid>
      <dc:creator>John_Tammaro1</dc:creator>
      <dc:date>2017-08-31T13:01:21Z</dc:date>
    </item>
  </channel>
</rss>

