<?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 catch resource_manager redeploy exception in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/catch-resource-manager-redeploy-exception/m-p/3808020#M3389</link>
    <description>&lt;P&gt;The following service callback utilizes id_allocator of the resource_manager package to request an id from the resource pool and then read the allocated id back when it is ready.&lt;/P&gt;
&lt;PRE&gt;from resource_manager import id_allocator

@Service.create&lt;BR /&gt;def cb_create(self, tctx, root, service, proplist):
    id_allocator.id_request(...)
    id = id_allocator.id_read(...)&lt;BR /&gt;
    if not id:
        print('id not ready, waiting for redeploy')
        return&lt;BR /&gt;
    # get the id, save it
    service.allocated_id = id
....
   &lt;/PRE&gt;
&lt;P&gt;When the resource pool is exhausted, a LookupError exception will happen when the redeployment kicks in to read the id. But either from ncs_cli or northbound REST api will show this error since it's from a redeployment of the service. My question is that are there any ways to properly pass along the exceptions/errors to the users who launch the service so that they know the id request fail?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Feb 2019 21:17:38 GMT</pubDate>
    <dc:creator>houlee</dc:creator>
    <dc:date>2019-02-22T21:17:38Z</dc:date>
    <item>
      <title>catch resource_manager redeploy exception</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/catch-resource-manager-redeploy-exception/m-p/3808020#M3389</link>
      <description>&lt;P&gt;The following service callback utilizes id_allocator of the resource_manager package to request an id from the resource pool and then read the allocated id back when it is ready.&lt;/P&gt;
&lt;PRE&gt;from resource_manager import id_allocator

@Service.create&lt;BR /&gt;def cb_create(self, tctx, root, service, proplist):
    id_allocator.id_request(...)
    id = id_allocator.id_read(...)&lt;BR /&gt;
    if not id:
        print('id not ready, waiting for redeploy')
        return&lt;BR /&gt;
    # get the id, save it
    service.allocated_id = id
....
   &lt;/PRE&gt;
&lt;P&gt;When the resource pool is exhausted, a LookupError exception will happen when the redeployment kicks in to read the id. But either from ncs_cli or northbound REST api will show this error since it's from a redeployment of the service. My question is that are there any ways to properly pass along the exceptions/errors to the users who launch the service so that they know the id request fail?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 21:17:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/catch-resource-manager-redeploy-exception/m-p/3808020#M3389</guid>
      <dc:creator>houlee</dc:creator>
      <dc:date>2019-02-22T21:17:38Z</dc:date>
    </item>
  </channel>
</rss>

