<?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: Cisco Prime 3.3 API call to force sync device in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/cisco-prime-3-3-api-call-to-force-sync-device/m-p/3546466#M1771</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Spencer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply! I checked the "collectionTime" before and after a sync call (while waiting a bit for any queueing and delays). It did not change, so it seems to not sync correctly against my one switch 3650 stack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I did do more testing and found I COULD force a sync successfully on a switch stack with IOS-XE code 16.3.5b, 3.6.6 and 3.6.3. The switch stack I was working on earlier has code 3.3.3, so this may have something to do with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on automating switch state verification after a code upgrade, so the fact that I can't force a sync against older switch code is less important. &lt;IMG src="https://community.cisco.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I won't bother with going down a rabbit hole for an issue that won't apply soon enough &lt;IMG src="https://community.cisco.com/legacyfs/online/emoticons/silly.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jun 2018 17:12:09 GMT</pubDate>
    <dc:creator>Craig Tomkow</dc:creator>
    <dc:date>2018-06-01T17:12:09Z</dc:date>
    <item>
      <title>Cisco Prime 3.3 API call to force sync device</title>
      <link>https://community.cisco.com/t5/controllers/cisco-prime-3-3-api-call-to-force-sync-device/m-p/3546464#M1769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;Hello,&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;I am looking to force a sync of a device via Cisco Prime Infrastructure 3.3 API. I am referencing the following API documentation below.&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;&lt;A href="https://d1nmyq4gcgsfi5.cloudfront.net/media/pi_3_3_devnet/api/v3/op/devices/syncDevices-POST@_docs.html" rel="nofollow noreferrer" style="background-color: #fefefe; color: #003f57; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px;" target="_blank" title="https://d1nmyq4gcgsfi5.cloudfront.net/media/pi_3_3_devnet/api/v3/op/devices/syncDevices-POST@_docs.html"&gt;Prime Infrastructure API Documentation | Cisco Prime Infrastructure API&lt;/A&gt;&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;Basically, I am trying to POST some JSON which specifies the IP address of the device I want to force a sync of. I get a status code of 200, however, I don't see Prime sync'ing the device. I will say, I have been making GET requests for device information easily enough.&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;I am using Python with the 'requests' library to manage the HTTPS request. The library also handles the JSON serialization from a python dictionary.&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;Please see the code snippet below.&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_15277967699578182" jivemacro_uid="_15277967699578182"&gt;
&lt;P&gt;&lt;SPAN&gt;url = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://Prime_Server_IP/webacs/api/v3/op/devices/syncDevices.json" rel="nofollow" target="_blank"&gt;https://Prime_Server_IP/webacs/api/v3/op/devices/syncDevices.json&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;payload = { 'syncDevicesDTO' : { 'devices' : { 'device' : [ { 'address' : 'switch_IP' } ] } } }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;req = requests.post(url, verify=False, auth=(username, password), json=payload)&lt;/P&gt;
&lt;/PRE&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;&lt;/P&gt;&lt;P style="color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 15px; background-color: #fefefe;"&gt;Any help would be appreciated. &lt;BR /&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2018 20:02:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/cisco-prime-3-3-api-call-to-force-sync-device/m-p/3546464#M1769</guid>
      <dc:creator>Craig Tomkow</dc:creator>
      <dc:date>2018-05-31T20:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco Prime 3.3 API call to force sync device</title>
      <link>https://community.cisco.com/t5/controllers/cisco-prime-3-3-api-call-to-force-sync-device/m-p/3546465#M1770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for reaching out &lt;IMG src="https://community.cisco.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you're sending the request correctly, and the fact that you didn't get a 4xx or 5xx response seems to confirm that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a couple things about sync and the way our inventory management component in Prime Infrastructure works:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Sometimes syncs get queued.&amp;nbsp; This can occur when we already have a lot of traffic going out to the network, or to that device in particular.&lt;/LI&gt;&lt;LI&gt;Some devices sync very quickly.&amp;nbsp; In Prime Infrastructure, some devices have less "features"; that doesn't necessarily that the device itself doesn't have a lot of features, just that we don't support configuring or monitoring them via Prime Infrastructure.&amp;nbsp; A good example would be unsupported third party devices, which can sync very quickly because there's not much Prime Infrastructure has to sync.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps the best way to programmatically verify that the sync occurred is to query /webacs/api/v3/data/Devices?.full=true&amp;amp;ipAddress=switch_ip before and after POSTing the sync.&amp;nbsp; The collectionTime parameter should change, and you can also check that collectionStatus is COMPLETED and managementStatus is MANAGED_AND_SYNCHRONIZED.&amp;nbsp; You may happen to catch the sync in progress, in which case collectionStatus will show SYNCHRONIZING and managementStatus will show MANAGED_BUT_SYNCHRONIZING.&amp;nbsp; Should the collectionStatus and managementStatus not move to COMPLETED and MANAGED_AND_SYNCHRONIZED, respectively, then check the collectionDetail parameter, which provides more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you still find that the sync is not actually occuring, please login to the UI as an admin user, go to Administration &amp;gt; Settings &amp;gt; Logging, and click the download log button shortly after performing the sync request via the API.&amp;nbsp; The log bundle is usually quite large.&amp;nbsp; You can reach out to me via email (available to logged in users on my profile) to arrange for secure sharing of the log bundle so that we can help you further &lt;IMG src="https://community.cisco.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2018 16:50:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/cisco-prime-3-3-api-call-to-force-sync-device/m-p/3546465#M1770</guid>
      <dc:creator>Spencer Zier</dc:creator>
      <dc:date>2018-06-01T16:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco Prime 3.3 API call to force sync device</title>
      <link>https://community.cisco.com/t5/controllers/cisco-prime-3-3-api-call-to-force-sync-device/m-p/3546466#M1771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Spencer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply! I checked the "collectionTime" before and after a sync call (while waiting a bit for any queueing and delays). It did not change, so it seems to not sync correctly against my one switch 3650 stack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I did do more testing and found I COULD force a sync successfully on a switch stack with IOS-XE code 16.3.5b, 3.6.6 and 3.6.3. The switch stack I was working on earlier has code 3.3.3, so this may have something to do with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on automating switch state verification after a code upgrade, so the fact that I can't force a sync against older switch code is less important. &lt;IMG src="https://community.cisco.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I won't bother with going down a rabbit hole for an issue that won't apply soon enough &lt;IMG src="https://community.cisco.com/legacyfs/online/emoticons/silly.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2018 17:12:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/cisco-prime-3-3-api-call-to-force-sync-device/m-p/3546466#M1771</guid>
      <dc:creator>Craig Tomkow</dc:creator>
      <dc:date>2018-06-01T17:12:09Z</dc:date>
    </item>
  </channel>
</rss>

