<?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: Vlan pool using Acitoolkit in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/vlan-pool-using-acitoolkit/m-p/4320236#M73</link>
    <description>&lt;P&gt;The error messaging you're receiving as part of the &lt;FONT face="courier new,courier"&gt;.get_json()&lt;/FONT&gt; method is giving you a clue&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="bp-text bp-text-plain hljs bp-is-scrollable" tabindex="0"&gt;&lt;CODE class="bp-text-code txt"&gt;Traceback (most recent call last):
  File "&amp;lt;pyshell#44&amp;gt;", line 1, in &amp;lt;module&amp;gt;
    session.push_to_apic(testpool.get_url(), testpool.get_json())
  File "C:\automation\ACI\lib\site-packages\acitoolkit-0.4-py3.9.egg\acitoolkit\acitoolkit.py", line 6552, in get_json
    from_id = self.encap_type + '-' + self.start_id
TypeError: can only concatenate str (not "NoneType") to str&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;In this instance -- you can see that its attempting to concatenate the &lt;FONT face="courier new,courier"&gt;encap_type&lt;/FONT&gt; with &lt;FONT face="courier new,courier"&gt;start_id&lt;/FONT&gt;, of which you don't have defined (hence &lt;FONT face="courier new,courier"&gt;NoneType&lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just tested this -- and if you refactor to something like the following&lt;/P&gt;
&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; testpool = aci.NetworkPool('test_pool','vlan','dynamic',start_id='10',end_id='100')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; print(testpool.get_json())&lt;BR /&gt;{'infraInfra': {'attributes': {}, 'children': [{'fvnsVlanInstP': {'attributes': {'name': 'test_pool', 'allocMode': 'dynamic'}, 'children': [{'fvnsEncapBlk':&lt;BR /&gt;{'attributes': {'name': 'encap', 'from': 'vlan-10', 'to': 'vlan-100'}, 'children': []}}]}}]}}&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; session.push_to_apic(testpool.get_url(),testpool.get_json())&lt;BR /&gt;&amp;lt;Response [200]&amp;gt;&lt;/PRE&gt;
&lt;P&gt;it will succeed (and you can see that the &lt;FONT face="courier new,courier"&gt;print()&lt;/FONT&gt; statement will print the appropriate JSON payload of the call made to the APIC).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The attached screenshot is from pushing the VLAN pool to the always-on ACI sandbox. &amp;nbsp;It may also be helpful to install &lt;FONT face="courier new,courier"&gt;bpython&lt;/FONT&gt; in your virtualenv, which will provide handy "tooltips" when working in the interactive interpreter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;q.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Apr 2021 23:06:26 GMT</pubDate>
    <dc:creator>qsnyder</dc:creator>
    <dc:date>2021-04-07T23:06:26Z</dc:date>
    <item>
      <title>Vlan pool using Acitoolkit</title>
      <link>https://community.cisco.com/t5/controllers/vlan-pool-using-acitoolkit/m-p/4315891#M72</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a vlan pool in ACI using attached python code. Could anyone please help me to know why am I getting error while trying to push it to ACI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and appreciate your time to answer this question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Qamber&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 04:48:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/vlan-pool-using-acitoolkit/m-p/4315891#M72</guid>
      <dc:creator>sqambera</dc:creator>
      <dc:date>2021-03-30T04:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Vlan pool using Acitoolkit</title>
      <link>https://community.cisco.com/t5/controllers/vlan-pool-using-acitoolkit/m-p/4320236#M73</link>
      <description>&lt;P&gt;The error messaging you're receiving as part of the &lt;FONT face="courier new,courier"&gt;.get_json()&lt;/FONT&gt; method is giving you a clue&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="bp-text bp-text-plain hljs bp-is-scrollable" tabindex="0"&gt;&lt;CODE class="bp-text-code txt"&gt;Traceback (most recent call last):
  File "&amp;lt;pyshell#44&amp;gt;", line 1, in &amp;lt;module&amp;gt;
    session.push_to_apic(testpool.get_url(), testpool.get_json())
  File "C:\automation\ACI\lib\site-packages\acitoolkit-0.4-py3.9.egg\acitoolkit\acitoolkit.py", line 6552, in get_json
    from_id = self.encap_type + '-' + self.start_id
TypeError: can only concatenate str (not "NoneType") to str&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;In this instance -- you can see that its attempting to concatenate the &lt;FONT face="courier new,courier"&gt;encap_type&lt;/FONT&gt; with &lt;FONT face="courier new,courier"&gt;start_id&lt;/FONT&gt;, of which you don't have defined (hence &lt;FONT face="courier new,courier"&gt;NoneType&lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just tested this -- and if you refactor to something like the following&lt;/P&gt;
&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; testpool = aci.NetworkPool('test_pool','vlan','dynamic',start_id='10',end_id='100')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; print(testpool.get_json())&lt;BR /&gt;{'infraInfra': {'attributes': {}, 'children': [{'fvnsVlanInstP': {'attributes': {'name': 'test_pool', 'allocMode': 'dynamic'}, 'children': [{'fvnsEncapBlk':&lt;BR /&gt;{'attributes': {'name': 'encap', 'from': 'vlan-10', 'to': 'vlan-100'}, 'children': []}}]}}]}}&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; session.push_to_apic(testpool.get_url(),testpool.get_json())&lt;BR /&gt;&amp;lt;Response [200]&amp;gt;&lt;/PRE&gt;
&lt;P&gt;it will succeed (and you can see that the &lt;FONT face="courier new,courier"&gt;print()&lt;/FONT&gt; statement will print the appropriate JSON payload of the call made to the APIC).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The attached screenshot is from pushing the VLAN pool to the always-on ACI sandbox. &amp;nbsp;It may also be helpful to install &lt;FONT face="courier new,courier"&gt;bpython&lt;/FONT&gt; in your virtualenv, which will provide handy "tooltips" when working in the interactive interpreter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;q.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 23:06:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/vlan-pool-using-acitoolkit/m-p/4320236#M73</guid>
      <dc:creator>qsnyder</dc:creator>
      <dc:date>2021-04-07T23:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Vlan pool using Acitoolkit</title>
      <link>https://community.cisco.com/t5/controllers/vlan-pool-using-acitoolkit/m-p/4320577#M74</link>
      <description>&lt;P&gt;Thank you so much Qsnyder&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 15:04:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/vlan-pool-using-acitoolkit/m-p/4320577#M74</guid>
      <dc:creator>sqambera</dc:creator>
      <dc:date>2021-04-08T15:04:35Z</dc:date>
    </item>
  </channel>
</rss>

