<?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: redeploy a service from python in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017909#M4698</link>
    <description>Just a quick piece of extra information: It is generally not a good idea to use this kind of code from inside your create() code.&lt;BR /&gt;</description>
    <pubDate>Fri, 24 Jan 2020 16:04:48 GMT</pubDate>
    <dc:creator>vleijon</dc:creator>
    <dc:date>2020-01-24T16:04:48Z</dc:date>
    <item>
      <title>redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017104#M4691</link>
      <description>&lt;P&gt;Hello can you help on this please,&lt;/P&gt;&lt;P&gt;I'd like to re-deploy a service from my python code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your help will be appreciate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 14:28:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017104#M4691</guid>
      <dc:creator>MAMADOUTOURE2733</dc:creator>
      <dc:date>2020-01-23T14:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017803#M4695</link>
      <description>&lt;PRE&gt;        with ncs.maapi.Maapi() as m:
            with ncs.maapi.Session(m, 'admin', 'system'):
                with m.start_read_trans() as t:
                    instance = ncs.maagic.get_node(t, dst_path)
                    inputs = instance.re_deploy.get_input()
                    inputs.reconcile.create()
                    self.log.debug('Redeploying instance...')
                    instance.re_deploy(inputs)
                    self.log.debug('Instance reconciled.')
&lt;/PRE&gt;
&lt;P&gt;This one is for re-deploy reconcile, but you can set whatever parameters you want instead.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 13:36:37 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017803#M4695</guid>
      <dc:creator>yfherzog</dc:creator>
      <dc:date>2020-01-24T13:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017846#M4696</link>
      <description>&lt;P&gt;Hello Dear Thanks for your reply, could you please tell me what represent&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dst_path&lt;/PRE&gt;&lt;P&gt;is it a variable that containe the service name?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 14:49:46 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017846#M4696</guid>
      <dc:creator>MAMADOUTOURE2733</dc:creator>
      <dc:date>2020-01-24T14:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017886#M4697</link>
      <description>&lt;P&gt;Hello I have test the code and debug, here the working code hope it will help someone else:&lt;/P&gt;&lt;PRE&gt;dst_path = SERVICE_NAME
with ncs.maapi.Maapi() as m:
            with ncs.maapi.Session(m, 'admin', 'system'):
                with m.start_read_trans() as t:
                    instance = ncs.maagic.get_node(t, dst_path)
                    inputs = instance["service_id"].re_deploy.get_input()
                    inputs.reconcile.create()
                    self.log.debug('Redeploying instance...')
                    instance["service_id"].re_deploy(inputs)
                    self.log.debug('Instance reconciled.')&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jan 2020 15:29:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017886#M4697</guid>
      <dc:creator>MAMADOUTOURE2733</dc:creator>
      <dc:date>2020-01-24T15:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017909#M4698</link>
      <description>Just a quick piece of extra information: It is generally not a good idea to use this kind of code from inside your create() code.&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jan 2020 16:04:48 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4017909#M4698</guid>
      <dc:creator>vleijon</dc:creator>
      <dc:date>2020-01-24T16:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4018661#M4701</link>
      <description>&lt;P&gt;please what you mean? could you be most explicit.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 09:58:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4018661#M4701</guid>
      <dc:creator>MAMADOUTOURE2733</dc:creator>
      <dc:date>2020-01-27T09:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4018917#M4702</link>
      <description>Sure: You have operations such a re-deploy dry-run and commit dry-run. You want to be able to run those as dry-run, without changing the system. If you do things as part of the create code that starts a new transaction, that transaction will not have the dry-run flag on it, and the effects of that transaction is not visible in the original transaction.&lt;BR /&gt;&lt;BR /&gt;For that reason creating a new transaction that changes the system from within create()-code is normally a bad idea, as is calling certain types of actions from within your existing transaction (namely, actions that in themselves create a new transaction).&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Jan 2020 17:03:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4018917#M4702</guid>
      <dc:creator>vleijon</dc:creator>
      <dc:date>2020-01-27T17:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4019294#M4706</link>
      <description>&lt;P&gt;Hello dear could you please share an example of the best practice.&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 08:26:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4019294#M4706</guid>
      <dc:creator>MAMADOUTOURE2733</dc:creator>
      <dc:date>2020-01-28T08:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4019679#M4708</link>
      <description>I am not sure what you are asking for, can you please elaborate?&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Jan 2020 17:17:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4019679#M4708</guid>
      <dc:creator>vleijon</dc:creator>
      <dc:date>2020-01-28T17:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4020129#M4712</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, You just said that it is bad idea to use create() function since it start a new transaction.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So I'm asking according to you how could I manage service re-deploy from python.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 10:03:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4020129#M4712</guid>
      <dc:creator>MAMADOUTOURE2733</dc:creator>
      <dc:date>2020-01-29T10:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: redeploy a service from python</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4020281#M4715</link>
      <description>Well, there are three main options I would say: Through a new action, kickers or the touch action.&lt;BR /&gt;&lt;BR /&gt;But the best thing is to take a step back: Why do you want to do this redeploy and what is the situation/context where you need to do the redeploy?&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Jan 2020 15:11:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/redeploy-a-service-from-python/m-p/4020281#M4715</guid>
      <dc:creator>vleijon</dc:creator>
      <dc:date>2020-01-29T15:11:39Z</dc:date>
    </item>
  </channel>
</rss>

