<?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: Create VLAN using API on MX in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/create-vlan-using-api-on-mx/m-p/5447566#M7401</link>
    <description>&lt;P&gt;Yes that will be the workflow&lt;BR /&gt;Little annoying that when you read the schema definition most of the parameters are defined/explained.&lt;BR /&gt;I used the same in my code basically just like you, create the basic and then update with specifics&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2024 13:01:40 GMT</pubDate>
    <dc:creator>mikefredrik</dc:creator>
    <dc:date>2024-10-14T13:01:40Z</dc:date>
    <item>
      <title>Create VLAN using API on MX</title>
      <link>https://community.cisco.com/t5/network-platform-api/create-vlan-using-api-on-mx/m-p/5447564#M7399</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;I've noticed that when I use the API to create VLANs on the MX there might be an error in the API.&lt;BR /&gt;I use the &lt;STRONG&gt;&lt;SPAN&gt;createNetworkApplianceVlan &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;with the following parameters: (some are comming from a few input statment and will later be part of a data flow between different systems)&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;  &lt;/SPAN&gt;&lt;SPAN&gt;network_id&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;id_&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'test60'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt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;SPAN&gt;'opendns'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;The two thing that is not reflected in the dashboard is Leasetime and DNS name server, the dashboard use the default upstream DNS and 1 day leasetime, not really what I want, event tried the swagewr on the meraki.io page to make sure I didn't have any type that will cause the API to use defaults.&lt;BR /&gt;My current workaround is to then run the &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;updateNetworkApplianceVlan &lt;/STRONG&gt;with the following input:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;network_id, vlan_id, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    name=vlan_name, &amp;lt;This is from an input string&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    dhcpLeaseTime='1 hour', &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    dnsNameservers='opendns'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Now the DHCP settings reflect what I want&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;As always it could be error code 40 (problem 40 cm from the keyboard) but also something else.&lt;BR /&gt;Ideas / Input appriciated&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//Mikael&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Oct 2024 09:50:01 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/create-vlan-using-api-on-mx/m-p/5447564#M7399</guid>
      <dc:creator>mikefredrik</dc:creator>
      <dc:date>2024-10-14T09:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create VLAN using API on MX</title>
      <link>https://community.cisco.com/t5/network-platform-api/create-vlan-using-api-on-mx/m-p/5447565#M7400</link>
      <description>&lt;P&gt;The main problem here is that creating an endpoint often doesn't accept the same parameters as updating the endpoint.&lt;/P&gt;&lt;P&gt;I always use the same approach as you with generating the VLAN and then setting all needed parameters:&lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;print("Step "+next(step)+":     Create VLAN User-LAN ... ")
   response = dashboard.appliance.createNetworkApplianceVlan(
      network_hq_id, 1000, name='User-LAN',
      subnet='10.1.0.0/24', 
      applianceIp='10.1.0.254'
   )
print("Step "+next(step)+":     Update VLAN User-LAN DHCP ... ")
   response = dashboard.appliance.updateNetworkApplianceVlan(
      network_hq_id, 1000,
      dhcpHandling='Run a DHCP server', 
      dhcpLeaseTime='1 day', 
      dhcpBootOptionsEnabled=False, 
      reservedIpRanges=[{'start': '10.1.0.128', 'end': '10.1.0.254', 'comment': 'Reserved'}], 
      dnsNameservers='opendns', 
      dhcpOptions=[{'code': '18', 'type': 'text', 'value': 'company.intern'},
                {'code': '42', 'type': 'IP', 'value': '192.53.103.101'}]
   )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Oct 2024 12:28:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/create-vlan-using-api-on-mx/m-p/5447565#M7400</guid>
      <dc:creator>Karsten Iwen</dc:creator>
      <dc:date>2024-10-14T12:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create VLAN using API on MX</title>
      <link>https://community.cisco.com/t5/network-platform-api/create-vlan-using-api-on-mx/m-p/5447566#M7401</link>
      <description>&lt;P&gt;Yes that will be the workflow&lt;BR /&gt;Little annoying that when you read the schema definition most of the parameters are defined/explained.&lt;BR /&gt;I used the same in my code basically just like you, create the basic and then update with specifics&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 13:01:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/create-vlan-using-api-on-mx/m-p/5447566#M7401</guid>
      <dc:creator>mikefredrik</dc:creator>
      <dc:date>2024-10-14T13:01:40Z</dc:date>
    </item>
  </channel>
</rss>

