AnsweredAssumed Answered

Trying to Back Up Hosted  Feature Service

Question asked by mtukman on Aug 24, 2014
Latest reply on Nov 5, 2014 by montrad

Does anyone have a good solution to backing up a hosted feature service using python, so a local backup can be run in task scheduler (preferably as a python script)?  I tried to do this using Create Replica and the requests library, but it doesn't seem to be working.  Does anyone know why the following python doesn't work?


import requests, json

payload={"geometry": '',

    "geometryType": "esriGeometryEnvelope",

    "inSR": '',

    "layerQueries": '',

    "layers": "0",

    "replicaName": "read_only_rep",

    "returnAttachments": 'true',

    "returnAttachmentsDataByUrl": 'true',

    "transportType": "esriTransportTypeURL",

    "async": 'false',

    "syncModel": "none",

    "dataFormat": "filegdb",

    "replicaOptions": '',

    "f": "html"}



payload2 = json.dumps(payload)

r2 ='', data=payload2)