Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

How to extract url from the result of createReplica #183

Closed jiay0921 closed 8 years ago

jiay0921 commented 8 years ago

For the current ArcREST 3.5.3, we cannot download filegdb directly. My question is how to automatically extract url from the result of createReplica function. The script and result are shown below.

Script: result = fs.createReplica(replicaName='Demo', layers=[0], dataFormat="filegdb", out_path='c:\temp') print (result)

Result: {u'replicaID': u'', u'responseUrl': u'http://services1.arcgis.com/QWdNfRs7lkPq4g4Q/ArcGIS/rest/services/Envr_admin_public_access_3857/replicafiles/9dcab46019a045cbbcb4612c44eaf89.zip', u'transportType': u'esriTransportTypeUrl', u'replicaName': u'Demo'}

The "result" parameter is not a string. How to convert it to string, or how to describe it's properties?

Thank you!

achapkowski commented 8 years ago

The item is a python dictionary, you just need to use the Key name.

jiay0921 commented 8 years ago

result['responseUrl']

Thank you!