<?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: Programmatically pause/resume collaboration syncs using the arcgis api in ArcGIS Enterprise Portal Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1489016#M15249</link>
    <description>&lt;P&gt;Oh hey that's it&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/539611"&gt;@valenj88&lt;/a&gt;&amp;nbsp;- thanks for this!&amp;nbsp; I've got like 13 distributed collaborations where I update data each weekend, but until this latest release of the api I could not find anything on pause / resume.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem has been that each time a collaboration syncs on schedule, it un-authorizes each collaboration feature layers.&amp;nbsp; And so each day I was having to run an re-authorization script so our layers would re-acquire that green 'authorized' icon . . .&lt;/P&gt;&lt;P&gt;And thanks for reaching out earlier&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jun 2024 18:30:23 GMT</pubDate>
    <dc:creator>DavidColey</dc:creator>
    <dc:date>2024-06-11T18:30:23Z</dc:date>
    <item>
      <title>Programmatically pause/resume collaboration syncs using the arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1488893#M15245</link>
      <description>&lt;P&gt;Hello - does anyone know if there is anyway to pause / resume collaboration syncs using the arcgis api?&amp;nbsp; Maybe somewhere in the arcgis.gis.admin module?&amp;nbsp; From the rest api here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/pause/" target="_blank"&gt;https://developers.arcgis.com/rest/users-groups-and-items/pause/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I've been trying to implement this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;POST /sharing/rest/portals/0123456789ABCDEF/collaborations/3e9d1694351a4b5badef66c7599fced5/workspaces/c3c831f1274a4f228ecd87f1953c6f21/schedule/pause HTTP/1.1
Host: org.arcgis.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

f=pjson&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but with no success.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 14:14:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1488893#M15245</guid>
      <dc:creator>DavidColey</dc:creator>
      <dc:date>2024-06-11T14:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically pause/resume collaboration syncs using the arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1488949#M15246</link>
      <description>&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; from arcgis.gis import GIS&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; from arcgis.gis.admin import Collaboration&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; gis = GIS('https://your.portalsite.here/portal/')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; cm = gis.admin.collaborations&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; c = Collaboration(cm, 'yourCollaborationIDhere')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; c.pause_schedule('yourWorkspaceIDhere')&lt;/PRE&gt;&lt;P&gt;The python code would look something like this&lt;/P&gt;&lt;P&gt;Grabbed from&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.admin.html#collaboration" target="_blank"&gt;arcgis.gis.admin module | ArcGIS API for Python&lt;/A&gt;&amp;nbsp;the collaboration section of the documentation&lt;/P&gt;&lt;P&gt;The command to resume is resume_schedule&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 16:10:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1488949#M15246</guid>
      <dc:creator>valenj88</dc:creator>
      <dc:date>2024-06-11T16:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically pause/resume collaboration syncs using the arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1489016#M15249</link>
      <description>&lt;P&gt;Oh hey that's it&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/539611"&gt;@valenj88&lt;/a&gt;&amp;nbsp;- thanks for this!&amp;nbsp; I've got like 13 distributed collaborations where I update data each weekend, but until this latest release of the api I could not find anything on pause / resume.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem has been that each time a collaboration syncs on schedule, it un-authorizes each collaboration feature layers.&amp;nbsp; And so each day I was having to run an re-authorization script so our layers would re-acquire that green 'authorized' icon . . .&lt;/P&gt;&lt;P&gt;And thanks for reaching out earlier&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 18:30:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1489016#M15249</guid>
      <dc:creator>DavidColey</dc:creator>
      <dc:date>2024-06-11T18:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically pause/resume collaboration syncs using the arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1489021#M15250</link>
      <description>&lt;P&gt;No worries.&amp;nbsp; Also if the data is marked "authoritative" (with the green check) in portal, it *should* carry over to AGOL.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 18:34:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1489021#M15250</guid>
      <dc:creator>valenj88</dc:creator>
      <dc:date>2024-06-11T18:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically pause/resume collaboration syncs using the arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1489423#M15251</link>
      <description>&lt;P&gt;It may now.&amp;nbsp; I had not checked since maybe 10.9.1 - but it didn't then.&amp;nbsp; Could be the way I was doing my collaborations... hosted in my portal (guest), sent to our agol by reference (host)&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 20:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1489423#M15251</guid>
      <dc:creator>DavidColey</dc:creator>
      <dc:date>2024-06-11T20:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically pause/resume collaboration syncs using the arcgis api</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1490852#M15260</link>
      <description>&lt;P&gt;Ok&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/539611"&gt;@valenj88&lt;/a&gt;&amp;nbsp; - here's how I set this up to run in the python IDLE:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;try:
    myCollabs = gis.admin.collaborations.list()
    for myCollab in myCollabs:
        #print (myCollab.name + ' - ' + myCollab.id + ' - ' + myCollab.workspaces)
        if (myCollab.name == 'Sarasota County GIS Cadastral'):
            wss = myCollab.workspaces
            for ws in wss:
                for key, value in ws.items(): #need to set up key value pair because workspaces property is a dictionary of items
                    if key == 'id':
                        print (value)
                        myCollab.pause_schedule(value)
except Exception:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    e = sys.exc_info()[1]
    print(e.args[0])
    print ("Line %i" % tb.tb_lineno)
    message = message + "\n" + "Line %i" % tb.tb_lineno
    message = message + "\n" + str(e)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I'll just set up a try block for each collab I want to pause or resume . . .&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 18:21:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/programmatically-pause-resume-collaboration-syncs/m-p/1490852#M15260</guid>
      <dc:creator>DavidColey</dc:creator>
      <dc:date>2024-06-12T18:21:37Z</dc:date>
    </item>
  </channel>
</rss>

