<?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: unRegisterReplica at REST API in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/unregisterreplica-at-rest-api/m-p/1513768#M71188</link>
    <description>&lt;P&gt;Got it with this...&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;        grove_layer = arcgis.gis.Item(gis, itemid="8faacxxxxxxxxxxx03410")
        grove_layer_flc = arcgis.features.FeatureLayerCollection(grove_layer.url, gis)
        replica_list = grove_layer_flc.replicas.get_list()
        for r in replica_list:
            replica = grove_layer_flc.replicas.get(r['replicaID'])
            replica_id = replica["replicaID"]
            print('Unregistering ' + replica_id)
            grove_layer_flc.replicas.unregister(replica_id)&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 01 Aug 2024 17:05:37 GMT</pubDate>
    <dc:creator>kapalczynski</dc:creator>
    <dc:date>2024-08-01T17:05:37Z</dc:date>
    <item>
      <title>unRegisterReplica at REST API</title>
      <link>https://community.esri.com/t5/python-questions/unregisterreplica-at-rest-api/m-p/1513744#M71185</link>
      <description>&lt;P&gt;Im trying to unregister a replica using REST API...&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get a list of replicaID's but cant figure out how to construct the python to do the unregister..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;for r in replica_list:
            replicaIDValue = (r['replicaID'])
            print(replicaIDValue)

            portal_item = gis.content.get('8faacd82xxxxxxxxxac03410')
            ports_layer = portal_item.layers[0]
            #removeReplica = ports_layer.UnregisterReplica(replicaID = replicaIDValue)
            removeReplica = portal_item.unRegisterReplica(replicaID = replicaIDValue)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to user &lt;STRONG&gt;Ports_item&lt;/STRONG&gt; which is the ID of the Service&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;removeReplica = portal_item.unRegisterReplica(replicaID = replicaIDValue)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 10400, in __getattr__&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"'%s' object has no attribute '%s'" % (type(self).__name__, name)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;AttributeError: 'Item' object has no attribute 'unRegisterReplica'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and &lt;STRONG&gt;portal_item&lt;/STRONG&gt; which is the specific feature TABLE in the service&lt;/P&gt;&lt;P&gt;Error&lt;/P&gt;&lt;P&gt;&lt;EM&gt;removeReplica = ports_layer.unRegisterReplica(replicaID = replicaIDValue)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;AttributeError: 'FeatureLayer' object has no attribute 'unRegisterReplica'&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 16:35:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unregisterreplica-at-rest-api/m-p/1513744#M71185</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2024-08-01T16:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: unRegisterReplica at REST API</title>
      <link>https://community.esri.com/t5/python-questions/unregisterreplica-at-rest-api/m-p/1513749#M71186</link>
      <description>&lt;P&gt;It seems like you're mixing up the REST API with the ArcGIS API for Python based on the mixed usage in the sample code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you are trying to do is documented here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/checking-out-data-from-feature-layers-using-replicas/" target="_blank"&gt;Sync overview | ArcGIS API for Python&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You have to start with a FeatureLayerCollection object. From there, you get the list of replicas using &lt;SPAN&gt;get_list() and use the results to later run unregister.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 16:44:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unregisterreplica-at-rest-api/m-p/1513749#M71186</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2024-08-01T16:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: unRegisterReplica at REST API</title>
      <link>https://community.esri.com/t5/python-questions/unregisterreplica-at-rest-api/m-p/1513759#M71187</link>
      <description>&lt;P&gt;Or do I do something like a POST?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import http.client

connection = http.client.HTTPSConnection("www.journaldev.com")
connection.request("GET", "/")
response = connection.getresponse()
print("Status: {} and reason: {}".format(response.status, response.reason))

connection.close()&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Aug 2024 16:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unregisterreplica-at-rest-api/m-p/1513759#M71187</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2024-08-01T16:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: unRegisterReplica at REST API</title>
      <link>https://community.esri.com/t5/python-questions/unregisterreplica-at-rest-api/m-p/1513768#M71188</link>
      <description>&lt;P&gt;Got it with this...&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;        grove_layer = arcgis.gis.Item(gis, itemid="8faacxxxxxxxxxxx03410")
        grove_layer_flc = arcgis.features.FeatureLayerCollection(grove_layer.url, gis)
        replica_list = grove_layer_flc.replicas.get_list()
        for r in replica_list:
            replica = grove_layer_flc.replicas.get(r['replicaID'])
            replica_id = replica["replicaID"]
            print('Unregistering ' + replica_id)
            grove_layer_flc.replicas.unregister(replica_id)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Aug 2024 17:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unregisterreplica-at-rest-api/m-p/1513768#M71188</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2024-08-01T17:05:37Z</dc:date>
    </item>
  </channel>
</rss>

