<?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: Bulk changes to multiple network devices in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433195#M5366</link>
    <description>&lt;P&gt;I'm pretty new to the API myself so this may not be a comprehensive answer.  I'm doing something similar, renaming APs and so far I have been able to change 15 at once using that API call and Collection Runner in Postman.&lt;/P&gt;&lt;P&gt;Here's what I did:&lt;/P&gt;&lt;P&gt;*Install Postman and the Meraki Dashboard API Collection (the collection is optional, you can just type this in)&lt;/P&gt;&lt;P&gt;*Create a new request in Postman (either make environment variables for your API key, the baseURL, and networkId or just fill them in).  Here is what mine looks like.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="resolvedVariable"&gt;&lt;SPAN&gt;          {{baseUrl}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/networks/&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{networkId}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/devices/&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{serial}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;?name=&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{name}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;*Create a .csv file with two columns.  One has header "serial" and the other has header "name"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;*Click Runner in Postman to open that window.  Choose the request you created above and use Select File to choose the .csv file&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;*Click Run Start&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;*Check the Meraki dashboard to see that it worked.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My command only updates the name, so any variables you don't change stay the same.  You should be able to change the name variable to be your tag variable instead and add another one for the address.&lt;/P&gt;&lt;P&gt;Here's a link to the Postman variable documentation that may help with adding another variable.  &lt;A href="https://learning.postman.com/docs/postman/variables-and-environments/variables/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://learning.postman.com/docs/postman/variables-and-environments/variables/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Mar 2020 17:59:23 GMT</pubDate>
    <dc:creator>agreen2</dc:creator>
    <dc:date>2020-03-24T17:59:23Z</dc:date>
    <item>
      <title>Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433191#M5362</link>
      <description>&lt;P&gt;I see there is a JSON script for updating the attributes for devices but it only allows for one at a time. Does anything exist for updating tags or any attribute with one api call?&lt;/P&gt;&lt;P&gt;It also seems as though to update one attribute , it requires all attributes to be included in the script. Can someone please advise?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 18:37:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433191#M5362</guid>
      <dc:creator>ReggiePaul</dc:creator>
      <dc:date>2020-03-19T18:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433192#M5363</link>
      <description>&lt;P&gt;You might need to give a specific example.&lt;/P&gt;&lt;P&gt;Here is an example of one API call and it lets you update lots of things at once.&lt;/P&gt;&lt;P&gt;&lt;A href="https://dashboard.meraki.com/api_docs/v0#update-the-attributes-of-a-device" target="_self" rel="nofollow noopener noreferrer"&gt;https://dashboard.meraki.com/api_docs/v0#update-the-attributes-of-a-device&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Does it really make that much difference making muliple API calls?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 19:58:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433192#M5363</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2020-03-19T19:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433193#M5364</link>
      <description>&lt;P&gt;Yes i have already explored that API call. What i am looking to do is to update lets say at least 10-25 devices (switches or APs) at once in the same network with new tags and or new address. This particular API call appears to only let you do one serial number at a time and requires all the attributes be completed.&lt;/P&gt;&lt;P&gt;Does that give a clearer picture?&lt;/P&gt;&lt;P&gt;It makes a difference because from what i am understanding i would have to change out the serial # for each call when i would like to just do one push and it pushes the "new tag" and/or "new address" to all the devices.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 13:53:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433193#M5364</guid>
      <dc:creator>ReggiePaul</dc:creator>
      <dc:date>2020-03-20T13:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433194#M5365</link>
      <description>Yes i have already explored that API call. What i am looking to do is to update lets say at least 10-25 devices (switches or APs) at once in the same network with new tags and or new address. This particular API call appears to only let you do one serial number at a time and requires all the attributes be completed.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Does that give a clearer picture?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It makes a difference because from what i am understanding i would have to change out the serial # for each call when i would like to just do one push and it pushes the "new tag" and/or "new address" to all the devices.</description>
      <pubDate>Mon, 23 Mar 2020 18:27:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433194#M5365</guid>
      <dc:creator>ReggiePaul</dc:creator>
      <dc:date>2020-03-23T18:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433195#M5366</link>
      <description>&lt;P&gt;I'm pretty new to the API myself so this may not be a comprehensive answer.  I'm doing something similar, renaming APs and so far I have been able to change 15 at once using that API call and Collection Runner in Postman.&lt;/P&gt;&lt;P&gt;Here's what I did:&lt;/P&gt;&lt;P&gt;*Install Postman and the Meraki Dashboard API Collection (the collection is optional, you can just type this in)&lt;/P&gt;&lt;P&gt;*Create a new request in Postman (either make environment variables for your API key, the baseURL, and networkId or just fill them in).  Here is what mine looks like.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="resolvedVariable"&gt;&lt;SPAN&gt;          {{baseUrl}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/networks/&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{networkId}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/devices/&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{serial}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;?name=&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{name}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;*Create a .csv file with two columns.  One has header "serial" and the other has header "name"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;*Click Runner in Postman to open that window.  Choose the request you created above and use Select File to choose the .csv file&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;*Click Run Start&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;*Check the Meraki dashboard to see that it worked.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My command only updates the name, so any variables you don't change stay the same.  You should be able to change the name variable to be your tag variable instead and add another one for the address.&lt;/P&gt;&lt;P&gt;Here's a link to the Postman variable documentation that may help with adding another variable.  &lt;A href="https://learning.postman.com/docs/postman/variables-and-environments/variables/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://learning.postman.com/docs/postman/variables-and-environments/variables/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 17:59:23 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433195#M5366</guid>
      <dc:creator>agreen2</dc:creator>
      <dc:date>2020-03-24T17:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433196#M5367</link>
      <description>thanks unfortunately i am getting 404 error codes dont understand why.&lt;BR /&gt;&lt;BR /&gt;i just first with your serial number but that doesn't work and neither with the tag inserted as a variable as well.&lt;BR /&gt;&lt;BR /&gt;https://{{shard}}.meraki.com/api/v0/newtorks/{{network_Id}}/devices/Q2KD-XXXX-XXXX?name=AP001</description>
      <pubDate>Wed, 25 Mar 2020 23:36:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433196#M5367</guid>
      <dc:creator>ReggiePaul</dc:creator>
      <dc:date>2020-03-25T23:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433197#M5368</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Using Postman is one way of doing it, however If you use Python and the Meraki API call, you can browse through that network, obtain all serials of the devices and the change the objects you want.... Done that several times already with my networks here.&lt;/P&gt;&lt;P&gt;here is an example of the things we use here. (identing is gone with cut and paste)&lt;/P&gt;&lt;P&gt;def Add_Network_Device(def_network,def_serial,def_site_code):&lt;/P&gt;&lt;P&gt;  #&lt;BR /&gt;  # First check if device is already in network&lt;BR /&gt;  #&lt;/P&gt;&lt;P&gt;  device_there = 0&lt;BR /&gt;  my_network_devices = dashboard.devices.getNetworkDevices(def_network)&lt;/P&gt;&lt;P&gt;  for my_network_device in my_network_devices:&lt;BR /&gt;&lt;BR /&gt;if def_serial == my_network_device['serial']:&lt;BR /&gt;print ("device ",my_network_device["model"],"with serial",def_serial,"already added")&lt;BR /&gt;device_there = 1&lt;/P&gt;&lt;P&gt;if device_there == 0:&lt;BR /&gt;&lt;BR /&gt;print ('Adding ',def_serial,' to netowrk id : ',def_network)&lt;BR /&gt;&lt;BR /&gt;try:&lt;BR /&gt;response = dashboard.devices.claimNetworkDevices(def_network,serial=def_serial )&lt;BR /&gt;print (response)&lt;/P&gt;&lt;P&gt;except:&lt;BR /&gt;print ("Failed to add device")&lt;BR /&gt;quit()&lt;/P&gt;&lt;P&gt;my_device = dashboard.devices.getNetworkDevice(def_network,def_serial)&lt;/P&gt;&lt;P&gt;model_type = str(my_device['model'])&lt;/P&gt;&lt;P&gt;if model_type[:2] == "MX":&lt;BR /&gt;def_site_code += "-FW1"&lt;BR /&gt;elif model_type[:2] == "MS":&lt;BR /&gt;def_site_code += "-SW01"&lt;BR /&gt;elif model_type[:2] == "MR":&lt;BR /&gt;def_site_code += "-AP01"&lt;/P&gt;&lt;P&gt;param = {}&lt;/P&gt;&lt;P&gt;param['name'] = def_site_code&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;response = dashboard.devices.updateNetworkDevice(def_network,def_serial,**param)&lt;BR /&gt;print (respons)&lt;BR /&gt;except:&lt;BR /&gt;print ("Cannot update ")&lt;/P&gt;&lt;P&gt;print ("Name is : ",def_site_code)&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 10:02:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433197#M5368</guid>
      <dc:creator>Edgar-VO</dc:creator>
      <dc:date>2020-03-26T10:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433198#M5369</link>
      <description>&lt;P&gt;Have you looked into Action Batches?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 23:25:22 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433198#M5369</guid>
      <dc:creator>adammmorton</dc:creator>
      <dc:date>2020-04-06T23:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433199#M5370</link>
      <description>&lt;P&gt;I have played with those as well, but i am trying to familiarize myself with the best approach either python or utilizing postman. Anymore advice would be much obliged.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 14:08:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433199#M5370</guid>
      <dc:creator>ReggiePaul</dc:creator>
      <dc:date>2020-04-07T14:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433200#M5371</link>
      <description>&lt;P&gt;To be honest, I don't sue Postman so I can't comment on that.  If you want to update any attribute of a device, you have to do them one by one as the API identifies devices by serial number.  You could do a simple Python loop to take care of this for you.  You don't have to update all attributes, you can only update the ones you want.  If you have, say, 100 devices in your dashboard and only want to update &lt;SPAN&gt;10-25 devices, how do you identify those 10-25 devices?  By name, tag, serial number, etc.?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 15:12:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433200#M5371</guid>
      <dc:creator>adammmorton</dc:creator>
      <dc:date>2020-04-07T15:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433201#M5372</link>
      <description>&lt;P&gt;By serial #, that is really what i am looking for. If i want to update an address or tag for a certain set of devices within a network then i would like to use a loop to hit say 5 or more devices. &lt;/P&gt;&lt;P&gt;Or another would be if i want to add multiple firewall rules then i would like to do this with loop within python for example by the network id in the meraki dashboard.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 15:49:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433201#M5372</guid>
      <dc:creator>ReggiePaul</dc:creator>
      <dc:date>2020-04-07T15:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433202#M5373</link>
      <description>&lt;P&gt;Below should get you what you want for updating address, tags, etc.  This scrip assumes you don't know your org Id and the network Id associated with each serial number.  If you know that information, you can modify the script to suit your needs.  To get your serial numbers into a list, you could read through a file and populate it that way also.  &lt;/P&gt;&lt;P&gt;The firewall rules would follow the same concept.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; meraki&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;apiKey = &lt;/SPAN&gt;&lt;SPAN&gt;'123YourAPI_Key'&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;/SPAN&gt;&lt;SPAN&gt;# You could also use an environmental variable for this&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dashboard = meraki.DashboardAPI(&lt;/SPAN&gt;&lt;SPAN&gt;api_key&lt;/SPAN&gt;&lt;SPAN&gt;=apiKey&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# You will have to get the serial numbers you want to modify into a list.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;devicesToModifyList = [&lt;/SPAN&gt;&lt;SPAN&gt;'XXXX-XXXX-XXXX'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'XXXX-XXXX-XXXX'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# The address you want to update on the devices&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;newAddress = &lt;/SPAN&gt;&lt;SPAN&gt;'123 Any Street, Small Town USA'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# The tags you want to update on the devices.  They must be separated by a space.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;newTags = &lt;/SPAN&gt;&lt;SPAN&gt;' tag1 tag2 '&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# This list will be populated with dictionaries of the network ID and serial number of the devices.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;serialAndNetworkIdList = &lt;/SPAN&gt;&lt;SPAN&gt;list&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Finding Org ID...'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# You first have to find your Org ID.  Replace 'Your Org Name' with whatever your org name is in the dashboard.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#  If you know your org Id, you can skip this part and set the orgId variable to it.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    myOrgs = dashboard.organizations.getOrganizations()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;except&lt;/SPAN&gt;&lt;SPAN&gt; meraki.APIError &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; e:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    &lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&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AN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        orgId = orgs[&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;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'DONE!'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# Pulls back all the devices that are assigned to a network in your org.  This can take some time if you have many devices.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# If you have many devices, it's recommended you use pagination.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;devices = dashboard.devices.getOrganizationDevices(orgId, &lt;/SPAN&gt;&lt;SPAN&gt;total_pages&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;'all'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# This loops through all of the devices in your dashboard.  If the serial number is in your devicesToModifyList,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# it adds the network Id and serial number to the devicesToModifyDict.  The devicesToModifyDict is then appended&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# to the serialAndNetworkIdList.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; device &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; devices:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    devicesToModifyDict = &lt;/SPAN&gt;&lt;SPAN&gt;dict&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; device[&lt;/SPAN&gt;&lt;SPAN&gt;'serial'&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; devicesToModifyList:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        devicesToModifyDict[&lt;/SPAN&gt;&lt;SPAN&gt;'networkId'&lt;/SPAN&gt;&lt;SPAN&gt;] = device[&lt;/SPAN&gt;&lt;SPAN&gt;'networkId'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        devicesToModifyDict[&lt;/SPAN&gt;&lt;SPAN&gt;'serial'&lt;/SPAN&gt;&lt;SPAN&gt;] = device[&lt;/SPAN&gt;&lt;SPAN&gt;'serial'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        serialAndNetworkIdList.append(devicesToModifyDict)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# This loops through serialAndNetworkIdList to update the devices.  You can add and remove things to the kwargs dictionary as needed.  Check the API docs&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# for what you can add.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; device &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; serialAndNetworkIdList:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    networkId = device[&lt;/SPAN&gt;&lt;SPAN&gt;'networkId'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    serial = device[&lt;/SPAN&gt;&lt;SPAN&gt;'serial'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    kwargs = {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;'address'&lt;/SPAN&gt;&lt;SPAN&gt;: newAddress,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;'moveMapMarker'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;'tags'&lt;/SPAN&gt;&lt;SPAN&gt;: newTags&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    &lt;/SPAN&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        updateDevices = dashboard.devices.updateNetworkDevice(networkId, serial, **kwargs)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(updateDevices)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&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AN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;continue&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Apr 2020 16:52:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433202#M5373</guid>
      <dc:creator>adammmorton</dc:creator>
      <dc:date>2020-04-07T16:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433203#M5374</link>
      <description>&lt;P&gt;Small Function to write all serials of your network to an xls file&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; meraki&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; xlrd&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; xlwt&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; xlwt &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; Workbook&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; json&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;api_key = '&amp;lt;your key&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dashboard       = meraki.DashboardAPI(api_key)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;my_org = dashboard.organizations.getOrganizations()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; org &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; my_org:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        org_id = org[&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;print&lt;/SPAN&gt;&lt;SPAN&gt;(org[&lt;/SPAN&gt;&lt;SPAN&gt;'name'&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;my_networks = dashboard.networks.getOrganizationNetworks(org_id)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;Get_Network_serials&lt;/SPAN&gt;&lt;SPAN&gt;():&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;    wb = Workbook()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    sheet = wb.add_sheet(&lt;/SPAN&gt;&lt;SPAN&gt;'NW-Serials'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;    row_nr = &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    col_nr = &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;    &lt;/SPAN&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; my_network &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; my_networks:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        sheet.write(row_nr,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,my_network[&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;        sheet.write(row_nr,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,my_network[&lt;/SPAN&gt;&lt;SPAN&gt;'name'&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;        col_nr  = &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;        my_devices = dashboard.devices.getNetworkDevices(my_network[&lt;/SPAN&gt;&lt;SPAN&gt;'id'&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;        &lt;/SPAN&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; my_device &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; my_devices:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;            sheet.write(row_nr,col_nr,my_device[&lt;/SPAN&gt;&lt;SPAN&gt;'serial'&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;            col_nr += &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;        row_nr += &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;    &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;    wb.save(&lt;/SPAN&gt;&lt;SPAN&gt;'Network serials.xls'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;############&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# Main&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;############&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Get_Network_serials()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Apr 2020 06:39:31 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433203#M5374</guid>
      <dc:creator>Edgar-VO</dc:creator>
      <dc:date>2020-04-08T06:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk changes to multiple network devices</title>
      <link>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433204#M5375</link>
      <description>&lt;P&gt;If your API key is tied to multiple orgs, this will only get the devices of the last org it pulls back in the list.  To get all serials in all orgs, you would need to put everything in the "&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; org &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; my_org: loop".&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 12:37:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/bulk-changes-to-multiple-network-devices/m-p/5433204#M5375</guid>
      <dc:creator>adammmorton</dc:creator>
      <dc:date>2020-04-08T12:37:35Z</dc:date>
    </item>
  </channel>
</rss>

