<?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: UpdateVPNsettings API formatting error in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417544#M2996</link>
    <description>&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;For the regular API's the documentation is the postman collection:&lt;/P&gt;&lt;P&gt;&lt;A href="http://postman.meraki.com" target="_self" rel="nofollow noopener noreferrer"&gt;postman.meraki.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the Python library, I didn't see decent documentation that would have mentioned this. But I came to the correct code by looking at both what the API expects and what was in the source code of the python library. Then just testing. Unfortunately the errors aren't always very explanatory.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Apr 2019 14:44:14 GMT</pubDate>
    <dc:creator>BrechtSchamp</dc:creator>
    <dc:date>2019-04-15T14:44:14Z</dc:date>
    <item>
      <title>UpdateVPNsettings API formatting error</title>
      <link>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417539#M2991</link>
      <description>&lt;P&gt;I have to be blind because there error I'm getting is that my ip address is not formatted correctly for the meraki module in python.  But it looks correct.&lt;/P&gt;&lt;P&gt;Yes i know i'm importing more then needed.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;meraki &lt;SPAN&gt;import &lt;/SPAN&gt;meraki&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;ipaddress &lt;SPAN&gt;import &lt;/SPAN&gt;ip_address&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;random&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;requests&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;json&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;sys&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;re&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;warnings&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;os&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;csv&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Used to access Meraki API&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;login&lt;BR /&gt;(API_KEY&lt;SPAN&gt;, &lt;/SPAN&gt;ORG_ID&lt;SPAN&gt;, &lt;/SPAN&gt;BASE_URL) = (login.api_key&lt;SPAN&gt;, &lt;/SPAN&gt;login.org_id&lt;SPAN&gt;, &lt;/SPAN&gt;login.base_url)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;####Variables####&lt;BR /&gt;&lt;/SPAN&gt;my_hub = &lt;SPAN&gt;'#####'&lt;BR /&gt;&lt;/SPAN&gt;my_mode = &lt;SPAN&gt;'spoke'&lt;BR /&gt;&lt;/SPAN&gt;my_usevpn = &lt;SPAN&gt;'True'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# Get the current list of networks&lt;BR /&gt;&lt;/SPAN&gt;current_networks = meraki.getnetworklist(API_KEY&lt;SPAN&gt;, &lt;/SPAN&gt;ORG_ID)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Get the current networks' ID&lt;BR /&gt;&lt;/SPAN&gt;network_id = [network[&lt;SPAN&gt;'id'&lt;/SPAN&gt;] &lt;SPAN&gt;for &lt;/SPAN&gt;network &lt;SPAN&gt;in &lt;/SPAN&gt;current_networks]&lt;BR /&gt;network_id.pop(&lt;SPAN&gt;1&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Get VLANS&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;line &lt;SPAN&gt;in &lt;/SPAN&gt;network_id:&lt;BR /&gt;   vlans = meraki.getvlans(API_KEY&lt;SPAN&gt;, &lt;/SPAN&gt;line)&lt;BR /&gt;   vpn = meraki.getvpnsettings(API_KEY&lt;SPAN&gt;, &lt;/SPAN&gt;line)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Get the VPN Subnets&lt;BR /&gt;&lt;/SPAN&gt;   vpn_subnet = [subnet[&lt;SPAN&gt;'subnet'&lt;/SPAN&gt;] &lt;SPAN&gt;for &lt;/SPAN&gt;subnet &lt;SPAN&gt;in &lt;/SPAN&gt;vlans]&lt;BR /&gt;   &lt;SPAN&gt;for &lt;/SPAN&gt;sub &lt;SPAN&gt;in &lt;/SPAN&gt;vpn_subnet:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Update VPN Settings&lt;BR /&gt;&lt;/SPAN&gt;      update_vpnsettings = meraki.updatevpnsettings(API_KEY&lt;SPAN&gt;, &lt;/SPAN&gt;line&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;mode&lt;/SPAN&gt;=my_mode&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;subnets&lt;/SPAN&gt;=sub&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;usevpn&lt;/SPAN&gt;=my_usevpn&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;hubnetworks&lt;/SPAN&gt;=my_hub&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;defaultroute&lt;/SPAN&gt;=&lt;SPAN&gt;'False'&lt;/SPAN&gt;)&lt;BR /&gt;      &lt;SPAN&gt;print&lt;/SPAN&gt;(update_vpnsettings) &lt;/PRE&gt;&lt;P&gt;    raise ValueError('Invalid Subnet IP Address {0} - Address must be formatted as #.#.#.#/#'.format(str(subnetip)))&lt;BR /&gt;ValueError: Invalid Subnet IP Address 1 - Address must be formatted as #.#.#.#/#&lt;/P&gt;&lt;P&gt;The issue is with the sub variable.  But that comes out formatted as x.x.x.x/x.  I have a hard time believing that someone way smarter then me screwed up when making the module.&lt;/P&gt;&lt;P&gt;Sub variable output&lt;/P&gt;&lt;P&gt;192.168.128.0/24&lt;BR /&gt;10.110.14.0/24&lt;BR /&gt;10.110.15.0/24&lt;BR /&gt;10.110.16.0/24&lt;BR /&gt;10.110.17.0/24&lt;BR /&gt;10.110.20.0/24&lt;BR /&gt;10.110.77.0/24&lt;BR /&gt;10.110.175.0/24&lt;BR /&gt;10.110.215.0/24&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 20:56:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417539#M2991</guid>
      <dc:creator>nvrdone</dc:creator>
      <dc:date>2019-04-11T20:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateVPNsettings API formatting error</title>
      <link>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417540#M2992</link>
      <description>&lt;P&gt;The API is expecting a list of all the subnets at once.&lt;/P&gt;&lt;P&gt;I believe the Meraki python library manages that by combining (zipping) two same-length lists in the updatevpnsettings method.&lt;/P&gt;&lt;P&gt;A list of subnets:&lt;/P&gt;&lt;P&gt;["&lt;SPAN&gt;192.168.128.0/24","&lt;/SPAN&gt;&lt;SPAN&gt;10.110.14.0/24","&lt;/SPAN&gt;&lt;SPAN&gt;10.110.15.0/24","&lt;/SPAN&gt;&lt;SPAN&gt;10.110.16.0/24"]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;A list of whether or not to include them in the VPN:&lt;/P&gt;&lt;P&gt;[True,False,True,False]&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 15:44:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417540#M2992</guid>
      <dc:creator>BrechtSchamp</dc:creator>
      <dc:date>2019-04-12T15:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateVPNsettings API formatting error</title>
      <link>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417541#M2993</link>
      <description>&lt;P&gt;I did see that part&lt;/P&gt;&lt;P&gt;(from meraki.py)&lt;/P&gt;&lt;P&gt;__comparelist(subnets, usevpn)&lt;/P&gt;&lt;P&gt;vpnsubnets = list(zip(subnets, usevpn))&lt;/P&gt;&lt;P&gt;in order to test if that was the problem I static set all the requirements of the function.  (subnets='10.10.10.10/24', usevpn = 'True') and still receive the same error.&lt;/P&gt;&lt;P&gt;Unless I'm mistaken this would give me the equal length list to satisfy this part.&lt;/P&gt;&lt;P&gt;Just for reference i ran just the updatevpnsettings function.  I did not run it through the for loops.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 18:21:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417541#M2993</guid>
      <dc:creator>nvrdone</dc:creator>
      <dc:date>2019-04-12T18:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateVPNsettings API formatting error</title>
      <link>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417542#M2994</link>
      <description>&lt;P&gt;You'll probably want to beautify it by using more variables, but I just want to demonstrate the correct usage and particularly the variable types you need for it to be successful:&lt;/P&gt;&lt;PRE&gt;update_vpnsettings = meraki.updatevpnsettings(API_KEY, "N_987654321987654", mode='spoke', subnets=["10.255.255.0/24","10.10.0.0/24","10.15.0.0/24","10.25.0.0/16","10.5.0.0/24","10.28.0.0/16"] , usevpn=[True, True, False, True, True, True], hubnetworks=["N_123456789123456"], defaultroute=[False])&lt;/PRE&gt;&lt;P&gt;Note that it uses the actual bool variable type of Python so no quotes. Also for the hub(s) and whether to use them as default route two lists are expected.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 22:34:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417542#M2994</guid>
      <dc:creator>BrechtSchamp</dc:creator>
      <dc:date>2019-04-12T22:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateVPNsettings API formatting error</title>
      <link>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417543#M2995</link>
      <description>&lt;P&gt;Thank you for this.  One last question, for future reference where would I find how these are suppose to be formatted, or is it just my green-ness?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 14:35:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417543#M2995</guid>
      <dc:creator>nvrdone</dc:creator>
      <dc:date>2019-04-15T14:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: UpdateVPNsettings API formatting error</title>
      <link>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417544#M2996</link>
      <description>&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;For the regular API's the documentation is the postman collection:&lt;/P&gt;&lt;P&gt;&lt;A href="http://postman.meraki.com" target="_self" rel="nofollow noopener noreferrer"&gt;postman.meraki.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the Python library, I didn't see decent documentation that would have mentioned this. But I came to the correct code by looking at both what the API expects and what was in the source code of the python library. Then just testing. Unfortunately the errors aren't always very explanatory.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 14:44:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/updatevpnsettings-api-formatting-error/m-p/5417544#M2996</guid>
      <dc:creator>BrechtSchamp</dc:creator>
      <dc:date>2019-04-15T14:44:14Z</dc:date>
    </item>
  </channel>
</rss>

