<?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 Service Upgrade with Python NSO5.3+ in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4421594#M6402</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;tried to use the new upgrade Python Class available starting with NSO version 5.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;class RfsSdwanSubVpnsUpgrade(ncs.upgrade.Upgrade):
    def upgrade(self, cdbsock, trans):&lt;/PRE&gt;&lt;P&gt;It seems to work with the write transaction (trans) in the upgrade methode which makes it easy to do the write access.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to also get a MAAGIC based High-Level access to the cdbsock? This would make it very easy to write the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Lothar&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 08:05:57 GMT</pubDate>
    <dc:creator>lweddewer</dc:creator>
    <dc:date>2021-06-22T08:05:57Z</dc:date>
    <item>
      <title>Service Upgrade with Python NSO5.3+</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4421594#M6402</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;tried to use the new upgrade Python Class available starting with NSO version 5.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;class RfsSdwanSubVpnsUpgrade(ncs.upgrade.Upgrade):
    def upgrade(self, cdbsock, trans):&lt;/PRE&gt;&lt;P&gt;It seems to work with the write transaction (trans) in the upgrade methode which makes it easy to do the write access.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to also get a MAAGIC based High-Level access to the cdbsock? This would make it very easy to write the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Lothar&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 08:05:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4421594#M6402</guid>
      <dc:creator>lweddewer</dc:creator>
      <dc:date>2021-06-22T08:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Service Upgrade with Python NSO5.3+</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4428664#M6426</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/445093"&gt;@lweddewer&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sure seems challenging to find any concrete information on MAAGIC. I found these 3 resources, which may be helpful to you:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-send-nso-commands-from-python-code/td-p/3863823" target="_blank" rel="noopener"&gt;How to send NSO commands from python code&lt;/A&gt; - Discussion on Cisco Community Forums&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://plajjan.github.io/2019-07-25-writing-a-background-worker-for-cisco-nso.html" target="_blank" rel="noopener"&gt;Writing a Python background worker for Cisco NSO&lt;/A&gt; - Blog article (external)&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://discuss.tail-f.com/t/python-maagic-examples/1993" target="_blank" rel="noopener"&gt;Python Maagic Examples&lt;/A&gt; -&amp;nbsp;ConfD User Community&amp;nbsp;@ tail-f a Cisco company&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 15:02:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4428664#M6426</guid>
      <dc:creator>Alexander Stevenson</dc:creator>
      <dc:date>2021-07-06T15:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Service Upgrade with Python NSO5.3+</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4430459#M6431</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Lothar,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think this link will help you&amp;nbsp;&lt;A href="https://community.cisco.com/t5/nso-developer-hub-documents/nso-service-upgrade-with-python/ta-p/3640379" target="_blank" rel="noopener"&gt;https://community.cisco.com/t5/nso-developer-hub-documents/nso-service-upgrade-with-python/ta-p/3640379&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One question, I also try to use the function you have to upgrade a mandatory leaf in Yang with NSO 5.5 but failed. Is it working by&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;you?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---&amp;gt; fixed&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 13:18:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4430459#M6431</guid>
      <dc:creator>W. Y.</dc:creator>
      <dc:date>2021-09-24T13:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Service Upgrade with Python NSO5.3+</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4430530#M6432</link>
      <description>&lt;P&gt;Hallo&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/976325"&gt;@Alexander Stevenson&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;it was a long way to go. but finaly we found a way that works for us:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Reading old data from cdb:&lt;/P&gt;&lt;P&gt;Based on the class maagic_MaagiBackend an own backend class CdbBackend reading data from the cdbsock. According to that we also had to build a class CdbCursor (based on _nc.maagi.Cursor).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finaly get a root Object:&lt;/P&gt;&lt;PRE&gt;    def get_root_cdb(m):
        backend_server = CdbBackend(m)
        maagic_root = maagic.Root( backend_server)
        m.__dict__['maagic_object'] = maagic_root
        return maagic_root&lt;/PRE&gt;&lt;P&gt;and from here one can use the wellknown High-Level Maagic Methods accessing the old data;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Writing data to the new stucture using the provided&amp;nbsp; transaction trans:&lt;/P&gt;&lt;P&gt;Don't except it but we don't find a way to get Maagic High Level access via the transaction trans. Looks like Maagic doesn_t work in this phase. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fiinaly we fall back to use class Maapi methods(create(), set_elem(),...).&lt;BR /&gt;Building some small wrapping methods make using it a little bit easier for colleagues mostly have experience using Maagic High-Level access.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Lothar&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 13:16:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4430530#M6432</guid>
      <dc:creator>lweddewer</dc:creator>
      <dc:date>2021-07-09T13:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Service Upgrade with Python NSO5.3+</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4430605#M6436</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/445093"&gt;@lweddewer&lt;/a&gt;&amp;nbsp;&amp;nbsp;Thanks for updating us! We appreciate it.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 15:27:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/service-upgrade-with-python-nso5-3/m-p/4430605#M6436</guid>
      <dc:creator>Alexander Stevenson</dc:creator>
      <dc:date>2021-07-09T15:27:54Z</dc:date>
    </item>
  </channel>
</rss>

